|
AndroMeta
2.0.0
|
00001 /* 00002 * Copyright 2009-2012 AndroMeta LLC. All rights reserved. 00003 * 00004 * AndroMeta LLC retains all intellectual property and proprietary 00005 * rights to this software and related documentation and any modifications 00006 * thereto. Any use, reproduction, disclosure, or distribution of this 00007 * software and related documentation without an express license agreement 00008 * from AndroMeta LLC is strictly prohibited. 00009 * 00010 */ 00011 00012 00020 #ifndef ANDROMETA_M_COMMAND_H 00021 #define ANDROMETA_M_COMMAND_H 00022 00023 #include <AndroMeta/MStr.h> 00024 #include <AndroMeta/MTime.h> 00025 00026 namespace Meta{ 00027 00033 class MCommand{ 00034 public: 00035 00036 static const int Input = 0x01; 00037 static const int Output = 0x02; 00038 static const int Error = 0x04; 00039 static const int Persistent = 0x08; 00040 00047 MCommand(const mstr& command, int mode=0); 00048 00052 ~MCommand(); 00053 00057 bool readOutput(mstr& out, const mtime& timeout); 00058 00066 void matchOutput(const mstr& re, mvec& m); 00067 00080 bool matchOutput(const mstr& re, mvec& m, const mtime& timeout); 00081 00085 bool readError(mstr& err, const mtime& timeout); 00086 00094 void matchError(const mstr& re, mvec& m); 00095 00108 bool matchError(const mstr& re, mvec& m, const mtime& timeout); 00109 00113 void write(const mstr& in); 00114 00118 int await(); 00119 00123 int processId(); 00124 00130 int status(); 00131 00135 void close(); 00136 00137 private: 00138 class MCommand_* x_; 00139 }; 00140 00141 } // end namespace Meta 00142 00143 #endif // ANDROMETA_M_COMMAND_H
1.7.6.1