2008-03-23 08:57:20 +00:00
|
|
|
//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open
|
|
|
|
// Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2008-05-06 16:34:12 +00:00
|
|
|
// Action - encapsulates a single shell command.
|
2008-03-23 08:57:20 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2008-05-06 16:34:12 +00:00
|
|
|
#ifndef LLVM_TOOLS_LLVMC2_ACTION_H
|
|
|
|
#define LLVM_TOOLS_LLVMC2_ACTION_H
|
2008-03-23 08:57:20 +00:00
|
|
|
|
2008-05-06 16:34:12 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2008-03-23 08:57:20 +00:00
|
|
|
|
2008-05-06 18:08:59 +00:00
|
|
|
namespace llvmc {
|
|
|
|
|
|
|
|
typedef std::vector<std::string> StringVector;
|
2008-03-23 08:57:20 +00:00
|
|
|
|
2008-05-07 21:50:19 +00:00
|
|
|
/// Action - A class that encapsulates a single shell command.
|
2008-05-06 16:34:12 +00:00
|
|
|
class Action {
|
2008-05-07 21:50:19 +00:00
|
|
|
/// Command_ - The actual command (for example, 'ls').
|
2008-05-06 16:34:12 +00:00
|
|
|
std::string Command_;
|
2008-05-07 21:50:19 +00:00
|
|
|
/// Args_ - Command arguments. Stdout redirection is allowed.
|
2008-05-06 16:34:12 +00:00
|
|
|
std::vector<std::string> Args_;
|
|
|
|
public:
|
2008-05-06 18:08:59 +00:00
|
|
|
Action (const std::string& C,
|
|
|
|
const StringVector& A)
|
2008-05-06 16:34:12 +00:00
|
|
|
: Command_(C), Args_(A)
|
|
|
|
{}
|
|
|
|
|
2008-05-07 21:50:19 +00:00
|
|
|
/// Execute - Executes the represented action.
|
2008-05-06 16:34:39 +00:00
|
|
|
int Execute() const;
|
2008-05-06 16:34:12 +00:00
|
|
|
};
|
2008-03-23 08:57:20 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-05-06 16:34:12 +00:00
|
|
|
#endif // LLVM_TOOLS_LLVMC2_ACTION_H
|