|
tfel
|
#include <map>#include <string>#include <vector>#include <utility>#include <functional>#include <string_view>#include "TFEL/Config/TFELConfig.hxx"#include "TFEL/Utilities/GenTypeBase.hxx"#include "TFEL/Utilities/CxxTokenizer.hxx"#include "TFEL/Utilities/Data.ixx"Classes | |
| struct | tfel::utilities::DataStructure |
| a structure in charge of containing a complex data structure. More... | |
| struct | tfel::utilities::DataParsingOptions |
| struct | tfel::utilities::internals::isDataTypeCheck< T > |
| a simple meta function to the check if the given type is part of the DataTypes type list. More... | |
| struct | tfel::utilities::Data |
| A structure able to contain values extracted from a JSON-like file. More... | |
| struct | tfel::utilities::DataMapValidator |
| an helper structure used to validate a data map. More... | |
Namespaces | |
| namespace | tfel |
| the namespace tfel encloses all the TFEL project. This namespace is empty. | |
Typedefs | |
| using | tfel::utilities::DataMap = std::map<std::string, Data, std::less<>> |
| a simple alias | |
| using | tfel::utilities::DataTypes |
| list of all type handled by the Data structure | |
| template<typename T> | |
| using | tfel::utilities::isDataType = tfel::utilities::internals::isDataTypeCheck<T> |
| a simple alias | |
Functions | |
| TFELUTILITIES_VISIBILITY_EXPORT bool | tfel::utilities::operator== (const Data &, const Data &) |
| comparison operator | |
| template<typename T> | |
| T | tfel::utilities::convert (const Data &) |
| extract a value of the given type from a Data structure | |
| template<typename T> | |
| bool | tfel::utilities::is_convertible (const Data &) |
| TFELUTILITIES_VISIBILITY_EXPORT void | tfel::utilities::check_keys (const DataMap &, const std::vector< std::string > &) |
| check that all the keys of the data map are in the given list. | |
| TFELUTILITIES_VISIBILITY_EXPORT void | tfel::utilities::raiseUnmatchedDataType (const std::string_view) |
| throw an exception stating that the parameter type is not the expected one. | |
| TFELUTILITIES_VISIBILITY_EXPORT bool | tfel::utilities::contains (const DataMap &, std::string_view) |
| template<typename ResultType> | |
| bool | tfel::utilities::is (const DataMap &, std::string_view) |
| TFELUTILITIES_VISIBILITY_EXPORT const Data & | tfel::utilities::get (const DataMap &, std::string_view) |
| template<typename ResultType> | |
| const ResultType & | tfel::utilities::get (const DataMap &, std::string_view) |
| template<typename ResultType> | |
| ResultType | tfel::utilities::get_if (const DataMap &, std::string_view, const ResultType &) |
| TFELUTILITIES_VISIBILITY_EXPORT Data | tfel::utilities::get_if (const DataMap &, std::string_view, const Data &) |
| TFELUTILITIES_VISIBILITY_EXPORT DataMap | tfel::utilities::extract (const DataMap &, const std::vector< std::string > &) |
| TFELUTILITIES_VISIBILITY_EXPORT DataMap | tfel::utilities::remove (const DataMap &, const std::vector< std::string > &) |
| TFELUTILITIES_VISIBILITY_EXPORT DataMap | tfel::utilities::merge (const DataMap &, const DataMap &, const bool) |
list of all type handled by the Data structure
| TFELUTILITIES_VISIBILITY_EXPORT void tfel::utilities::check_keys | ( | const DataMap & | , |
| const std::vector< std::string > & | ) |
check that all the keys of the data map are in the given list.
| [in] | d | data map |
| [in] | keys | allowed keys |
| TFELUTILITIES_VISIBILITY_EXPORT bool tfel::utilities::contains | ( | const DataMap & | , |
| std::string_view | ) |
| [in] | m | data map |
| [in] | n | name |
| T tfel::utilities::convert | ( | const Data & | d | ) |
extract a value of the given type from a Data structure
| [in] | d | data |
| TFELUTILITIES_VISIBILITY_EXPORT DataMap tfel::utilities::extract | ( | const DataMap & | , |
| const std::vector< std::string > & | ) |
| [in] | m | data map |
| [in] | names | list of names of data to be extracted |
| TFELUTILITIES_VISIBILITY_EXPORT const Data & tfel::utilities::get | ( | const DataMap & | , |
| std::string_view | ) |
| [in] | m | data map |
| [in] | n | name |
| const ResultType & tfel::utilities::get | ( | const DataMap & | m, |
| std::string_view | n ) |
| ResultType | expected type of the data |
| [in] | m | data map |
| [in] | n | name |
| if | the data does not exists or does not have the good type. |
| TFELUTILITIES_VISIBILITY_EXPORT Data tfel::utilities::get_if | ( | const DataMap & | , |
| std::string_view | , | ||
| const Data & | ) |
| [in] | m | data map |
| [in] | n | name |
| [in] | v | default value |
| ResultType tfel::utilities::get_if | ( | const DataMap & | m, |
| std::string_view | n, | ||
| const ResultType & | v ) |
| ResultType | expected type of the data |
| [in] | m | data map |
| [in] | n | name |
| [in] | v | default value |
| if | the data exists but does not have the good type. |
| bool tfel::utilities::is | ( | const DataMap & | m, |
| std::string_view | n ) |
| [in] | m | data map |
| [in] | n | name |
| if | the data does not exists |
| bool tfel::utilities::is_convertible | ( | const Data & | d | ) |
| [in] | d | data |
| TFELUTILITIES_VISIBILITY_EXPORT DataMap tfel::utilities::merge | ( | const DataMap & | , |
| const DataMap & | , | ||
| const bool | ) |
| [in] | m1 | first data map |
| [in] | m2 | second data map |
| [in] | b | boolean stating if multiple data definition are allowed. If so, the resulting map will contain the value of the first data map. Otherwise, an exception is thrown. |
| TFELUTILITIES_VISIBILITY_EXPORT void tfel::utilities::raiseUnmatchedDataType | ( | const std::string_view | ) |
throw an exception stating that the parameter type is not the expected one.
| [in] | n | name of the variable |
| TFELUTILITIES_VISIBILITY_EXPORT DataMap tfel::utilities::remove | ( | const DataMap & | , |
| const std::vector< std::string > & | ) |
| [in] | m | data map |
| [in] | names | list of names of data to be removed |