humble beginnings for subprocess- needs reworked

This commit is contained in:
Phanes
2017-08-06 19:26:51 -04:00
parent 0552f80b77
commit 3bc8908d65
6 changed files with 51 additions and 71 deletions

32
src/sproc/Sproc.h Normal file
View File

@@ -0,0 +1,32 @@
#ifndef FTESTS_SPROC_H
#define FTESTS_SPROC_H
#include "string"
struct ExecutionInput {
std::string executionString;
// std::string STDIN;
// std::vector<KeyValuePair> EnvironmentVariables;
};
struct Execution {
//input
ExecutionInput input;
// output
int return_code;
std::string STDOUT;
std::string STDERR;
};
// executes a subprocess and captures STDOUT, STDERR, and return code.
// should be able to recieve path of binary to be executed as well as any parameters
class Sproc {
public:
// call the object. returnvalue is enum representing external execution attempt not binary exit code
static int execute( ExecutionInput input, Execution & output );
};
#endif //FTESTS_SPROC_H