9 #include "gVariables.hh" 10 #include "gOptions.hh" 11 #include "sOutputManager.hh" 28 int ReadStringOption(
const string& a_input, T* ap_return,
int a_nbElts,
const string& a_sep,
const string& a_option)
31 if (a_nbElts<=0)
return 0;
35 Cerr(
"***** gOptions::ReadStringOption() -> Separator is empty while reading option '" << a_option <<
"' !" << endl);
40 string tmp_input = a_input;
42 while ((pos=tmp_input.find_first_of(a_sep,0))!=string::npos)
44 tmp_input = tmp_input.substr(pos+1);
48 if (nb_sep>a_nbElts-1)
50 Cerr(
"***** gOptions::ReadStringOption() -> Too many parameters in '" << a_input <<
"' while reading option '" << a_option <<
"' (expecting " << a_nbElts <<
") !" << endl);
54 if (nb_sep<a_nbElts-1)
56 Cerr(
"***** gOptions::ReadStringOption() -> Not enough parameters in '" << a_input <<
"' while reading option '" << a_option <<
"' (expecting " << a_nbElts <<
") !" << endl);
61 size_t pos2 = a_input.find_first_of(a_sep, 0);
62 for (
int i=0; i<a_nbElts; i++)
65 string elt = a_input.substr(pos1, pos2-pos1);
68 Cerr(
"***** gOptions::ReadStringOption() -> Error when trying to read input data for option '" << a_option <<
"' !" << endl);
72 pos2 = a_input.find_first_of(a_sep, pos1);
107 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T* ap_return,
int a_nbElts,
bool a_mandatoryFlag)
109 ifstream input_file(a_file.c_str(), ios::in);
112 string sep_comment =
"#";
113 string sep_elt =
",";
118 while(!input_file.eof())
120 getline(input_file, line);
123 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment)) ;
125 if (line.find(a_keyword) != string::npos)
129 line = line.substr(line.find_first_of(sep)+1);
135 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
136 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
139 size_t pos2 = line.find_first_of(sep_elt, pos);
142 if (a_nbElts>1 && pos2 == string::npos)
144 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
149 for (
int i=0 ; i<a_nbElts ; i++)
153 if (pos==string::npos)
155 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
156 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
161 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
165 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
173 pos = (pos2==string::npos) ? string::npos : pos2+1;
174 pos2 = line.find_first_of(sep_elt, pos);
183 if (a_mandatoryFlag ==
true)
185 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
195 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '"<< a_file <<
"' !" << endl);
234 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag)
236 ifstream input_file(a_file.c_str(), ios::in);
239 string sep_comment =
"#";
240 string sep_elt =
",";
245 while (!input_file.eof())
247 getline(input_file, line);
250 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment));
252 if (line.find(a_keyword) != string::npos)
255 for (
int l=0 ; l<a_nbLines ; l++)
257 getline(input_file, line);
259 line = line.substr(line.find_first_of(sep)+1);
265 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
266 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
269 size_t pos2 = line.find_first_of(sep_elt, pos);
272 if (a_nbElts>1 && pos2 == string::npos)
274 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
279 for (
int i=0 ; i<a_nbElts ; i++)
283 if (pos==string::npos)
285 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
286 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
291 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
295 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file " << a_file << endl);
302 pos = (pos2==string::npos) ? string::npos : pos2+1;
303 pos2 = line.find_first_of(sep_elt, pos);
312 if (a_mandatoryFlag ==
true)
314 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
324 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '" << a_file <<
"' !" << endl);
364 int ReadDataASCIIFile(
const string& a_file,
const string& a_keyword, T** a2p_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag)
366 ifstream input_file(a_file.c_str(), ios::in);
369 string sep_comment =
"#";
370 string sep_elt =
",";
375 while (!input_file.eof())
377 getline(input_file, line);
381 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment));
383 if (line.find(a_keyword) != string::npos)
386 for (
int l=0 ; l<a_nbLines ; l++)
388 getline(input_file, line);
391 line = line.substr(line.find_first_of(sep)+1);
397 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
398 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
401 size_t pos2 = line.find_first_of(sep_elt, pos);
404 if (a_nbElts>1 && pos2 == string::npos)
406 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
411 for (
int i=0 ; i<a_nbElts ; i++)
415 if (pos==string::npos)
417 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
418 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
423 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
427 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file " << a_file << endl);
434 pos = (pos2==string::npos) ? string::npos : pos2+1;
435 pos2 = line.find_first_of(sep_elt, pos);
444 if (a_mandatoryFlag ==
true )
446 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
456 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '" << a_file <<
"' !" << endl);
498 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)
500 ifstream input_file(a_file.c_str(), ios::in);
503 string sep_comment =
"#";
504 string sep_elt =
",";
505 bool search_on =
false;
510 while(!input_file.eof())
512 getline(input_file, line);
515 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment)) ;
517 if( line.find(a_firstTag) != string::npos) search_on =
true;
518 if( line.find(a_lastTag) != string::npos || line.find(
"eof") != string::npos ) search_on =
false;
522 if (line.find(a_keyword) != string::npos)
526 line = line.substr(line.find_first_of(sep)+1);
532 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
533 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
536 size_t pos2 = line.find_first_of(sep_elt, pos);
539 if (a_nbElts>1 && pos2 == string::npos)
541 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
546 for (
int i=0 ; i<a_nbElts ; i++)
551 if (pos==string::npos)
553 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
554 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
559 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
563 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
570 pos = (pos2==string::npos) ? string::npos : pos2+1;
571 pos2 = line.find_first_of(sep_elt, pos);
584 if(a_mandatoryFlag ==
true)
586 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
596 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '"<< a_file <<
"' !" << endl);
643 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)
645 ifstream input_file(a_file.c_str(), ios::in);
648 string sep_comment =
"#";
649 string sep_elt =
",";
650 bool search_on =
false;
655 while(!input_file.eof())
657 getline(input_file, line);
660 if (line.find(sep_comment) != string::npos) line = line.substr(0, line.find_first_of(sep_comment)) ;
662 if( line.find(a_firstTag) != string::npos) search_on =
true;
663 if( line.find(a_lastTag) != string::npos || line.find(
"eof") != string::npos ) search_on =
false;
667 if (line.find(a_keyword) != string::npos)
669 for (
int l=0 ; l<a_nbLines ; l++)
671 getline(input_file, line);
674 line = line.substr(line.find_first_of(sep)+1);
680 line.erase(0, line.find_first_not_of(
" !\t\r\n"));
681 line.erase(line.find_last_not_of(
" \t\r\n")+1 , line.length());
684 size_t pos2 = line.find_first_of(sep_elt, pos);
687 if (a_nbElts>1 && pos2 == string::npos)
689 Cerr(
"***** gOptions::ReadDataASCIIFile() -> The required separator : '" << sep_elt <<
"' not found for tag: " << a_keyword << endl);
694 for (
int i=0 ; i<a_nbElts ; i++)
698 if (pos==string::npos)
700 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file '" << a_file <<
"'." << endl);
701 Cerr(
"***** Expected to read " << a_nbElts <<
" elements, but only " << i+1 <<
" were found." << endl);
706 string elt = (a_nbElts>1) ? line.substr(pos, pos2-pos) : line ;
710 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Exception when trying to read tag '" << a_keyword <<
"' in file " << a_file << endl);
717 pos = (pos2==string::npos) ? string::npos : pos2+1;
718 pos2 = line.find_first_of(sep_elt, pos);
727 if(a_mandatoryFlag ==
true)
729 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Error when reading file '" << a_file <<
"'. Tag '" << a_keyword <<
"' was not found." << endl);
739 Cerr(
"***** gOptions::ReadDataASCIIFile() -> Couldn't find or read data-file '"<< a_file <<
"' !" << endl);
762 *a_result = a_str.c_str();
784 const char* p = a_str.c_str();
787 double val = strtod(p, &end);
791 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into float " << endl);
796 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into float " << endl);
800 *a_result =
static_cast<float>(val);
823 const char* p = a_str.c_str();
826 double val = strtod(p, &end);
830 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into double " << endl);
835 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into double " << endl);
862 const char* p = a_str.c_str();
865 long double val = strtold(p, &end);
869 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into double " << endl);
874 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into double " << endl);
901 const char* p = a_str.c_str();
904 int64_t val = strtol(p, &end, 10);
908 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into int " << endl);
911 if (errno==ERANGE || val<INT_MIN || val>INT_MAX)
913 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into int " << endl);
917 *a_result =
static_cast<int>(val);
940 const char* p = a_str.c_str();
943 int64_t val = strtol(p, &end, 10);
947 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into int64_t " << endl);
952 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into int64_t " << endl);
979 const char* p = a_str.c_str();
982 int64_t val = strtol(p, &end, 10);
986 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
989 if (errno == ERANGE || val<0 || val>UCHAR_MAX)
991 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
1018 const char* p = a_str.c_str();
1021 int64_t val = strtol(p, &end, 10);
1025 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
1028 if (errno == ERANGE || val<0 || val>USHRT_MAX)
1030 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into uint16 " << endl);
1057 const char* p = a_str.c_str();
1060 int64_t val = strtol(p, &end, 10);
1064 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into uint32 " << endl);
1067 if (errno == ERANGE || val<0 || val>UINT_MAX)
1069 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into uint32 " << endl);
1096 const char* p = a_str.c_str();
1099 int64_t val = strtol(p, &end, 10);
1103 Cerr(
"***** gOptions::ConvertFromString() -> Invalid argument exception while trying to convert '" << a_str <<
"' into bool " << endl);
1106 if (errno == ERANGE || val<0 || val>1)
1108 Cerr(
"***** gOptions::ConvertFromString() -> Out of range exception while trying to convert '" << a_str <<
"' into bool " << endl);
1132 string path = a_pathToFile;
1134 int pos = path.find_last_of(
OS_SEP);
1135 if (path.find_last_of(
OS_SEP) == string::npos)
1138 path = path.substr(pos+1);
1157 string path = a_pathToFile;
1159 int pos = path.find_last_of(
OS_SEP);
1160 if (path.find_last_of(
OS_SEP) == string::npos)
1163 path = path.substr(0,pos+1);
1177 string result = a_path;
1179 while ( (position = result.find_first_of(
"/")) != string::npos )
1181 result.replace(position,1,
"\\");
1197 FLTNB absA = abs(a);
1198 FLTNB absB = abs(b);
1199 FLTNB diff = abs(a - b);
1207 diff < std::numeric_limits<FLTNB>::min())
1209 return diff < (a_eps * std::numeric_limits<FLTNB>::min() );
1213 return diff / min((absA + absB), std::numeric_limits<FLTNB>::max()) < a_eps;
1224 template int ReadStringOption<string>(
const string& a_input,
string* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1225 template int ReadStringOption<int>(
const string& a_input,
int* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1226 template int ReadStringOption<int64_t>(
const string& a_input, int64_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1227 template int ReadStringOption<float>(
const string& a_input,
float* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1228 template int ReadStringOption<double>(
const string& a_input,
double* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1229 template int ReadStringOption<long double>(
const string& a_input,
long double* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1230 template int ReadStringOption<uint8_t>(
const string& a_input, uint8_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1231 template int ReadStringOption<uint16_t>(
const string& a_input, uint16_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1232 template int ReadStringOption<uint32_t>(
const string& a_input, uint32_t* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1233 template int ReadStringOption<bool>(
const string& a_input,
bool* ap_return,
int a_nbElts,
const string& sep,
const string& a_option);
1235 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1236 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1237 template int ReadDataASCIIFile<int64_t>(
const string& a_file,
const string& a_keyword, int64_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1238 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1239 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1240 template int ReadDataASCIIFile<long double>(
const string& a_file,
const string& a_keyword,
long double* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1241 template int ReadDataASCIIFile<uint8_t>(
const string& a_file,
const string& a_keyword, uint8_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1242 template int ReadDataASCIIFile<uint16_t>(
const string& a_file,
const string& a_keyword, uint16_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1243 template int ReadDataASCIIFile<uint32_t>(
const string& a_file,
const string& a_keyword, uint32_t* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1244 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool* ap_return,
int a_nbElts,
bool a_mandatoryFlag);
1246 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1247 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1248 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);
1249 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1250 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1251 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);
1252 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);
1253 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);
1254 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);
1255 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool* ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1257 template int ReadDataASCIIFile<string>(
const string& a_file,
const string& a_keyword,
string** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1258 template int ReadDataASCIIFile<int>(
const string& a_file,
const string& a_keyword,
int** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1259 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);
1260 template int ReadDataASCIIFile<float>(
const string& a_file,
const string& a_keyword,
float** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1261 template int ReadDataASCIIFile<double>(
const string& a_file,
const string& a_keyword,
double** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1262 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);
1263 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);
1264 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);
1265 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);
1266 template int ReadDataASCIIFile<bool>(
const string& a_file,
const string& a_keyword,
bool** ap_return,
int a_nbElts,
int a_nbLines,
bool a_mandatoryFlag);
1268 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);
1269 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);
1270 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);
1271 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);
1272 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);
1273 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);
1274 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);
1275 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);
1276 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);
1277 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);
1279 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);
1280 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);
1281 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);
1282 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);
1283 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);
1284 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);
1285 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);
1286 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);
1287 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);
1288 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);
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< int64_t >(const string &a_input, int64_t *ap_return, int a_nbElts, const string &sep, const string &a_option)
string ConvertAllSlashOccurrencesToBackSlash(const string &a_path)
template int ReadDataASCIIFile< int >(const string &a_file, const string &a_keyword, int *ap_return, int a_nbElts, bool a_mandatoryFlag)
int ConvertFromString(const string &a_str, string *a_result)
Copy the 'a_str' string in the position pointed by 'a_result'.
template int ReadDataASCIIFile< int64_t >(const string &a_file, const string &a_keyword, int64_t *ap_return, int a_nbElts, bool a_mandatoryFlag)
template int ReadDataASCIIFile< double >(const string &a_file, const string &a_keyword, double *ap_return, int a_nbElts, bool a_mandatoryFlag)
#define KEYWORD_MANDATORY_NOT_FOUND
template int ReadDataASCIIFile< float >(const string &a_file, const string &a_keyword, float *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)
template int ReadDataASCIIFile< uint8_t >(const string &a_file, const string &a_keyword, uint8_t *ap_return, int a_nbElts, bool a_mandatoryFlag)
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.
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 ReadStringOption< long double >(const string &a_input, long double *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadDataASCIIFile< uint32_t >(const string &a_file, const string &a_keyword, uint32_t *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 ReadStringOption< double >(const string &a_input, double *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadStringOption< bool >(const string &a_input, bool *ap_return, int a_nbElts, const string &sep, const string &a_option)
string GetFileFromPath(const string &a_pathToFile)
Simply return the file from a path string passed in parameter.
#define KEYWORD_OPTIONAL_NOT_FOUND
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< string >(const string &a_input, string *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< float >(const string &a_input, float *ap_return, int a_nbElts, const string &sep, const string &a_option)
template int ReadDataASCIIFile< string >(const string &a_file, const string &a_keyword, string *ap_return, int a_nbElts, bool a_mandatoryFlag)
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...
template int ReadStringOption< uint32_t >(const string &a_input, uint32_t *ap_return, int a_nbElts, const string &sep, const string &a_option)
bool FLTNBIsEqual(FLTNB a, FLTNB b, FLTNB a_eps)
Comparison of FLTNB numbers.