50 int ReadStringOption(
const string& a_input, T* ap_return,
int a_nbElts,
const string& a_sep,
const string& a_option)
53 if (a_nbElts<=0)
return 0;
57 Cerr(
"***** gOptions::ReadStringOption() -> Separator is empty while reading option '" << a_option <<
"' !" << endl);
62 string tmp_input = a_input;
64 while ((pos=tmp_input.find_first_of(a_sep,0))!=string::npos)
66 tmp_input = tmp_input.substr(pos+1);
70 if (nb_sep>a_nbElts-1)
72 Cerr(
"***** gOptions::ReadStringOption() -> Too many parameters in '" << a_input <<
"' while reading option '" << a_option <<
"' (expecting " << a_nbElts <<
") !" << endl);
76 if (nb_sep<a_nbElts-1)
78 Cerr(
"***** gOptions::ReadStringOption() -> Not enough parameters in '" << a_input <<
"' while reading option '" << a_option <<
"' (expecting " << a_nbElts <<
") !" << endl);
83 size_t pos2 = a_input.find_first_of(a_sep, 0);
84 for (
int i=0; i<a_nbElts; i++)
87 string elt = a_input.substr(pos1, pos2-pos1);
90 Cerr(
"***** gOptions::ReadStringOption() -> Error when trying to read input data for option '" << a_option <<
"' !" << endl);
94 pos2 = a_input.find_first_of(a_sep, pos1);
129 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T* ap_return,
int a_nbElts,
bool a_mandatoryFlag)
131 ifstream input_file(a_file.c_str(), ios::in);
134 string sep_comment =
"#";
135 string sep_elt =
",";
140 while(!input_file.eof())
142 getline(input_file, line);
145 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment)) ;
147 if (line.find(a_keyword) != string::npos)
151 line = line.substr(line.find_first_of(sep)+1);
157 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
158 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
161 size_t pos2 = line.find_first_of(sep_elt, pos);
164 if (a_nbElts>1 && pos2 == string::npos)
166 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
171 for (
int i=0 ; i<a_nbElts ; i++)
175 if (pos==string::npos)
177 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
178 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
183 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
187 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
195 pos = (pos2==string::npos) ? string::npos : pos2+1;
196 pos2 = line.find_first_of(sep_elt, pos);
205 if (a_mandatoryFlag ==
true)
207 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
217 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '"<< a_file <<
"' !" << endl);
256 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag)
258 ifstream input_file(a_file.c_str(), ios::in);
261 string sep_comment =
"#";
262 string sep_elt =
",";
267 while (!input_file.eof())
269 getline(input_file, line);
272 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment));
274 if (line.find(a_keyword) != string::npos)
277 for (
int l=0 ; l<a_nbLines ; l++)
279 getline(input_file, line);
281 line = line.substr(line.find_first_of(sep)+1);
287 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
288 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
291 size_t pos2 = line.find_first_of(sep_elt, pos);
294 if (a_nbElts>1 && pos2 == string::npos)
296 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
301 for (
int i=0 ; i<a_nbElts ; i++)
305 if (pos==string::npos)
307 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
308 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
313 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
317 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file " << a_file << endl);
324 pos = (pos2==string::npos) ? string::npos : pos2+1;
325 pos2 = line.find_first_of(sep_elt, pos);
334 if (a_mandatoryFlag ==
true)
336 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
346 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '" << a_file <<
"' !" << endl);
386 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag)
388 ifstream input_file(a_file.c_str(), ios::in);
391 string sep_comment =
"#";
392 string sep_elt =
",";
397 while (!input_file.eof())
399 getline(input_file, line);
403 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment));
405 if (line.find(a_keyword) != string::npos)
408 for (
int l=0 ; l<a_nbLines ; l++)
410 getline(input_file, line);
413 line = line.substr(line.find_first_of(sep)+1);
419 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
420 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
423 size_t pos2 = line.find_first_of(sep_elt, pos);
426 if (a_nbElts>1 && pos2 == string::npos)
428 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
433 for (
int i=0 ; i<a_nbElts ; i++)
437 if (pos==string::npos)
439 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
440 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
445 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
449 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file " << a_file << endl);
456 pos = (pos2==string::npos) ? string::npos : pos2+1;
457 pos2 = line.find_first_of(sep_elt, pos);
466 if (a_mandatoryFlag ==
true )
468 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
478 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '" << a_file <<
"' !" << endl);
520 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag)
522 ifstream input_file(a_file.c_str(), ios::in);
525 string sep_comment =
"#";
526 string sep_elt =
",";
527 bool search_on =
false;
532 while(!input_file.eof())
534 getline(input_file, line);
537 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment)) ;
539 if( line.find(a_firstTag) != string::npos) search_on =
true;
540 if( line.find(a_lastTag) != string::npos || line.find(
"eof") != string::npos ) search_on =
false;
544 if (line.find(a_keyword) != string::npos)
548 line = line.substr(line.find_first_of(sep)+1);
554 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
555 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
558 size_t pos2 = line.find_first_of(sep_elt, pos);
561 if (a_nbElts>1 && pos2 == string::npos)
563 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
568 for (
int i=0 ; i<a_nbElts ; i++)
573 if (pos==string::npos)
575 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
576 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
581 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
585 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
592 pos = (pos2==string::npos) ? string::npos : pos2+1;
593 pos2 = line.find_first_of(sep_elt, pos);
606 if(a_mandatoryFlag ==
true)
608 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
618 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '"<< a_file <<
"' !" << endl);
665 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag)
667 ifstream input_file(a_file.c_str(), ios::in);
670 string sep_comment =
"#";
671 string sep_elt =
",";
672 bool search_on =
false;
677 while(!input_file.eof())
679 getline(input_file, line);
682 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment)) ;
684 if( line.find(a_firstTag) != string::npos) search_on =
true;
685 if( line.find(a_lastTag) != string::npos || line.find(
"eof") != string::npos ) search_on =
false;
689 if (line.find(a_keyword) != string::npos)
691 for (
int l=0 ; l<a_nbLines ; l++)
693 getline(input_file, line);
696 line = line.substr(line.find_first_of(sep)+1);
702 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
703 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
706 size_t pos2 = line.find_first_of(sep_elt, pos);
709 if (a_nbElts>1 && pos2 == string::npos)
711 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
716 for (
int i=0 ; i<a_nbElts ; i++)
720 if (pos==string::npos)
722 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
723 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
728 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
732 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file " << a_file << endl);
739 pos = (pos2==string::npos) ? string::npos : pos2+1;
740 pos2 = line.find_first_of(sep_elt, pos);
749 if(a_mandatoryFlag ==
true)
751 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
761 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '"<< a_file <<
"' !" << endl);
784 *a_result = a_str.c_str();
806 const char* p = a_str.c_str();
809 double val = strtod(p, &end);
813 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into float " << endl);
818 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into float " << endl);
822 *a_result =
static_cast<float>(val);
845 const char* p = a_str.c_str();
848 double val = strtod(p, &end);
852 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into double " << endl);
857 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into double " << endl);
884 const char* p = a_str.c_str();
887 long double val = strtold(p, &end);
891 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into double " << endl);
896 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into double " << endl);
923 const char* p = a_str.c_str();
926 int64_t val = strtol(p, &end, 10);
930 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into int " << endl);
933 if (errno==ERANGE || val<INT_MIN || val>INT_MAX)
935 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into int " << endl);
939 *a_result =
static_cast<int>(val);
962 const char* p = a_str.c_str();
965 int64_t val = strtol(p, &end, 10);
969 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into int64_t " << endl);
974 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into int64_t " << endl);
1001 const char* p = a_str.c_str();
1004 int64_t val = strtol(p, &end, 10);
1008 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
1011 if (errno == ERANGE || val<0 || val>UCHAR_MAX)
1013 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
1040 const char* p = a_str.c_str();
1043 int64_t val = strtol(p, &end, 10);
1047 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
1050 if (errno == ERANGE || val<0 || val>USHRT_MAX)
1052 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
1079 const char* p = a_str.c_str();
1082 int64_t val = strtol(p, &end, 10);
1086 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into uint32 " << endl);
1089 if (errno == ERANGE || val<0 || val>UINT_MAX)
1091 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into uint32 " << endl);
1118 const char* p = a_str.c_str();
1121 int64_t val = strtol(p, &end, 10);
1125 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into bool " << endl);
1128 if (errno == ERANGE || val<0 || val>1)
1130 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into bool " << endl);
1154 string path = a_pathToFile;
1156 int pos = path.find_last_of(
OS_SEP);
1157 if (path.find_last_of(
OS_SEP) == string::npos)
1160 path = path.substr(pos+1);
1179 string path = a_pathToFile;
1181 int pos = path.find_last_of(
OS_SEP);
1182 if (path.find_last_of(
OS_SEP) == string::npos)
1185 path = path.substr(0,pos+1);
1199 string result = a_path;
1201 while ( (position = result.find_first_of(
"/")) != string::npos )
1203 result.replace(position,1,
"\\");
1219 FLTNB absA = abs(a);
1220 FLTNB absB = abs(b);
1221 FLTNB diff = abs(a - b);
1229 diff < std::numeric_limits<FLTNB>::min())
1231 return diff < (a_eps * std::numeric_limits<FLTNB>::min() );
1235 return diff / min((absA + absB), std::numeric_limits<FLTNB>::max()) < a_eps;
1246 template int ReadStringOption<string>(
const string& a_input,
string* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1247 template int ReadStringOption<int>(
const string& a_input,
int* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1248 template int ReadStringOption<int64_t>(
const string& a_input, int64_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1249 template int ReadStringOption<float>(
const string& a_input,
float* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1250 template int ReadStringOption<double>(
const string& a_input,
double* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1251 template int ReadStringOption<long double>(
const string& a_input,
long double* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1252 template int ReadStringOption<uint8_t>(
const string& a_input, uint8_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1253 template int ReadStringOption<uint16_t>(
const string& a_input, uint16_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1254 template int ReadStringOption<uint32_t>(
const string& a_input, uint32_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1255 template int ReadStringOption<bool>(
const string& a_input,
bool* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1257 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1258 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1259 template int ReadDataASCIIFile<int64_t>(
const string& a_file,
const string& a_keyword, int64_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1260 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1261 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1262 template int ReadDataASCIIFile<long double>(
const string& a_file,
const string& a_keyword,
long double* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1263 template int ReadDataASCIIFile<uint8_t>(
const string& a_file,
const string& a_keyword, uint8_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1264 template int ReadDataASCIIFile<uint16_t>(
const string& a_file,
const string& a_keyword, uint16_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1265 template int ReadDataASCIIFile<uint32_t>(
const string& a_file,
const string& a_keyword, uint32_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1266 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1268 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1269 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1270 template int ReadDataASCIIFile<int64_t>(
const string& a_file,
const string& a_keyword, int64_t* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1271 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1272 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1273 template int ReadDataASCIIFile<long double>(
const string& a_file,
const string& a_keyword,
long double* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1274 template int ReadDataASCIIFile<uint8_t>(
const string& a_file,
const string& a_keyword, uint8_t* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1275 template int ReadDataASCIIFile<uint16_t>(
const string& a_file,
const string& a_keyword, uint16_t* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1276 template int ReadDataASCIIFile<uint32_t>(
const string& a_file,
const string& a_keyword, uint32_t* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1277 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1279 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1280 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1281 template int ReadDataASCIIFile<int64_t>(
const string& a_file,
const string& a_keyword, int64_t** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1282 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1283 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1284 template int ReadDataASCIIFile<long double>(
const string& a_file,
const string& a_keyword,
long double** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1285 template int ReadDataASCIIFile<uint8_t>(
const string& a_file,
const string& a_keyword, uint8_t** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1286 template int ReadDataASCIIFile<uint16_t>(
const string& a_file,
const string& a_keyword, uint16_t** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1287 template int ReadDataASCIIFile<uint32_t>(
const string& a_file,
const string& a_keyword, uint32_t** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1288 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1290 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1291 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1292 template int ReadDataASCIIFile<int64_t>(
const string& a_file,
const string& a_keyword, int64_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1293 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1294 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1295 template int ReadDataASCIIFile<long double>(
const string& a_file,
const string& a_keyword,
long double* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1296 template int ReadDataASCIIFile<uint8_t>(
const string& a_file,
const string& a_keyword, uint8_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1297 template int ReadDataASCIIFile<uint16_t>(
const string& a_file,
const string& a_keyword, uint16_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1298 template int ReadDataASCIIFile<uint32_t>(
const string& a_file,
const string& a_keyword, uint32_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1299 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool* ap_return,
int a_nbElts,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1301 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1302 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1303 template int ReadDataASCIIFile<int64_t>(
const string& a_file,
const string& a_keyword, int64_t** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1304 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1305 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1306 template int ReadDataASCIIFile<long double>(
const string& a_file,
const string& a_keyword,
long double** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1307 template int ReadDataASCIIFile<uint8_t>(
const string& a_file,
const string& a_keyword, uint8_t** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1308 template int ReadDataASCIIFile<uint16_t>(
const string& a_file,
const string& a_keyword, uint16_t** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1309 template int ReadDataASCIIFile<uint32_t>(
const string& a_file,
const string& a_keyword, uint32_t** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
1310 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag,
string a_firstTag,
string a_lastTag);
string GetFileFromPath(const string &a_pathToFile)
Simply return the file from a path string passed in parameter.
This header file is mainly used to declare some macro definitions and all includes needed from the st...
template int ReadDataASCIIFile< double >(const string &a_file, const string &a_keyword, double *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadDataASCIIFile< float >(const string &a_file, const string &a_keyword, float *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadDataASCIIFile< int >(const string &a_file, const string &a_keyword, int *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadStringOption< int64_t >(const string &a_input, int64_t *ap_return, int a_nbElts, const string &sep, const string &a_option)
int ReadStringOption(const string &a_input, T *ap_return, int a_nbElts, const string &a_sep, const string &a_option)
Parse the 'a_input' string corresponding to the 'a_option' into 'a_nbElts' elements, using the 'sep' separator. The results are returned in the templated 'ap_return' dynamic templated array. Call "ConvertFromString()" to perform the correct conversion depending on the type of the data to convert.
template int ReadStringOption< uint8_t >(const string &a_input, uint8_t *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadStringOption< uint32_t >(const string &a_input, uint32_t *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadDataASCIIFile< int64_t >(const string &a_file, const string &a_keyword, int64_t *ap_return, int a_nbElts, bool a_mandatoryFlag)
#define KEYWORD_MANDATORY_NOT_FOUND
template int ReadStringOption< string >(const string &a_input, string *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadDataASCIIFile< long double >(const string &a_file, const string &a_keyword, long double *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadStringOption< uint16_t >(const string &a_input, uint16_t *ap_return, int a_nbElts, const string &sep, const string &a_option)
string ConvertAllSlashOccurrencesToBackSlash(const string &a_path)
bool FLTNBIsEqual(FLTNB a, FLTNB b, FLTNB a_eps)
Comparison of FLTNB numbers.
string GetPathOfFile(const string &a_pathToFile)
Simply return the path to the directory of a file path string passed in parameter.
template int ReadDataASCIIFile< bool >(const string &a_file, const string &a_keyword, bool *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadDataASCIIFile< uint16_t >(const string &a_file, const string &a_keyword, uint16_t *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadDataASCIIFile< uint8_t >(const string &a_file, const string &a_keyword, uint8_t *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadDataASCIIFile< string >(const string &a_file, const string &a_keyword, string *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadStringOption< bool >(const string &a_input, bool *ap_return, int a_nbElts, const string &sep, const string &a_option)
#define KEYWORD_OPTIONAL_NOT_FOUND
template int ReadStringOption< double >(const string &a_input, double *ap_return, int a_nbElts, const string &sep, const string &a_option)
Declaration of class sOutputManager.
template int ReadDataASCIIFile< uint32_t >(const string &a_file, const string &a_keyword, uint32_t *ap_return, int a_nbElts, bool a_mandatoryFlag)
This file is used for all kind of different functions designed for options parsing and ASCII file rea...
int ReadDataASCIIFile(const string &a_file, const string &a_keyword, T *ap_return, int a_nbElts, bool a_mandatoryFlag)
Look for "a_nbElts" elts in the "a_file" file matching the "a_keyword" string passed as parameter a...
int ConvertFromString(const string &a_str, string *a_result)
Copy the 'a_str' string in the position pointed by 'a_result'.
template int ReadStringOption< float >(const string &a_input, float *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadStringOption< int >(const string &a_input, int *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadStringOption< long double >(const string &a_input, long double *ap_return, int a_nbElts, const string &sep, const string &a_option)