Scalar configuration item. More...
#include <StormByte/config/item/value.hxx>


Public Member Functions | |
| Value (int value) | |
| Integer payload. | |
| Value (double value) | |
| Double payload. | |
| Value (bool value) | |
| Bool payload. | |
| Value (const char *value) | |
| Text payload from a C string. | |
| Value (std::string_view value) | |
| Text payload from a view. | |
| Value (StormByte::Safe::String &&value) | |
| Text payload. | |
| Value (const StormByte::Safe::Binary &value) | |
| Byte payload. | |
| Value (StormByte::Safe::Binary &&value) | |
| Byte payload. | |
| Value (std::string_view name, int value) | |
| Named integer. | |
| Value (std::string_view name, double value) | |
| Named double. | |
| Value (std::string_view name, bool value) | |
| Named bool. | |
| Value (std::string_view name, const char *value) | |
| Named text from a C string. | |
| Value (std::string_view name, std::string_view value) | |
| Named text. | |
| Value (std::string_view name, const StormByte::Safe::Binary &value) | |
| Named bytes. | |
| Value (std::string_view name, StormByte::Safe::Binary &&value) | |
| Named bytes. | |
| Value (const Value &value) | |
| Copy constructor. | |
| Value (Value &&value) noexcept | |
| Move constructor. | |
| ~Value () noexcept override | |
| Destructor. | |
| Value & | operator= (const Value &value) |
| Copy assignment. | |
| Value & | operator= (Value &&value) noexcept |
| Move assignment. | |
| Item::Type | Kind () const noexcept |
| Payload kind. | |
| Item::Type | Type () const noexcept override |
| Item type. | |
| Value & | operator= (int value) |
| Assign an integer. | |
| Value & | operator= (double value) |
| Assign a double. | |
| Value & | operator= (bool value) |
| Assign a bool. | |
| Value & | operator= (const char *value) |
| Assign text from a C string. | |
| Value & | operator= (std::string_view value) |
| Assign text. | |
| Value & | operator= (const StormByte::Safe::Binary &value) |
| Assign bytes. | |
| operator int & () | |
| Integer reference. | |
| operator const int & () const | |
| Integer reference. | |
| operator double () const | |
| Double value. | |
| operator double & () | |
| Double reference. | |
| operator bool & () | |
| Bool reference. | |
| operator const bool & () const | |
| Bool reference. | |
| operator StormByte::Safe::String & () | |
| Text reference. | |
| operator const StormByte::Safe::String & () const | |
| Text reference. | |
| operator StormByte::Safe::Binary & () | |
| Byte reference. | |
| operator const StormByte::Safe::Binary & () const | |
| Byte reference. | |
| PointerType | Clone () const override |
| Clone onto the Config heap. | |
| PointerType | Move () override |
| Move onto the Config heap. | |
| StormByte::Safe::String | Serialize (const int &indent_level) const override |
| Text form of this item. | |
| Public Member Functions inherited from StormByte::Config::Item::Base | |
| Base () noexcept | |
| Constructor. | |
| Base (const StormByte::Safe::String &name) | |
| Constructor. | |
| Base (const Base &base) noexcept | |
| Copy constructor. | |
| Base (Base &&base) noexcept | |
| Move constructor. | |
| Base & | operator= (const Base &base) noexcept |
| Assignment operator. | |
| Base & | operator= (Base &&base) noexcept |
| Move assignment operator. | |
| ~Base () noexcept override | |
| Destructor. | |
| bool | operator== (const Base &base) const noexcept |
| Compares two items. | |
| bool | operator!= (const Base &base) const noexcept |
| Compares two items. | |
| constexpr const StormByte::Safe::String & | Name () const noexcept |
| Gets the name of the item. | |
| void | Name (std::string_view name) |
| Sets the name of the item. | |
| constexpr std::string_view | TypeToString () const noexcept |
| Gets the type as string. | |
| template<class T> | |
| decltype(auto) | As () |
| Typed view of this item. | |
| template<class T> | |
| decltype(auto) | As () const |
| Typed view of this item. | |
| Public Member Functions inherited from StormByte::Safe::Clonable< Base, StormByte::Safe::Shared< Base > > | |
| constexpr | Clonable ()=default |
| constexpr Clonable & | operator= (const Clonable &)=default |
| virtual constexpr | ~Clonable () noexcept=default |
Protected Member Functions | |
| bool | Equals (const Base &base) const override |
| Compare payloads after the base has matched the type. | |
Additional Inherited Members | |
| Public Types inherited from StormByte::Safe::Clonable< Base, StormByte::Safe::Shared< Base > > | |
| typedef SmartPointer | PointerType |
| Static Public Member Functions inherited from StormByte::Config::Item::Base | |
| static bool | IsNameValid (std::string_view name) noexcept |
| Checks if name is valid. | |
| Static Public Member Functions inherited from StormByte::Safe::Clonable< Base, StormByte::Safe::Shared< Base > > | |
| static PointerType | MakePointer (Args &&... args) |
| Protected Attributes inherited from StormByte::Config::Item::Base | |
| StormByte::Safe::String | m_name |
| Name of the item. | |
Scalar configuration item.
The payload is a StormByte::Safe::Variant. Integer, double, bool, text and bytes do not share storage by hand. A text literal binds to const char*. That overload is exact and beats the bool conversion of a pointer. std::string and Safe::String bind to string_view.
|
explicit |
|
explicit |
|
explicit |
Text payload from a C string.
| value | Source. A null pointer is empty text. |
|
explicit |
Text payload from a view.
| value | Source. A std::string or Safe::String binds here. Embedded NUL counts. |
|
explicit |
Text payload.
| value | Owned text. Left empty. |
|
explicit |
Byte payload.
| value | Owned bytes. |
|
explicit |
Byte payload.
| value | Owned bytes. Left empty. |
| StormByte::Config::Item::Value::Value | ( | std::string_view | name, |
| int | value ) |
| StormByte::Config::Item::Value::Value | ( | std::string_view | name, |
| double | value ) |
| StormByte::Config::Item::Value::Value | ( | std::string_view | name, |
| bool | value ) |
| StormByte::Config::Item::Value::Value | ( | std::string_view | name, |
| const char * | value ) |
Named text from a C string.
| name | Item name. |
| value | C string. A null pointer is empty text. |
| StormByte::Config::Item::Value::Value | ( | std::string_view | name, |
| std::string_view | value ) |
Named text.
| name | Item name. |
| value | Text. A std::string or Safe::String binds here. Embedded NUL counts. |
| StormByte::Config::Item::Value::Value | ( | std::string_view | name, |
| const StormByte::Safe::Binary & | value ) |
Named bytes.
| name | Item name. |
| value | Owned bytes. |
| StormByte::Config::Item::Value::Value | ( | std::string_view | name, |
| StormByte::Safe::Binary && | value ) |
Named bytes.
| name | Item name. |
| value | Owned bytes. Left empty. |
| StormByte::Config::Item::Value::Value | ( | const Value & | value | ) |
Copy constructor.
| value | Source. |
|
noexcept |
Move constructor.
| value | Source. Left as an integer zero. |
|
overridenoexcept |
Destructor.
|
overridevirtual |
Clone onto the Config heap.
Implements StormByte::Safe::Clonable< Base, StormByte::Safe::Shared< Base > >.
|
overrideprotectedvirtual |
Compare payloads after the base has matched the type.
| base | Other item, already a Value. |
Implements StormByte::Config::Item::Base.
|
noexcept |
Payload kind.
|
overridevirtual |
Move onto the Config heap.
Implements StormByte::Safe::Clonable< Base, StormByte::Safe::Shared< Base > >.
| StormByte::Config::Item::Value::operator bool & | ( | ) |
| StormByte::Config::Item::Value::operator const bool & | ( | ) | const |
| StormByte::Config::Item::Value::operator const int & | ( | ) | const |
| StormByte::Config::Item::Value::operator const StormByte::Safe::Binary & | ( | ) | const |
| StormByte::Config::Item::Value::operator const StormByte::Safe::String & | ( | ) | const |
| StormByte::Config::Item::Value::operator double | ( | ) | const |
| StormByte::Config::Item::Value::operator double & | ( | ) |
| StormByte::Config::Item::Value::operator int & | ( | ) |
| StormByte::Config::Item::Value::operator StormByte::Safe::Binary & | ( | ) |
| StormByte::Config::Item::Value::operator StormByte::Safe::String & | ( | ) |
| Value & StormByte::Config::Item::Value::operator= | ( | bool | value | ) |
| Value & StormByte::Config::Item::Value::operator= | ( | const char * | value | ) |
Assign text from a C string.
The kind must already be text.
| value | C string. A null pointer is empty text. |
| Exception | The payload is not text. |
| Value & StormByte::Config::Item::Value::operator= | ( | const StormByte::Safe::Binary & | value | ) |
Assign bytes.
The kind must already be bytes.
| value | Owned bytes. |
| Exception | The payload is not bytes. |
Copy assignment.
| value | Source. |
| Value & StormByte::Config::Item::Value::operator= | ( | double | value | ) |
| Value & StormByte::Config::Item::Value::operator= | ( | int | value | ) |
| Value & StormByte::Config::Item::Value::operator= | ( | std::string_view | value | ) |
Assign text.
The kind must already be text.
| value | Text. A std::string or Safe::String binds here. |
| Exception | The payload is not text. |
Move assignment.
| value | Source. Left as an integer zero. |
|
overridevirtual |
Text form of this item.
| indent_level | Tab count before the line. |
Reimplemented from StormByte::Config::Item::Base.
|
overridevirtualnoexcept |