48 typedef std::unordered_map<std::string, std::vector<std::string>>
parameter_map;
76 std::string
m_trim (
const std::string inStr);
87 std::vector<std::string>
m_trim_vect (
const std::string inStr);
131 void read(
const std::string parameter_file);
141 void write(
const std::string parameter_file);
162 std::vector<std::string> &
operator[] (
const std::string key);
179 void set_key (
const std::string key, std::string value,
const size_t pos=0);
193 void set_key (
const std::string key,
const std::vector<std::string> values);
208 std::string
get_key (
const std::string key,
const std::string default_value,
const size_t pos=0)
const;
221 std::vector<std::string>
get_key (
const std::string key,
const std::vector<std::string> default_values)
const;
Useful generic functions.
std::string m_trim(const std::string inStr)
Remove white spaces treading and leading each std::string (private function)
void write(const std::string parameter_file)
member to write a parameter file
std::vector< std::string > & operator[](const std::string key)
Method to set/get entries of the parameter file.
parameter_map m_parameters
map with all the vector type parameter name/value couples
~ParameterFile()=default
Default destructor.
void read(const std::string parameter_file)
member to read a parameter file
ParameterFile()=default
Default empty constructor.
void set_key(const std::string key, std::string value, const size_t pos=0)
Method to set entries of the parameter file.
std::vector< std::string > m_trim_vect(const std::string inStr)
Stores values contained in between curly brackets in a vector of std::string (private function)
std::string get_key(const std::string key, const std::string default_value, const size_t pos=0) const
Method to get one value for a specific parameter.
std::vector< std::string > m_keys
list of keys in order of insertion
std::unordered_map< std::string, std::vector< std::string > > parameter_map
Map type used in ParameterFile class.
The global namespace of the CosmoBolognaLib