Config module of the StormByte suite. More...
Namespaces | |
| namespace | Binary |
| namespace | Item |
| Configuration items (values, comments, groups, lists). | |
Classes | |
| class | Config |
| Configuration document (text or versioned binary). More... | |
| class | Exception |
| Root exception for Config. More... | |
| class | FailureHook |
| Stateful hook run when text parse fails. More... | |
| class | InvalidName |
| Thrown when an invalid name is used for an item. More... | |
| class | InvalidPath |
| Thrown when an invalid path is used for an item. More... | |
| class | ItemAlreadyExists |
| Thrown when attempting to add an item that already exists. More... | |
| class | ItemNameAlreadyExists |
| Thrown when an item's name conflicts with an existing name. More... | |
| class | ItemNotFound |
| Thrown when an item cannot be found by its path or name. More... | |
| class | OutOfBounds |
| Thrown when an index is out of bounds. More... | |
| class | ParseError |
| Thrown when a parsing error occurs in a configuration file. More... | |
| class | ReadHook |
| Stateful hook run before/after a successful text read. More... | |
| class | ValueFailure |
| Thrown when setting a value fails due to type mismatch. More... | |
| class | WrongValueTypeConversion |
| Thrown when a value is converted to an incorrect type. More... | |
Typedefs | |
| using | HookFunction = ReadHookFunction |
| Stateless read hook. | |
| using | HookFunctions = std::vector< StormByte::Shared< ReadHook > > |
| Read hooks owned by Config. | |
| using | OnFailureHook = FailureHookFunction |
| Stateless failure hook. | |
| using | OptionalFailureHook = StormByte::Shared< FailureHook > |
| Failure hook, empty if unset. | |
| using | ReadHookFunction = void(*)(Item::Group &) |
| Function pointer for a stateless read hook. | |
| using | FailureHookFunction = bool(*)(const Item::Group &) |
| Function pointer for a stateless failure hook. | |
| using | ExpectedConfig = StormByte::Expected< Config, StormByte::Exception > |
| Result of loading a configuration document (text or binary). | |
Enumerations | |
| enum class | OnExistingAction : unsigned short { Keep , Overwrite , ThrowException } |
| Forward declaration of the configuration document. More... | |
| enum class | Mode : unsigned short { Text , Binary } |
| Serialization / deserialization mode for configuration documents. More... | |
Functions | |
| Config & | operator>> (std::istream &istream, Config &file) |
| Initializes configuration when istream is on the left-hand side. | |
| Config & | operator>> (const StormByte::String::String &str, Config &file) |
| Initializes configuration when String is on the left-hand side. | |
| Config & | operator>> (const std::string &str, Config &file) |
| Initializes configuration when string is on the left-hand side. | |
| std::ostream & | operator<< (std::ostream &ostream, const Config &file) |
| Output configuration when ostream is on the left-hand side. | |
| std::string & | operator<< (std::string &str, const Config &file) |
| Output configuration when string is on the left-hand side. | |
| StormByte::Shared< ReadHook > | MakeReadHook (ReadHookFunction function) |
Wrap a function pointer in a ReadHook allocated on Base's heap. | |
| StormByte::Shared< FailureHook > | MakeFailureHook (FailureHookFunction function) |
Wrap a function pointer in a FailureHook allocated on Base's heap. | |
| using StormByte::Config::ExpectedConfig = typedef StormByte::Expected<Config, StormByte::Exception> |
Result of loading a configuration document (text or binary).
On failure, the error is a StormByte::Exception derivative (for example ParseError or StormByte::DeserializeError).
| using StormByte::Config::FailureHookFunction = typedef bool (*)(const Item::Group&) |
Function pointer for a stateless failure hook.
| using StormByte::Config::HookFunction = typedef ReadHookFunction |
Stateless read hook.
| using StormByte::Config::HookFunctions = typedef std::vector<StormByte::Shared<ReadHook> > |
Read hooks owned by Config.
| using StormByte::Config::OnFailureHook = typedef FailureHookFunction |
Stateless failure hook.
| using StormByte::Config::OptionalFailureHook = typedef StormByte::Shared<FailureHook> |
Failure hook, empty if unset.
| using StormByte::Config::ReadHookFunction = typedef void (*)(Item::Group&) |
Function pointer for a stateless read hook.
|
strong |
Serialization / deserialization mode for configuration documents.
Selects whether a document is exchanged as human-readable text (the classic StormByte config syntax) or as the versioned binary wire format.
| Enumerator | |
|---|---|
| Text | Human-readable configuration syntax (UTF-8 text). |
| Binary | Versioned binary format (magic + format version + payload). |
|
strong |
| StormByte::Shared< FailureHook > StormByte::Config::MakeFailureHook | ( | FailureHookFunction | function | ) |
Wrap a function pointer in a FailureHook allocated on Base's heap.
| function | stateless callback |
| StormByte::Shared< ReadHook > StormByte::Config::MakeReadHook | ( | ReadHookFunction | function | ) |
Wrap a function pointer in a ReadHook allocated on Base's heap.
| function | stateless callback |
| std::ostream & StormByte::Config::operator<< | ( | std::ostream & | ostream, |
| const Config & | file | ||
| ) |
Output configuration when ostream is on the left-hand side.
| ostream | Output stream. |
| file | Config to get data from. |
| std::string & StormByte::Config::operator<< | ( | std::string & | str, |
| const Config & | file | ||
| ) |
Output configuration when string is on the left-hand side.
| str | Output string. |
| file | Config to get data from. |
| Config & StormByte::Config::operator>> | ( | const StormByte::String::String & | str, |
| Config & | file | ||
| ) |