Config module of the StormByte suite.
More...
|
| namespace | Item |
| | Configuration items (values, comments, groups, lists).
|
| |
|
|
using | HookFunction = std::function< void(Item::Group &)> |
| | Function executed as a hook.
|
| |
|
using | HookFunctions = std::vector< HookFunction > |
| | List of hook functions.
|
| |
|
using | OnFailureHook = std::function< bool(const Item::Group &)> |
| | Function executed on failure.
|
| |
|
using | OptionalFailureHook = std::optional< OnFailureHook > |
| | Optional failure hook.
|
| |
| using | ExpectedConfig = StormByte::Expected< Config, StormByte::Exception > |
| | Result of loading a configuration document (text or binary).
|
| |
|
| STORMBYTE_CONFIG_PUBLIC Config & | operator>> (std::istream &istream, Config &file) |
| | Initializes configuration when istream is on the left-hand side.
|
| |
| STORMBYTE_CONFIG_PUBLIC Config & | operator>> (const std::string &str, Config &file) |
| | Initializes configuration when string is on the left-hand side.
|
| |
| STORMBYTE_CONFIG_PUBLIC std::ostream & | operator<< (std::ostream &ostream, const Config &file) |
| | Output configuration when ostream is on the left-hand side.
|
| |
| STORMBYTE_CONFIG_PUBLIC std::string & | operator<< (std::string &str, const Config &file) |
| | Output configuration when string is on the left-hand side.
|
| |
Config module of the StormByte suite.
◆ ExpectedConfig
Result of loading a configuration document (text or binary).
On failure, the error is a StormByte::Exception derivative (for example ParseError or StormByte::DeserializeError).
◆ Mode
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.
- See also
- Config::Save
-
Config::Load
| Enumerator |
|---|
| Text | Human-readable configuration syntax (UTF-8 text).
|
| Binary | Versioned binary format (magic + format version + payload).
|
◆ OnExistingAction
Forward declaration of the configuration document.
Specifies the action to take when a name conflict occurs.
| Enumerator |
|---|
| Keep | Retain the existing item.
|
| Overwrite | Replace the existing item with the new one.
|
| ThrowException | Throw an exception to indicate the conflict.
|
◆ operator<<() [1/2]
| STORMBYTE_CONFIG_PUBLIC std::ostream & StormByte::Config::operator<< |
( |
std::ostream & |
ostream, |
|
|
const Config & |
file |
|
) |
| |
Output configuration when ostream is on the left-hand side.
- Parameters
-
| ostream | Output stream. |
| file | Config to get data from. |
- Returns
- Reference to the output stream.
◆ operator<<() [2/2]
| STORMBYTE_CONFIG_PUBLIC std::string & StormByte::Config::operator<< |
( |
std::string & |
str, |
|
|
const Config & |
file |
|
) |
| |
Output configuration when string is on the left-hand side.
- Parameters
-
| str | Output string. |
| file | Config to get data from. |
- Returns
- Reference to the string.
◆ operator>>() [1/2]
| STORMBYTE_CONFIG_PUBLIC Config & StormByte::Config::operator>> |
( |
const std::string & |
str, |
|
|
Config & |
file |
|
) |
| |
Initializes configuration when string is on the left-hand side.
- Parameters
-
| str | Input string. |
| file | Config to put data into. |
- Returns
- Reference to the Config.
◆ operator>>() [2/2]
| STORMBYTE_CONFIG_PUBLIC Config & StormByte::Config::operator>> |
( |
std::istream & |
istream, |
|
|
Config & |
file |
|
) |
| |
Initializes configuration when istream is on the left-hand side.
- Parameters
-
| istream | Input stream. |
| file | Config to put data into. |
- Returns
- Reference to the Config.