|
StormByte C++ Library: Config module 1.0.1.9999
StormByte-Config is the configuration module of the StormByte C++ suite.
|
The base class for all configuration items. More...
#include <base.hxx>


Public Member Functions | |
| Base ()=default | |
| Default constructor. | |
| Base (const std::string &name) | |
| Constructs a Base item with a name. | |
| Base (const Base &base)=default | |
| Copy constructor. | |
| Base (Base &&base) noexcept=default | |
| Move constructor. | |
| Base & | operator= (const Base &base)=default |
| Copy assignment operator. | |
| Base & | operator= (Base &&base) noexcept=default |
| Move assignment operator. | |
| virtual | ~Base () noexcept=default |
| Destructor. | |
| bool | operator== (const Base &other) const noexcept |
| Equality operator. | |
| bool | operator!= (const Base &other) const noexcept |
| Inequality operator. | |
| virtual bool | Equals (const Base &other) const noexcept=0 |
| Polymorphic equality comparison. | |
| constexpr const std::optional< std::string > & | Name () const noexcept |
| Gets the name of the item. | |
| constexpr void | Name (const std::string &name) noexcept |
| Sets the item name. | |
| bool | IsNameValid () const noexcept |
| Checks if the current name is valid. | |
| virtual constexpr Type | Type () const noexcept=0 |
| Gets the item type. | |
| virtual std::optional< CommentType > | GetCommentType () const noexcept |
| Returns the comment type if this item is a Comment, otherwise std::nullopt. | |
| constexpr std::string | TypeToString () const noexcept |
| Gets the item type as a string. | |
| virtual std::string | Serialize (const int &indent_level) const noexcept |
| Serializes the item. | |
| operator std::string () const | |
| Converts the item to a string. | |
| template<typename T > | |
| const T & | Value () const |
| Gets the item value (const). | |
| template<typename T > | |
| T & | Value () |
| Gets the item value (mutable). | |
Protected Attributes | |
| std::optional< std::string > | m_name |
| Item name. | |
The base class for all configuration items.
| StormByte::Config::Item::Base::Base | ( | const std::string & | name | ) |
Constructs a Base item with a name.
| name | The name of the item. |
|
default |
Copy constructor.
| base | Item to copy. |
|
defaultnoexcept |
Move constructor.
| base | Item to move. |
|
pure virtualnoexcept |
Polymorphic equality comparison.
| other | The other item to compare against. |
Implemented in StormByte::Config::Item::Comment< T >, StormByte::Config::Item::Container, StormByte::Config::Item::Value< T >, and StormByte::Config::Item::Value< std::string >.
|
inlinevirtualnoexcept |
Returns the comment type if this item is a Comment, otherwise std::nullopt.
Used by the serialization layer to determine the concrete Comment specialization without relying on RTTI / dynamic_cast.
Reimplemented in StormByte::Config::Item::Comment< T >.
|
inlinenoexcept |
Checks if the current name is valid.
|
inlineconstexprnoexcept |
Gets the name of the item.
|
inlineconstexprnoexcept |
Sets the item name.
| name | New name. |
|
inline |
Converts the item to a string.
|
inlinenoexcept |
|
inlinenoexcept |
|
virtualnoexcept |
Serializes the item.
| indent_level | Indentation level. |
Reimplemented in StormByte::Config::Item::Comment< T >, StormByte::Config::Item::Container, StormByte::Config::Item::Value< T >, and StormByte::Config::Item::Value< std::string >.
|
constexprpure virtualnoexcept |
Gets the item type.
Implemented in StormByte::Config::Item::Comment< T >, StormByte::Config::Item::Container, StormByte::Config::Item::Value< T >, and StormByte::Config::Item::Value< std::string >.
|
inlineconstexprnoexcept |
Gets the item type as a string.
|
inline |
Gets the item value (mutable).
| T | Target value type. |
| WrongValueTypeConversion | on type mismatch. |
|
inline |
Gets the item value (const).
| T | Target value type. |
| WrongValueTypeConversion | on type mismatch. |