StormByte C++ Library: Config module 0.0.9999
StormByte-Config is a StormByte library module for parsing configuration files
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
StormByte::Config::Item::Base Class Referenceabstract

The base class for all configuration items. More...

#include <base.hxx>

Inheritance diagram for StormByte::Config::Item::Base:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Config::Item::Base:
Collaboration graph
[legend]

Public Member Functions

 Base ()=default
 Constructs a Base item with an optional name.
 
 Base (const std::string &name)
 Constructs a Base item with an optional name.
 
 Base (const Base &base)=default
 
 Base (Base &&base) noexcept=default
 
Baseoperator= (const Base &base)=default
 
Baseoperator= (Base &&base) noexcept=default
 
virtual ~Base () noexcept=default
 
bool operator== (const Base &base) const noexcept
 
bool operator!= (const Base &base) const noexcept
 
constexpr const std::optional< std::string > & Name () const noexcept
 Gets the name of the item.
 
constexpr void Name (const std::string &name) noexcept
 
bool IsNameValid () const noexcept
 
virtual constexpr Type Type () const noexcept=0
 
constexpr std::string TypeToString () const noexcept
 
virtual std::string Serialize (const int &indent_level) const noexcept
 
 operator std::string () const
 
template<typename T >
const T & Value () const
 
template<typename T >
T & Value ()
 

Protected Attributes

std::optional< std::string > m_name
 Item name.
 

Detailed Description

The base class for all configuration items.

Constructor & Destructor Documentation

◆ Base() [1/4]

StormByte::Config::Item::Base::Base ( )
default

Constructs a Base item with an optional name.

Parameters
nameThe name of the item.

◆ Base() [2/4]

StormByte::Config::Item::Base::Base ( const std::string &  name)

Constructs a Base item with an optional name.

Parameters
nameThe name of the item.

◆ Base() [3/4]

StormByte::Config::Item::Base::Base ( const Base base)
default

Copy constructor

Parameters
baseitem to copy

◆ Base() [4/4]

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

Move constructor

Parameters
baseitem to move

◆ ~Base()

virtual StormByte::Config::Item::Base::~Base ( )
virtualdefaultnoexcept

Destructor

Member Function Documentation

◆ IsNameValid()

bool StormByte::Config::Item::Base::IsNameValid ( ) const
inlinenoexcept

Checks if current name is valid

Returns
is name valid?

◆ Name() [1/2]

constexpr const std::optional< std::string > & StormByte::Config::Item::Base::Name ( ) const
inlineconstexprnoexcept

Gets the name of the item.

Returns
The name of the item.

◆ Name() [2/2]

constexpr void StormByte::Config::Item::Base::Name ( const std::string &  name)
inlineconstexprnoexcept

Sets the item name

Returns
item name

◆ operator std::string()

StormByte::Config::Item::Base::operator std::string ( ) const
inline

Converts current configuration to string

Returns
configuration as string

◆ operator!=()

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

Inequality operator

Parameters
baseitem to compare
Returns
is not equal?

◆ operator=() [1/2]

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

Move assignment operator

Parameters
baseitem to move

◆ operator=() [2/2]

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

Assignment operator

Parameters
baseitem to copy

◆ operator==()

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

Equality operator

Parameters
baseitem to compare
Returns
is equal?

◆ Serialize()

virtual std::string StormByte::Config::Item::Base::Serialize ( const int &  indent_level) const
virtualnoexcept

◆ Type()

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

◆ TypeToString()

constexpr std::string StormByte::Config::Item::Base::TypeToString ( ) const
inlineconstexprnoexcept

Gets the item type as string

Returns
item type as string

◆ Value() [1/2]

template<typename T >
T & StormByte::Config::Item::Base::Value ( )
inline

Gets the item value

Template Parameters
Titem value type
Returns
item value

◆ Value() [2/2]

template<typename T >
const T & StormByte::Config::Item::Base::Value ( ) const
inline

Gets the item value

Template Parameters
Titem value type
Returns
item value

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