Commit e0fa4aa8 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

removed variable m_oargvcpp, m_oargv now of type std::vector<std::string>,...

removed variable m_oargvcpp, m_oargv now of type std::vector<std::string>, added getter for oargv and oargc
parent 217c38fd
......@@ -45,7 +45,6 @@
#include "fileStream.h"
#include "pipeStream.h"
static int processNum = 0;
void
setProcessNum(int p_num)
......@@ -75,20 +74,10 @@ Process::setOperatorArgv(const char *operatorArguments)
std::istringstream f(operatorArguments);
std::string s;
getline(f,s,',');
getline(f, s, ',');
while (getline(f, s, ','))
{
m_oargvcpp.push_back(s);
}
while ((operatorArg = strchr(operatorArg, ',')) != nullptr)
{
*operatorArg = '\0';
operatorArg++;
if (strlen(operatorArg))
{
m_oargv.push_back(operatorArg);
}
m_oargv.push_back(s);
}
}
......@@ -301,10 +290,7 @@ Process::inqUserInputForOpArg(const char *enter)
len = 0;
while (pline[len] != ' ' && pline[len] != ',' && pline[len] != '\\' && len < linelen) len++;
m_oargv.push_back((char *) Malloc(len + 1));
memcpy(m_oargv[oargc], pline, len);
m_oargvcpp.push_back(m_oargv.back());
m_oargv[oargc][len] = '\0';
m_oargv.push_back(m_oargv.back());
oargc++;
pline += len;
......@@ -574,3 +560,23 @@ Process::getOutStreamName()
{
return outputStreams[0]->m_name.c_str();
}
size_t
Process::getOperArgc()
{
return m_oargc;
}
std::string
Process::getArgv(int p_idx)
{
if(!(p_idx > m_oargc && p_idx > 0))
cdoAbort("Process Argv not found. Idx: %d, Process argc: %d", p_idx,m_oargv.size());
return m_oargv[p_idx];
}
std::string
Process::getObase()
{
return m_obase;
}
......@@ -77,10 +77,7 @@ public:
const char *m_obase;
module_t m_module;
std::vector<char *> m_oargv;
std::vector<std::string> m_oargvcpp;
/*TEMP*/ // remove m_oargc and replace usage with
// m_oargv.size()/operatorArgc()
std::vector<std::string> m_oargv;
int m_oargc;
oper_t oper[MAX_OPERATOR];
......@@ -159,6 +156,9 @@ public:
bool hasNoPipes();
size_t inqNvals();
const char *getOutStreamName();
size_t getOperArgc();
std::string getArgv(int idx);
std::string getObase();
private:
void initProcess();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment