#include "abstractSoftware.h" #include "dataManager.h" abstractSoftware::abstractSoftware() { globParamPtr_ = NULL; dataManager_ = NULL; } abstractSoftware::abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt) { inputFileName_ = inputFileName; globParamPtr_ = globals; dataManager_ = dt; } bool abstractSoftware::launchJob(string commandLine, string& resul) { bool ExecuteStatus = true; FILE* pp = popen(commandLine.c_str(), "r"); ostringstream sortie; if (pp == NULL) { sortie << " launching failed : " << commandLine << endl; ExecuteStatus = false; } else { cout << " executing command : " << commandLine << endl; // on copie la sortie dans le fichier assigne char buf[132]; while (fgets(buf, sizeof buf, pp)) { sortie << buf; } pclose(pp); } resul = sortie.str(); return ExecuteStatus; }