StormByte-Config 2.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::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.
 
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::String::String Serialize (const int &indent_level=0) const
 Serializes the item as text.
 
- 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
 
virtual PointerType Clone () const =0
 
virtual PointerType Move ()=0
 

Static Public Member Functions

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

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

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from StormByte::Clonable< Base, StormByte::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::String::String &  name)

Constructor.

Parameters
namename of the item

◆ Base() [3/4]

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

Copy constructor.

Parameters
baseitem to copy

◆ Base() [4/4]

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

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() [1/2]

static bool StormByte::Config::Item::Base::IsNameValid ( const StormByte::String::String &  name)
staticnoexcept

Checks if name is valid.

Parameters
namename
Returns
bool

◆ IsNameValid() [2/2]

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

Checks if name is valid.

Parameters
namename
Returns
bool

◆ Name() [1/3]

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

Gets the name of the item.

Returns
name

◆ Name() [2/3]

constexpr void StormByte::Config::Item::Base::Name ( const StormByte::String::String &  name)
inlineconstexpr

Sets the name of the item.

Parameters
namename

◆ Name() [3/3]

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

Sets the name of the item.

Parameters
namename

◆ 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)
defaultnoexcept

Move assignment operator.

Parameters
baseitem to move
Returns
moved item

◆ operator=() [2/2]

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

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::String::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()

constexpr 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::String::String StormByte::Config::Item::Base::m_name
protected

Name of the item.


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