StormByte-Config 2.0.0
C++26 configuration-document module of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Config::Item::Value Class Reference

Scalar configuration item. More...

#include <StormByte/config/item/value.hxx>

Inheritance diagram for StormByte::Config::Item::Value:
Collaboration diagram for StormByte::Config::Item::Value:

Public Member Functions

 Value (int value)
 Constructor.
 
 Value (double value)
 Constructor.
 
 Value (bool value)
 Constructor.
 
 Value (const StormByte::String::String &value)
 Constructor.
 
 Value (StormByte::String::String &&value)
 Constructor.
 
 Value (const char *value)
 Constructor.
 
 Value (std::string_view value)
 Constructor.
 
 Value (const StormByte::BinaryData &value)
 Constructor.
 
 Value (StormByte::BinaryData &&value)
 Constructor.
 
 Value (const StormByte::String::String &name, int value)
 Constructor.
 
 Value (const StormByte::String::String &name, double value)
 Constructor.
 
 Value (const StormByte::String::String &name, bool value)
 Constructor.
 
 Value (const StormByte::String::String &name, const StormByte::String::String &value)
 Constructor.
 
 Value (const StormByte::String::String &name, const char *value)
 Constructor.
 
 Value (const StormByte::String::String &name, const StormByte::BinaryData &value)
 Constructor.
 
 Value (std::string_view name, int value)
 Constructor.
 
 Value (std::string_view name, double value)
 Constructor.
 
 Value (std::string_view name, bool value)
 Constructor.
 
 Value (std::string_view name, std::string_view value)
 Constructor.
 
 Value (std::string_view name, const char *value)
 Constructor.
 
 Value (std::string_view name, const StormByte::BinaryData &value)
 Constructor.
 
 Value (const Value &value)
 Copy constructor.
 
 Value (Value &&value) noexcept
 Move constructor.
 
Value & operator= (const Value &value)
 Assignment operator.
 
Value & operator= (Value &&value) noexcept
 Move assignment operator.
 
 ~Value () noexcept override
 Destructor.
 
Item::Type Kind () const noexcept
 Payload kind.
 
Item::Type Type () const noexcept override
 Item type.
 
Value & operator= (int value)
 Assign integer.
 
Value & operator= (double value)
 Assign double.
 
Value & operator= (bool value)
 Assign bool.
 
Value & operator= (const StormByte::String::String &value)
 Assign string.
 
Value & operator= (const char *value)
 Assign string.
 
Value & operator= (const StormByte::BinaryData &value)
 Assign bytes.
 
 operator int & ()
 Convert to integer.
 
 operator const int & () const
 Convert to integer.
 
 operator double () const
 Convert to double (Integer promotes)
 
 operator double & ()
 Convert to double reference.
 
 operator bool & ()
 Convert to bool.
 
 operator const bool & () const
 Convert to bool.
 
 operator StormByte::String::String & ()
 Convert to string.
 
 operator const StormByte::String::String & () const
 Convert to string.
 
 operator StormByte::BinaryData & ()
 Convert to bytes.
 
 operator const StormByte::BinaryData & () const
 Convert to bytes.
 
PointerType Clone () const override
 Clone.
 
PointerType Move () override
 Move.
 
StormByte::String::String Serialize (const int &indent_level) const override
 Serialize.
 
- Public Member Functions inherited from StormByte::Config::Item::Base
 Base () noexcept
 Constructor.
 
 Base (const StormByte::String::String &name)
 Constructor.
 
 Base (const Base &base) noexcept=default
 Copy constructor.
 
 Base (Base &&base) noexcept=default
 Move constructor.
 
Base & operator= (const Base &base) noexcept=default
 Assignment operator.
 
Base & operator= (Base &&base) noexcept=default
 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::String::String & Name () const noexcept
 Gets the name of the item.
 
constexpr void Name (const StormByte::String::String &name)
 Sets 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::Clonable< Base, StormByte::Shared< Base > >
constexpr Clonable ()=default
 
constexpr Clonable (const Clonable &)=default
 
constexpr Clonable (Clonable &&) noexcept=default
 
constexpr Clonable & operator= (const Clonable &)=default
 
constexpr Clonable & operator= (Clonable &&) noexcept=default
 
virtual constexpr ~Clonable () noexcept=default
 

Protected Member Functions

bool Equals (const Base &base) const override
 Equals.
 

Additional Inherited Members

- Public Types inherited from StormByte::Clonable< Base, StormByte::Shared< Base > >
typedef SmartPointer PointerType
 
- Static Public Member Functions inherited from StormByte::Config::Item::Base
static bool IsNameValid (const StormByte::String::String &name) noexcept
 Checks if name is valid.
 
static bool IsNameValid (std::string_view name) noexcept
 Checks if name is valid.
 
- Static Public Member Functions inherited from StormByte::Clonable< Base, StormByte::Shared< Base > >
static PointerType MakePointer (Args &&... args)
 
- Protected Attributes inherited from StormByte::Config::Item::Base
StormByte::String::String m_name
 Name of the item.
 

Detailed Description

Scalar configuration item.

Constructor & Destructor Documentation

◆ Value() [1/23]

StormByte::Config::Item::Value::Value ( int  value)
explicit

Constructor.

Parameters
valueinteger

◆ Value() [2/23]

StormByte::Config::Item::Value::Value ( double  value)
explicit

Constructor.

Parameters
valuedouble

◆ Value() [3/23]

StormByte::Config::Item::Value::Value ( bool  value)
explicit

Constructor.

Parameters
valuebool

◆ Value() [4/23]

StormByte::Config::Item::Value::Value ( const StormByte::String::String &  value)
explicit

Constructor.

Parameters
valuestring

◆ Value() [5/23]

StormByte::Config::Item::Value::Value ( StormByte::String::String &&  value)
explicit

Constructor.

Parameters
valuestring

◆ Value() [6/23]

StormByte::Config::Item::Value::Value ( const char *  value)
explicit

Constructor.

Parameters
valuestring

◆ Value() [7/23]

StormByte::Config::Item::Value::Value ( std::string_view  value)
explicit

Constructor.

Parameters
valuestring

◆ Value() [8/23]

StormByte::Config::Item::Value::Value ( const StormByte::BinaryData &  value)
explicit

Constructor.

Parameters
valuebytes

◆ Value() [9/23]

StormByte::Config::Item::Value::Value ( StormByte::BinaryData &&  value)
explicit

Constructor.

Parameters
valuebytes

◆ Value() [10/23]

StormByte::Config::Item::Value::Value ( const StormByte::String::String &  name,
int  value 
)

Constructor.

Parameters
namename
valueinteger

◆ Value() [11/23]

StormByte::Config::Item::Value::Value ( const StormByte::String::String &  name,
double  value 
)

Constructor.

Parameters
namename
valuedouble

◆ Value() [12/23]

StormByte::Config::Item::Value::Value ( const StormByte::String::String &  name,
bool  value 
)

Constructor.

Parameters
namename
valuebool

◆ Value() [13/23]

StormByte::Config::Item::Value::Value ( const StormByte::String::String &  name,
const StormByte::String::String &  value 
)

Constructor.

Parameters
namename
valuestring

◆ Value() [14/23]

StormByte::Config::Item::Value::Value ( const StormByte::String::String &  name,
const char *  value 
)

Constructor.

Parameters
namename
valuestring

◆ Value() [15/23]

StormByte::Config::Item::Value::Value ( const StormByte::String::String &  name,
const StormByte::BinaryData &  value 
)

Constructor.

Parameters
namename
valuebytes

◆ Value() [16/23]

StormByte::Config::Item::Value::Value ( std::string_view  name,
int  value 
)

Constructor.

Parameters
namename
valueinteger

◆ Value() [17/23]

StormByte::Config::Item::Value::Value ( std::string_view  name,
double  value 
)

Constructor.

Parameters
namename
valuedouble

◆ Value() [18/23]

StormByte::Config::Item::Value::Value ( std::string_view  name,
bool  value 
)

Constructor.

Parameters
namename
valuebool

◆ Value() [19/23]

StormByte::Config::Item::Value::Value ( std::string_view  name,
std::string_view  value 
)

Constructor.

Parameters
namename
valuestring

◆ Value() [20/23]

StormByte::Config::Item::Value::Value ( std::string_view  name,
const char *  value 
)

Constructor.

Parameters
namename
valuestring

◆ Value() [21/23]

StormByte::Config::Item::Value::Value ( std::string_view  name,
const StormByte::BinaryData &  value 
)

Constructor.

Parameters
namename
valuebytes

◆ Value() [22/23]

StormByte::Config::Item::Value::Value ( const Value &  value)

Copy constructor.

Parameters
valueitem

◆ Value() [23/23]

StormByte::Config::Item::Value::Value ( Value &&  value)
noexcept

Move constructor.

Parameters
valueitem

◆ ~Value()

StormByte::Config::Item::Value::~Value ( )
overridenoexcept

Destructor.

Member Function Documentation

◆ Clone()

PointerType StormByte::Config::Item::Value::Clone ( ) const
overridevirtual

Clone.

Returns
pointer

Implements StormByte::Clonable< Base, StormByte::Shared< Base > >.

◆ Equals()

bool StormByte::Config::Item::Value::Equals ( const Base &  base) const
overrideprotectedvirtual

Equals.

Parameters
baseitem
Returns
bool

Implements StormByte::Config::Item::Base.

◆ Kind()

Item::Type StormByte::Config::Item::Value::Kind ( ) const
noexcept

Payload kind.

Returns
item type

◆ Move()

PointerType StormByte::Config::Item::Value::Move ( )
overridevirtual

◆ operator bool &()

StormByte::Config::Item::Value::operator bool & ( )

Convert to bool.

◆ operator const bool &()

StormByte::Config::Item::Value::operator const bool & ( ) const

Convert to bool.

◆ operator const int &()

StormByte::Config::Item::Value::operator const int & ( ) const

Convert to integer.

◆ operator const StormByte::BinaryData &()

StormByte::Config::Item::Value::operator const StormByte::BinaryData & ( ) const

Convert to bytes.

◆ operator const StormByte::String::String &()

StormByte::Config::Item::Value::operator const StormByte::String::String & ( ) const

Convert to string.

◆ operator double()

StormByte::Config::Item::Value::operator double ( ) const

Convert to double (Integer promotes)

◆ operator double &()

StormByte::Config::Item::Value::operator double & ( )

Convert to double reference.

◆ operator int &()

StormByte::Config::Item::Value::operator int & ( )

Convert to integer.

◆ operator StormByte::BinaryData &()

StormByte::Config::Item::Value::operator StormByte::BinaryData & ( )

Convert to bytes.

◆ operator StormByte::String::String &()

StormByte::Config::Item::Value::operator StormByte::String::String & ( )

Convert to string.

◆ operator=() [1/8]

Value & StormByte::Config::Item::Value::operator= ( bool  value)

Assign bool.

Parameters
valuebool
Returns
this

◆ operator=() [2/8]

Value & StormByte::Config::Item::Value::operator= ( const char *  value)

Assign string.

Parameters
valuestring
Returns
this

◆ operator=() [3/8]

Value & StormByte::Config::Item::Value::operator= ( const StormByte::BinaryData &  value)

Assign bytes.

Parameters
valuebytes
Returns
this

◆ operator=() [4/8]

Value & StormByte::Config::Item::Value::operator= ( const StormByte::String::String &  value)

Assign string.

Parameters
valuestring
Returns
this

◆ operator=() [5/8]

Value & StormByte::Config::Item::Value::operator= ( const Value &  value)

Assignment operator.

Parameters
valueitem
Returns
this

◆ operator=() [6/8]

Value & StormByte::Config::Item::Value::operator= ( double  value)

Assign double.

Parameters
valuedouble
Returns
this

◆ operator=() [7/8]

Value & StormByte::Config::Item::Value::operator= ( int  value)

Assign integer.

Parameters
valueinteger
Returns
this

◆ operator=() [8/8]

Value & StormByte::Config::Item::Value::operator= ( Value &&  value)
noexcept

Move assignment operator.

Parameters
valueitem
Returns
this

◆ Serialize()

StormByte::String::String StormByte::Config::Item::Value::Serialize ( const int &  indent_level) const
overridevirtual

Serialize.

Parameters
indent_levelindent
Returns
text

Reimplemented from StormByte::Config::Item::Base.

◆ Type()

Item::Type StormByte::Config::Item::Value::Type ( ) const
overridevirtualnoexcept

Item type.

Returns
item type

Implements StormByte::Config::Item::Base.


The documentation for this class was generated from the following file: