HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ShellExec.hpp
Go to the documentation of this file.
1 
14 #ifndef SHELL_EXEC_HPP
15 #define SHELL_EXEC_HPP
16 
17 #include "ExecBase.hpp"
18 
19 //-----------------------------------------------------------------------------
20 class ShellExec : public ExecBase
21 {
22  enum {SZ=4096};
23 public:
24  explicit ShellExec(const std::string& cmd_);
25  virtual ~ShellExec(void) {}
26 
27  bool exec(std::ostream& os=std::cout, std::ostream& es=std::cerr);
28  unsigned int getExitStatus(void) const {return exitStatus;}
29 
30 private:
31  unsigned int exitStatus;
32 
33  friend std::ostream& operator << (std::ostream& os, const ShellExec& shellExec);
34  friend std::string& operator << (std::string& str, const ShellExec& shellExec);
35  typedef ExecBase inherited;
36 };
37 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 
40 #endif // SHELL_EXEC_HPP