22 #ifndef _osaPipeExec_h
23 #define _osaPipeExec_h
33 enum {INTERNALS_SIZE = 32};
34 char Internals[INTERNALS_SIZE];
38 static unsigned int SizeOfInternals(
void);
39 friend class osaPipeExecTest;
51 void CloseAllPipes(
void);
55 char ** ParseCommand(
const std::string & executable,
56 const std::vector<std::string> & arguments);
58 #if (CISST_OS == CISST_WINDOWS)
62 void RestoreIO(
int newStdin,
int newStdout);
76 bool Open(
const std::string & executable,
const std::string & mode);
82 bool Open(
const std::string & executable,
83 const std::vector<std::string> & parameters,
84 const std::string & mode);
88 bool Close(
bool killProcess =
true);
92 int Read(
char * buffer,
int maxLength)
const;
97 std::string Read(
int maxLength)
const;
101 int ReadUntil(
char * buffer,
int maxLength,
char stopChar)
const;
105 std::string ReadUntil(
int maxLength,
char stopChar)
const;
108 std::string ReadString(
int maxLength)
const;
112 int Write(
const char * buffer);
116 int Write(
const char * buffer,
int n);
120 int Write(
const std::string & s);
124 int Write(
const std::string & s,
int n);
128 bool IsConnected(
void)
const;
131 const std::string & GetName(
void)
const;
134 #endif // _osaPipeExec_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Macros to export the symbols of cisstOSAbstraction (in a Dll).
Definition: osaPipeExec.h:31