inicpp
C++ parser of INI files with schema validation.
|
#include <option_schema.h>
Public Member Functions | |
option_schema ()=delete | |
option_schema (const option_schema &source) | |
option_schema & | operator= (const option_schema &source) |
option_schema (option_schema &&source) | |
option_schema & | operator= (option_schema &&source) |
template<typename ArgType > | |
option_schema (const option_schema_params< ArgType > &arguments) | |
const std::string & | get_name () const |
option_type | get_type () const |
bool | is_list () const |
const std::string & | get_default_value () const |
bool | is_mandatory () const |
const std::string & | get_comment () const |
void | validate_option (option &opt) const |
std::ostream & | write_additional_info (std::ostream &os) const |
Friends | |
INICPP_API friend std::ostream & | operator<< (std::ostream &os, const option_schema &opt_schema) |
In option_schema are defined rules which ini option should fulfil, including its name, type and if option is list or not. Options can be validated against option_schema objects.
Definition at line 66 of file option_schema.h.
|
delete |
Deleted default constructor.
inicpp::option_schema::option_schema | ( | const option_schema & | source | ) |
Copy constructor.
Definition at line 6 of file option_schema.cpp.
inicpp::option_schema::option_schema | ( | option_schema && | source | ) |
Move constructor.
Definition at line 31 of file option_schema.cpp.
|
inline |
Construct option_schema from given parameters.
arguments | creation arguments |
invalid_type_exception | if given type is not valid |
Definition at line 141 of file option_schema.h.
const std::string & inicpp::option_schema::get_comment | ( | ) | const |
Returns textual description of option.
Definition at line 70 of file option_schema.cpp.
const std::string & inicpp::option_schema::get_default_value | ( | ) | const |
Get option default value.
Definition at line 60 of file option_schema.cpp.
const std::string & inicpp::option_schema::get_name | ( | ) | const |
option_type inicpp::option_schema::get_type | ( | ) | const |
bool inicpp::option_schema::is_list | ( | ) | const |
Determines if list has to be stored in option.
Definition at line 55 of file option_schema.cpp.
bool inicpp::option_schema::is_mandatory | ( | ) | const |
Determines whether option is mandatory in configuration.
Definition at line 65 of file option_schema.cpp.
option_schema & inicpp::option_schema::operator= | ( | const option_schema & | source | ) |
Copy assignment.
Definition at line 11 of file option_schema.cpp.
option_schema & inicpp::option_schema::operator= | ( | option_schema && | source | ) |
Move assignment.
Definition at line 36 of file option_schema.cpp.
void inicpp::option_schema::validate_option | ( | option & | opt | ) | const |
Validate given option against this option_schema.
opt | validated option |
validation_exception | if error occured |
Definition at line 75 of file option_schema.cpp.
std::ostream & inicpp::option_schema::write_additional_info | ( | std::ostream & | os | ) | const |
To given output stream writes additional information about option. Written info is in ini comment format.
os | output stream |
Definition at line 154 of file option_schema.cpp.
|
friend |
Classic stream operator for printing this instance to output stream.
os | output stream |
opt_schema | reference to option_schema instance to be written |
Definition at line 174 of file option_schema.cpp.