PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
phoenix_get_string.h
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #ifndef __PHOENIX_GET_STRING_H__
8 #define __PHOENIX_GET_STRING_H__
9 
10 #include "DicoValue.h"
11 
12 bool phoenix_convertBoolType(const PString & strConfig);
13 
14 template<typename T>
15 T phoenix_load_value_from_config(const DicoValue & dico, const PString & varName, T defaultValue);
16 
17 template<typename T>
18 bool phoenix_load_value_from_dico(T & value, const DicoValue & dico, const PString & varName);
19 
20 template<>
21 bool phoenix_load_value_from_dico<bool>(bool & value, const DicoValue & dico, const PString & varName);
22 
23 template<typename T>
24 bool phoenix_save_value_to_dico(DicoValue & dico, const T & value, const PString & varName);
25 template<>
26 bool phoenix_save_value_to_dico<bool>(DicoValue & dico, const bool & value, const PString & varName);
27 
28 template<typename T>
29 void phoenix_load_vecValue_from_config(std::vector<T> & vecValue, const DicoValue & dico, const PString & varName);
30 template<typename T>
31 std::vector<T> phoenix_load_vecValue_from_config(const DicoValue & dico, const PString & varName);
32 
33 template<>
34 bool phoenix_load_value_from_config<bool>(const DicoValue & dico, const PString & varName, bool defaultValue);
35 
36 void phoenix_get_vecstring(PVecString & vecValue, const DicoValue & dico, const PString & varName);
37 PVecString phoenix_get_vecstring(const DicoValue & dico, const PString & varName);
38 
39 PString phoenix_get_string(const DicoValue & dico, const PString & varName, const PString & defaultValue);
40 PString phoenix_get_string(const DicoValue & dico, const PString & varName, const PString & defaultValue, const PString & defaultValue2);
41 
43 
44 #endif
45 
std::vector< PString > PVecString
Definition: PString.h:96
Dictionnary of values.
Definition: DicoValue.h:17
Extends the std::string.
Definition: PString.h:16
bool phoenix_load_value_from_dico(T &value, const DicoValue &dico, const PString &varName)
Get the value from a dictionnary.
PString phoenix_get_string(const DicoValue &dico, const PString &varName, const PString &defaultValue)
Get the string from a dictionnary.
T phoenix_load_value_from_config(const DicoValue &dico, const PString &varName, T defaultValue)
Get the value from a dictionnary.
bool phoenix_load_value_from_dico< bool >(bool &value, const DicoValue &dico, const PString &varName)
Get bool value from a dictionnary (specialization for bool)
bool phoenix_convertBoolType(const PString &strConfig)
Convert the configuration of the cleaning type into a bool.
bool phoenix_save_value_to_dico< bool >(DicoValue &dico, const bool &value, const PString &varName)
Save the value to a dictionnary (specialization for bool)
bool phoenix_load_value_from_config< bool >(const DicoValue &dico, const PString &varName, bool defaultValue)
Get bool value from a dictionnary (specialization for bool)
void phoenix_get_vecstring(PVecString &vecValue, const DicoValue &dico, const PString &varName)
Load a vector of string from a dictionnary.
void phoenix_load_vecValue_from_config(std::vector< T > &vecValue, const DicoValue &dico, const PString &varName)
Load a vector of value from a dictionnary.
bool phoenix_save_value_to_dico(DicoValue &dico, const T &value, const PString &varName)
Save the value to a dictionnary.