CASToR
1.1
Tomographic Reconstruction (PET/SPECT)
|
Implementation of class gOptions functions. More...
#include "gVariables.hh"
#include "gOptions.hh"
#include "sOutputManager.hh"
#include <errno.h>
#include <limits.h>
Go to the source code of this file.
Functions | |
template<class T > | |
int | ReadStringOption (const string &a_input, T *ap_return, int a_nbElts, const string &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. More... | |
template<class T > | |
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 and return the corresponding value(s) in the "ap_return" templated array. This function expect the data to recover to be written on one line after the key. More... | |
template<class T > | |
int | ReadDataASCIIFile (const string &a_file, const string &a_keyword, T *ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
Look for "a_nbLines" lines of "a_nbElts" elts in the 'a_file' file matching the "a_keyword" string passed as parameter and return the corresponding value(s) in the "ap_return" templated 1D array. This function expects the following parsing : KEY : line1 : elt1,elt2,...,eltN line2 : elt1,elt2,...,eltN (...) lineN : elt1,elt2,...,eltN. More... | |
template<class T > | |
int | ReadDataASCIIFile (const string &a_file, const string &a_keyword, T **a2p_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
Look for "a_nbLines" lines of "a_nbElts" elts in the 'a_file' file matching the "a_keyword" string passed as parameter and return the corresponding value(s) in the "a2p_return" 2D array. The first and second dimensions of "a2p_return" correspond to the line and elements respectively This function expects the following parsing : KEY : line1 : elt1,elt2,...,eltN line2 : elt1,elt2,...,eltN (...) lineN : elt1,elt2,...,eltN. More... | |
template<class T > | |
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) |
Look for "a_nbElts" elts in the "a_file" file matching the "a_keyword" string passed as parameter and return the corresponding value(s) in the "ap_return" templated array. Additionnal two parameters allow to search within two specific tags This function expects the following parsing : FIRST_TAG (...) KEY : elt1,elt2,...,eltN (...) LAST_TAG. More... | |
template<class T > | |
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) |
Look for "a_nbLines" lines of "a_nbElts" elts in the "a_file" file matching the "a_keyword" string passed as parameter and return the corresponding value(s) in the "a2p_return" templated 2D array. The first and second dimensions of "a2p_return" correspond to the line and elements respectively Additionnal two parameters allow to search within two specific tags This function expects the following parsing : KEY : FIRST_TAG (...) line1 : elt1,elt2,...,eltN line2 : elt1,elt2,...,eltN (...) lineN : elt1,elt2,...,eltN (...) LAST_TAG. More... | |
int | ConvertFromString (const string &a_str, string *a_result) |
Copy the 'a_str' string in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, float *a_result) |
Convert the 'a_str' string in float and copy the result in the variable pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, double *a_result) |
Convert the 'a_str' string in double and copy the result in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, long double *a_result) |
Convert the 'a_str' string in long double and copy the result in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, int *a_result) |
Convert the 'a_str' string in int and copy the result in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, int64_t *a_result) |
Convert the 'a_str' string in long int and copy the result in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, uint8_t *a_result) |
Convert the 'a_str' string in uint16_t and copy the result in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, uint16_t *a_result) |
Convert the 'a_str' string in uint16_t and copy the result in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, uint32_t *a_result) |
Convert the 'a_str' string in uint32_t and copy the result in the position pointed by 'a_result'. More... | |
int | ConvertFromString (const string &a_str, bool *a_result) |
Convert the 'a_str' string in bool and copy the result in the position pointed by 'a_result'. More... | |
string | GetFileFromPath (const string &a_pathToFile) |
Simply return the file from a path string passed in parameter. More... | |
string | GetPathOfFile (const string &a_pathToFile) |
Simply return the path to the directory of a file path string passed in parameter. More... | |
string | ConvertAllSlashOccurrencesToBackSlash (const string &a_path) |
bool | FLTNBIsEqual (FLTNB a, FLTNB b, FLTNB a_eps) |
Comparison of FLTNB numbers. More... | |
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< int64_t > (const string &a_input, int64_t *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 | ReadStringOption< double > (const string &a_input, double *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) |
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< uint16_t > (const string &a_input, uint16_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 | ReadStringOption< bool > (const string &a_input, bool *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) |
template int | ReadDataASCIIFile< int > (const string &a_file, const string &a_keyword, int *ap_return, int a_nbElts, bool a_mandatoryFlag) |
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< float > (const string &a_file, const string &a_keyword, float *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) |
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 | ReadDataASCIIFile< uint8_t > (const string &a_file, const string &a_keyword, uint8_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 | ReadDataASCIIFile< uint32_t > (const string &a_file, const string &a_keyword, uint32_t *ap_return, int a_nbElts, bool a_mandatoryFlag) |
template int | ReadDataASCIIFile< bool > (const string &a_file, const string &a_keyword, bool *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, int a_nbLines, bool a_mandatoryFlag) |
template int | ReadDataASCIIFile< int > (const string &a_file, const string &a_keyword, int *ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
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) |
template int | ReadDataASCIIFile< float > (const string &a_file, const string &a_keyword, float *ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
template int | ReadDataASCIIFile< double > (const string &a_file, const string &a_keyword, double *ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
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) |
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) |
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) |
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) |
template int | ReadDataASCIIFile< bool > (const string &a_file, const string &a_keyword, bool *ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
template int | ReadDataASCIIFile< string > (const string &a_file, const string &a_keyword, string **ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
template int | ReadDataASCIIFile< int > (const string &a_file, const string &a_keyword, int **ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
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) |
template int | ReadDataASCIIFile< float > (const string &a_file, const string &a_keyword, float **ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
template int | ReadDataASCIIFile< double > (const string &a_file, const string &a_keyword, double **ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
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) |
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) |
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) |
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) |
template int | ReadDataASCIIFile< bool > (const string &a_file, const string &a_keyword, bool **ap_return, int a_nbElts, int a_nbLines, bool a_mandatoryFlag) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
Implementation of class gOptions functions.
Definition in file gOptions.cc.
string ConvertAllSlashOccurrencesToBackSlash | ( | const string & | a_path | ) |
int ConvertFromString | ( | const string & | a_str, |
string * | a_result | ||
) |
Copy the 'a_str' string in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
The only purposes of this function is to have an unified templated conversion function for each type
Definition at line 749 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
float * | a_result | ||
) |
Convert the 'a_str' string in float and copy the result in the variable pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtod to check errors with str to float conversion
(implementation similar to c++11 std::stof() ).
Definition at line 771 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
double * | a_result | ||
) |
Convert the 'a_str' string in double and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtod to check errors with str to double conversion
(implementation similar to c++11 std::stod() ).
Definition at line 810 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
long double * | a_result | ||
) |
Convert the 'a_str' string in long double and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtod to check errors with str to ldouble conversion
(implementation similar to c++11 std::stod() ).
Definition at line 849 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
int * | a_result | ||
) |
Convert the 'a_str' string in int and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtol to check errors with str to int conversion
(implementation similar to c++11 std::stoi() ).
Definition at line 888 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
int64_t * | a_result | ||
) |
Convert the 'a_str' string in long int and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtol to check errors with str to int64_t (8 bytes int) conversion
(implementation similar to c++11 std::stol() ).
Definition at line 927 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
uint8_t * | a_result | ||
) |
Convert the 'a_str' string in uint16_t and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtol to check errors with str to uint8 conversion
(implementation similar to c++11 std::stoi() ).
Definition at line 966 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
uint16_t * | a_result | ||
) |
Convert the 'a_str' string in uint16_t and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtol to check errors with str to uint16 conversion
(implementation similar to c++11 std::stoi() ).
Definition at line 1005 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
uint32_t * | a_result | ||
) |
Convert the 'a_str' string in uint32_t and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtol to check errors with str to uint32 conversion
(implementation similar to c++11 std::stoi() ).
Definition at line 1044 of file gOptions.cc.
int ConvertFromString | ( | const string & | a_str, |
bool * | a_result | ||
) |
Convert the 'a_str' string in bool and copy the result in the position pointed by 'a_result'.
a_str | : string to convert |
a_result | : variable which will recover the result |
Uses strtol to check errors with str to bool conversion
(implementation similar to c++11 std::stoi() ).
Definition at line 1083 of file gOptions.cc.
Comparison of FLTNB numbers.
a | : 1st FLTNB nb to compare |
b | : 2nd FLTNB nb to compare |
a_eps | : epsilon for comparison |
Definition at line 1184 of file gOptions.cc.
string GetFileFromPath | ( | const string & | a_pathToFile | ) |
Simply return the file from a path string passed in parameter.
a_pathToFile |
Definition at line 1119 of file gOptions.cc.
string GetPathOfFile | ( | const string & | a_pathToFile | ) |
Simply return the path to the directory of a file path string passed in parameter.
a_pathToFile |
Definition at line 1144 of file gOptions.cc.
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
and return the corresponding value(s) in the "ap_return" templated array.
This function expect the data to recover to be written on one line after the key.
a_file | : string containing the path to the ASCII file |
a_keyword | : key related to the data we want to recover |
ap_return | : templated array in which the data will be returned the recovered data will be converted to its type its size should be equal to the number of elts to recover |
a_nbElts | : number of elements to recover |
a_mandatoryFlag | : boolean indicating the data to recover is mandatory (KEYWORD_MANDATORY) (error value (=1) will be returned if not found) or optional (KEYWORD_OPTIONAL) (warning value (=2) will be returned if not found) |
This function assumes the following separators :
":" is used as separator between the keyworld and the value
"#" is used for comment. Every following characters will be discarded
"," is used to separate elements if more than one are required
Definition at line 111 of file gOptions.cc.
int ReadDataASCIIFile | ( | const string & | a_file, |
const string & | a_keyword, | ||
T * | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
Look for "a_nbLines" lines of "a_nbElts" elts in the 'a_file' file matching the "a_keyword" string
passed as parameter and return the corresponding value(s) in the "ap_return" templated 1D array.
This function expects the following parsing :
KEY :
line1 : elt1,elt2,...,eltN
line2 : elt1,elt2,...,eltN
(...)
lineN : elt1,elt2,...,eltN.
a_file | : string containing the path to the ASCII file |
a_keyword | : key related to the data we want to recover |
ap_return | : templated array in which the data will be returned the recovered data will be converted to its type its size should be equal to the nb of lines*nb of elts to recover |
a_nbElts | : number of elements to recover (on each line) |
a_nbLines | : number of lines to recover |
a_mandatoryFlag | : boolean indicating the data to recover is mandatory (KEYWORD_MANDATORY) (error value (=1) will be returned if not found) or optional (KEYWORD_OPTIONAL) (warning value (=2) will be returned if not found) |
This function assumes the following separators :
":" is used as separator between the keyworld and the value
"#" is used for comment. Every following characters will be discarded
"," is used to separate elements if more than one are required
Definition at line 236 of file gOptions.cc.
int ReadDataASCIIFile | ( | const string & | a_file, |
const string & | a_keyword, | ||
T ** | a2p_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
Look for "a_nbLines" lines of "a_nbElts" elts in the 'a_file' file matching the "a_keyword" string
passed as parameter and return the corresponding value(s) in the "a2p_return" 2D array.
The first and second dimensions of "a2p_return" correspond to the line and elements respectively
This function expects the following parsing :
KEY :
line1 : elt1,elt2,...,eltN
line2 : elt1,elt2,...,eltN
(...)
lineN : elt1,elt2,...,eltN.
a_file | : string containing the path to the ASCII file |
a_keyword | : key related to the data we want to recover |
a2p_return | : 2D templated array in which the data will be returned the recovered data will be converted to its type its size should be equal [nb of lines][nb of elts to recover] |
a_nbElts | : number of elements to recover (on each line) |
a_nbLines | : number of lines to recover |
a_mandatoryFlag | : boolean indicating the data to recover is mandatory (KEYWORD_MANDATORY) (error value (=1) will be returned if not found) or optional (KEYWORD_OPTIONAL) (warning value (=2) will be returned if not found) |
This function assumes the following separators :
":" is used as separator between the keyworld and the value
"#" is used for comment. Every following characters will be discarded
"," is used to separate elements if more than one are required
Definition at line 364 of file gOptions.cc.
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 | ||
) |
Look for "a_nbElts" elts in the "a_file" file matching the "a_keyword" string passed as parameter
and return the corresponding value(s) in the "ap_return" templated array.
Additionnal two parameters allow to search within two specific tags
This function expects the following parsing :
FIRST_TAG
(...)
KEY : elt1,elt2,...,eltN
(...)
LAST_TAG.
a_file | : string containing the path to the ASCII file |
a_keyword | : key related to the data we want to recover |
ap_return | : templated array in which the data will be returned the recovered data will be converted to its type its size should be equal to the number of elts to recover |
a_nbElts | : number of elements to recover |
a_mandatoryFlag | : boolean indicating the data to recover is mandatory (KEYWORD_MANDATORY) (error value (=1) will be returned if not found) or optional (KEYWORD_OPTIONAL) (warning value (=2) will be returned if not found) |
a_firstTag | : the requested key will be looked for after the first occurence of this string |
a_lastTag | : the requested key will be looked for before the first occurence of this string |
This function assumes the following separators :
":" is used as separator between the keyworld and the value
"#" is used for comment. Every following characters will be discarded
"," is used to separate elements if more than one are required
Definition at line 494 of file gOptions.cc.
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 | ||
) |
Look for "a_nbLines" lines of "a_nbElts" elts in the "a_file" file matching the "a_keyword" string
passed as parameter and return the corresponding value(s) in the "a2p_return" templated 2D array.
The first and second dimensions of "a2p_return" correspond to the line and elements respectively
Additionnal two parameters allow to search within two specific tags
This function expects the following parsing :
KEY :
FIRST_TAG
(...)
line1 : elt1,elt2,...,eltN
line2 : elt1,elt2,...,eltN
(...)
lineN : elt1,elt2,...,eltN
(...)
LAST_TAG.
a_file | : string containing the path to the ASCII file |
a_keyword | : key related to the data we want to recover |
a2p_return | : 2D templated array in which the data will be returned the recovered data will be converted to its type its size should be equal [nb of lines][nb of elts to recover] |
a_nbElts | : number of elements to recover (on each line) |
a_nbLines | : number of lines to recover |
a_mandatoryFlag | : boolean indicating the data to recover is mandatory (KEYWORD_MANDATORY) (error value (=1) will be returned if not found) or optional (KEYWORD_OPTIONAL) (warning value (=2) will be returned if not found) |
a_firstTag | : the requested key will be looked for after the first occurence of this string |
a_lastTag | : the requested key will be looked for before the first occurence of this string |
This function assumes the following separators :
":" is used as separator between the keyworld and the value
"#" is used for comment. Every following characters will be discarded
"," is used to separate elements if more than one are required
Definition at line 637 of file gOptions.cc.
template int ReadDataASCIIFile< bool > | ( | const string & | a_file, |
const string & | a_keyword, | ||
bool * | ap_return, | ||
int | a_nbElts, | ||
bool | a_mandatoryFlag | ||
) |
template int ReadDataASCIIFile< bool > | ( | const string & | a_file, |
const string & | a_keyword, | ||
bool * | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
template int ReadDataASCIIFile< bool > | ( | const string & | a_file, |
const string & | a_keyword, | ||
bool ** | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 ReadDataASCIIFile< double > | ( | const string & | a_file, |
const string & | a_keyword, | ||
double * | 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, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
template int ReadDataASCIIFile< double > | ( | const string & | a_file, |
const string & | a_keyword, | ||
double ** | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
template int ReadDataASCIIFile< float > | ( | const string & | a_file, |
const string & | a_keyword, | ||
float * | 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, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
template int ReadDataASCIIFile< float > | ( | const string & | a_file, |
const string & | a_keyword, | ||
float ** | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
template int ReadDataASCIIFile< int > | ( | const string & | a_file, |
const string & | a_keyword, | ||
int * | 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, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
template int ReadDataASCIIFile< int > | ( | const string & | a_file, |
const string & | a_keyword, | ||
int ** | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
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< int64_t > | ( | const string & | a_file, |
const string & | a_keyword, | ||
int64_t * | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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 ReadDataASCIIFile< long double > | ( | const string & | a_file, |
const string & | a_keyword, | ||
long double * | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
template int ReadDataASCIIFile< string > | ( | const string & | a_file, |
const string & | a_keyword, | ||
string * | 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, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
template int ReadDataASCIIFile< string > | ( | const string & | a_file, |
const string & | a_keyword, | ||
string ** | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
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< uint16_t > | ( | const string & | a_file, |
const string & | a_keyword, | ||
uint16_t * | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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< uint32_t > | ( | const string & | a_file, |
const string & | a_keyword, | ||
uint32_t * | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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< uint8_t > | ( | const string & | a_file, |
const string & | a_keyword, | ||
uint8_t * | ap_return, | ||
int | a_nbElts, | ||
int | a_nbLines, | ||
bool | a_mandatoryFlag | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
int ReadStringOption | ( | const string & | a_input, |
T * | ap_return, | ||
int | a_nbElts, | ||
const string & | 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.
a_input | : string to parse |
ap_return | : (templated) array in which the parsed elements will be returned |
a_nbElts | : a number of elements to parse |
sep | : the separator (usually comma) |
a_option | : string indicating from where the function has been called |
Definition at line 50 of file gOptions.cc.
template int ReadStringOption< bool > | ( | const string & | a_input, |
bool * | ap_return, | ||
int | a_nbElts, | ||
const string & | sep, | ||
const string & | a_option | ||
) |
template int ReadStringOption< double > | ( | const string & | a_input, |
double * | 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 ReadStringOption< int > | ( | const string & | a_input, |
int * | 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 | ||
) |
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 ReadStringOption< string > | ( | const string & | a_input, |
string * | ap_return, | ||
int | a_nbElts, | ||
const string & | sep, | ||
const string & | a_option | ||
) |
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 ReadStringOption< uint32_t > | ( | const string & | a_input, |
uint32_t * | ap_return, | ||
int | a_nbElts, | ||
const string & | sep, | ||
const string & | a_option | ||
) |
template int ReadStringOption< uint8_t > | ( | const string & | a_input, |
uint8_t * | ap_return, | ||
int | a_nbElts, | ||
const string & | sep, | ||
const string & | a_option | ||
) |