Class keyword

Class Documentation

class keyword

class keyword to store name and value of kweywords from the config file or the command line

Public Functions

inline keyword()
inline keyword(string n, string v)
inline ~keyword()
void expand_path()

expand $HOME and $LEPHAREDIR if they are found in string value

template<typename T>
inline vector<T> split(string default_val, int nbItems)
vector<string> split_string(string default_val, int nbItems)

split keyword value into an array of strings

The delimiter is the comma. If nbItems is negative, no check on the size of the output array is made. If nbItems is positive and does not match the array obtained from the input, a warning is printed out and an array of size nbItems filled with default_val is returned. If the input is a singleton, the returned array will be of size nbItems filled with the singleton value !

Parameters:
  • default_val – default value to use, if provided

  • nbItems – size of the expected array

vector<int> split_int(string default_val, int nbItems)

split into an array of strings, then convert to integer

vector<long> split_long(string default_val, int nbItems)

split into an array of strings, then convert to long integer

vector<double> split_double(string default_val, int nbItems)

split into an array of strings, then convert to double

vector<bool> split_bool(string default_val, int nbItems)

split into an array of strings, then convert to boolean

Public Members

string name

keyword name

string value

keyword value