Utilities to work with static YAML config.
Classes | |
class | Iterator |
struct | Schema |
JSON Schema-like type definition. More... | |
class | SchemaPtr |
class | YamlConfig |
Datatype that represents YAML with substituted variables. More... | |
Typedefs | |
using | Value = YamlConfig |
using | Exception = formats::yaml::Exception |
using | ParseException = formats::yaml::ParseException |
Enumerations | |
enum class | FieldType { kBool , kInteger , kNumber , kString , kArray , kObject } |
Functions | |
template<typename T , typename Value > | |
std::vector< T > | ParseMapToArray (const Value &value) |
template<typename ParentComponent > | |
Schema | MergeSchemas (const std::string &yaml_string) |
Merge parent and child components schemas of static configs. | |
std::string | ToString (FieldType type) |
formats::yaml::Value | Serialize (const SchemaPtr &schema, formats::serialize::To< formats::yaml::Value >) |
Schema | Parse (const formats::yaml::Value &schema, formats::parse::To< Schema >) |
formats::yaml::Value | Serialize (const Schema &schema, formats::serialize::To< formats::yaml::Value >) |
bool | Parse (const YamlConfig &value, formats::parse::To< bool >) |
int64_t | Parse (const YamlConfig &value, formats::parse::To< int64_t >) |
uint64_t | Parse (const YamlConfig &value, formats::parse::To< uint64_t >) |
double | Parse (const YamlConfig &value, formats::parse::To< double >) |
std::string | Parse (const YamlConfig &value, formats::parse::To< std::string >) |
std::chrono::seconds | Parse (const YamlConfig &value, formats::parse::To< std::chrono::seconds >) |
Parses duration from string, understands suffixes: ms, s, m, h, d. | |
std::chrono::milliseconds | Parse (const YamlConfig &value, formats::parse::To< std::chrono::milliseconds >) |
Parses duration from string, understands suffixes: ms, s, m, h, d. | |
formats::json::Value | Parse (const YamlConfig &value, formats::parse::To< formats::json::Value >) |
Converts YAML to JSON. | |
Definition at line 24 of file yaml_config.hpp.
Definition at line 25 of file yaml_config.hpp.
typedef YamlConfig yaml_config::Value = YamlConfig |
|
strong |
Definition at line 22 of file schema.hpp.
Schema yaml_config::MergeSchemas | ( | const std::string & | yaml_string | ) |
Merge parent and child components schemas of static configs.
Definition at line 23 of file merge_schemas.hpp.
formats::json::Value yaml_config::Parse | ( | const YamlConfig & | value, |
formats::parse::To< formats::json::Value > | ) |
Converts YAML to JSON.
formats::json::Value::Exception | if value.IsMissing() |
std::chrono::milliseconds yaml_config::Parse | ( | const YamlConfig & | value, |
formats::parse::To< std::chrono::milliseconds > | ) |
Parses duration from string, understands suffixes: ms, s, m, h, d.
On | invalid type and invalid string format |
std::chrono::seconds yaml_config::Parse | ( | const YamlConfig & | value, |
formats::parse::To< std::chrono::seconds > | ) |
Parses duration from string, understands suffixes: ms, s, m, h, d.
On | invalid type, invalid string format, and if the duration is not a whole amount of seconds |
std::vector< T > yaml_config::ParseMapToArray | ( | const Value & | value | ) |
Definition at line 11 of file map_to_array.hpp.