10 #include "regexConfProvider.hpp"
49 string confInSameDir(identity +
".conf");
51 string confRelativeToTestDir(
"../../../../src/copyright/agent/" + identity +
".conf");
54 + identity +
"/agent/" + identity +
".conf");
62 return confRelativeToTestDir;
66 return confInInstallDir;
74 : _isVerbosityDebug(isVerbosityDebug) {}
88 cout <<
"try to open conf: " << confFile << endl;
89 stream.open(confFile.c_str());
91 return stream.is_open();
102 if (rmm.find(identity) == rmm.end())
104 #pragma omp critical(rmm)
106 if (rmm.find(identity) == rmm.end())
116 cout <<
"cannot open regex definitions in conf: " <<
getRegexConfFile(identity) << endl;
121 cout <<
"the identity " << identity <<
" is already loaded" << endl;
132 istringstream& stream)
135 if (rmm.find(identity) == rmm.end())
137 #pragma omp critical(rmm)
139 if (rmm.find(identity) == rmm.end())
145 cout <<
"the identity " << identity <<
" is already loaded" << endl;
161 #pragma omp critical(rmm)
165 return (*rv).c_str();
void maybeLoad(const std::string &identity)
Check if identity already loaded in RegexMap, if not load them.
bool getRegexConfStream(const std::string &identity, std::ifstream &stream)
Get file stream for regex conf file.
RegexConfProvider(const bool isVerbosityDebug=false)
Constructor to set verbosity level.
const char * getRegexValue(const std::string &name, const std::string &key)
Get the regex as string from the RegexMap.
static std::map< std::string, RegexMap > _regexMapMap
Map to store RegexMap with a string key.
RegexMap readConfStreamToMap(std::istringstream &stream, const bool isVerbosityDebug)
Read a string stream and crate a RegexMap.
string getRegexConfFile(const string &identity)
Get the regex conf file.
bool testIfFileExists(const string &filename)
Check if a given file exists.
int exists
Default not exists.