-//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
+//===--- Action.h - The LLVM Compiler Driver --------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
#include <string>
#include <vector>
-namespace llvmcc {
+namespace llvmc {
+ typedef std::vector<std::string> StrVector;
+
+ /// Action - A class that encapsulates a single shell command.
class Action {
+ /// Command_ - The actual command (for example, 'ls').
std::string Command_;
+ /// Args_ - Command arguments. Stdout redirection ("> file") is allowed.
std::vector<std::string> Args_;
public:
- Action (std::string const& C,
- std::vector<std::string> const& A)
+ Action() {}
+ Action (const std::string& C, const StrVector& A)
: Command_(C), Args_(A)
{}
+ /// Execute - Executes the represented action.
int Execute() const;
};