StormByte-Config 3.0.0
C++26 configuration-document module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Config::Item::Base Class Referenceabstract

Base class for all configuration items. More...

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

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

Public Member Functions

 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.
virtual constexpr Item::Type Type () const noexcept=0
 Gets the type 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.
virtual StormByte::Safe::String Serialize (const int &indent_level=0) const
 Serializes the item as text.
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
virtual PointerType Clone () const =0
virtual PointerType Move ()=0

Static Public Member Functions

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 Member Functions

virtual bool Equals (const Base &base) const =0
 Equals.

Protected Attributes

StormByte::Safe::String m_name
 Name of the item.

Additional Inherited Members

Public Types inherited from StormByte::Safe::Clonable< Base, StormByte::Safe::Shared< Base > >
typedef SmartPointer PointerType

Detailed Description

Base class for all configuration items.

Constructor & Destructor Documentation

◆ Base() [1/4]

StormByte::Config::Item::Base::Base ( )
noexcept

Constructor.

◆ Base() [2/4]

StormByte::Config::Item::Base::Base ( const StormByte::Safe::String & name)

Constructor.

Parameters
namename of the item

◆ Base() [3/4]

StormByte::Config::Item::Base::Base ( const Base & base)
noexcept

Copy constructor.

Parameters
baseitem to copy

◆ Base() [4/4]

StormByte::Config::Item::Base::Base ( Base && base)
noexcept

Move constructor.

Parameters
baseitem to move

◆ ~Base()

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

Destructor.

Member Function Documentation

◆ As() [1/2]

template<class T>
decltype(auto) StormByte::Config::Item::Base::As ( )

Typed view of this item.

Template Parameters
Tnode type, leaf tag or comment specialization
Returns
reference or converted value depending on T

◆ As() [2/2]

template<class T>
decltype(auto) StormByte::Config::Item::Base::As ( ) const

Typed view of this item.

Template Parameters
Tnode type, leaf tag or comment specialization
Returns
reference or converted value depending on T

◆ Equals()

virtual bool StormByte::Config::Item::Base::Equals ( const Base & base) const
protectedpure virtual

◆ IsNameValid()

bool StormByte::Config::Item::Base::IsNameValid ( std::string_view name)
staticnoexcept

Checks if name is valid.

Parameters
namename. A literal, std::string or Safe::String binds here.
Returns
bool

◆ Name() [1/2]

const StormByte::Safe::String & StormByte::Config::Item::Base::Name ( ) const
inlineconstexprnoexcept

Gets the name of the item.

Returns
name

◆ Name() [2/2]

void StormByte::Config::Item::Base::Name ( std::string_view name)
inline

Sets the name of the item.

Parameters
namename. A literal, std::string or Safe::String binds here.

◆ operator!=()

bool StormByte::Config::Item::Base::operator!= ( const Base & base) const
noexcept

Compares two items.

Parameters
baseitem to compare
Returns
bool

◆ operator=() [1/2]

Base & StormByte::Config::Item::Base::operator= ( Base && base)
noexcept

Move assignment operator.

Parameters
baseitem to move
Returns
moved item

◆ operator=() [2/2]

Base & StormByte::Config::Item::Base::operator= ( const Base & base)
noexcept

Assignment operator.

Parameters
baseitem to copy
Returns
copied item

◆ operator==()

bool StormByte::Config::Item::Base::operator== ( const Base & base) const
noexcept

Compares two items.

Parameters
baseitem to compare
Returns
bool

◆ Serialize()

virtual StormByte::Safe::String StormByte::Config::Item::Base::Serialize ( const int & indent_level = 0) const
virtual

◆ Type()

virtual constexpr Item::Type StormByte::Config::Item::Base::Type ( ) const
constexprpure virtualnoexcept

◆ TypeToString()

std::string_view StormByte::Config::Item::Base::TypeToString ( ) const
inlineconstexprnoexcept

Gets the type as string.

Returns
type as string

Member Data Documentation

◆ m_name

StormByte::Safe::String StormByte::Config::Item::Base::m_name
protected

Name of the item.


The documentation for this class was generated from the following file:
  • lib/public/StormByte/config/item/base.hxx