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 | List of all members
StormByte::Config::Item::List Class Referencefinal

Represents a list in a configuration file that can hold other items, subgroups, and sublists recursively. More...

#include <list.hxx>

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

Public Member Functions

 List ()=default
 Constructs an empty List.
 
 List (const std::string &name)
 Constructs a List with the given name.
 
 List (std::string &&name)
 Constructs a List with the given name.
 
 List (const List &list)=default
 
 List (List &&list) noexcept=default
 
Listoperator= (const List &list)=default
 
Listoperator= (List &&list) noexcept=default
 
 ~List () noexcept override=default
 
PointerType Clone () const override
 
PointerType Move () override
 
constexpr Item::ContainerType ContainerType () const noexcept override
 
- Public Member Functions inherited from StormByte::Config::Item::Container
 Container ()=default
 Constructs an empty Container.
 
 Container (const std::string &name)
 
 Container (std::string &&name)
 
 Container (const Container &base)=default
 
 Container (Container &&base) noexcept=default
 
Containeroperator= (const Container &base)=default
 
Containeroperator= (Container &&base) noexcept=default
 
virtual ~Container () noexcept override=default
 
Baseoperator[] (const size_t &index)
 
const Baseoperator[] (const size_t &index) const
 
Baseoperator[] (const std::string &path)
 
const Baseoperator[] (const std::string &path) const
 
bool operator== (const Container &container) const noexcept
 
bool operator!= (const Container &container) const noexcept
 
BaseAdd (const Base &item, const OnExistingAction &on_existing=OnExistingAction::ThrowException)
 
BaseAdd (Base &&item, const OnExistingAction &on_existing=OnExistingAction::ThrowException)
 
BaseAdd (Base::PointerType item, const OnExistingAction &on_existing)
 Adds an item to the container.
 
void Clear () noexcept
 
bool Exists (const std::string &path) const
 
void Remove (const size_t &index)
 
void Remove (const std::string &path)
 
std::string Serialize (const int &indent_level) const noexcept override
 
constexpr std::span< Base::PointerType > Items () noexcept
 
constexpr std::span< const Base::PointerType > Items () const noexcept
 
constexpr std::string ContainerTypeToString () const noexcept
 
constexpr Item::Type Type () const noexcept override
 
constexpr size_t Size () const noexcept
 
size_t Count () const noexcept
 
- Public Member Functions inherited from StormByte::Config::Item::Base
 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
 
constexpr std::string TypeToString () const noexcept
 
 operator std::string () const
 
template<typename T >
const T & Value () const
 
template<typename T >
T & Value ()
 

Additional Inherited Members

- Static Public Member Functions inherited from StormByte::Config::Item::Container
static constexpr std::pair< const char, const char > EnclosureCharacters (const ContainerType &type) noexcept
 
static constexpr const char EndCharacter (const ContainerType &type) noexcept
 
- Protected Attributes inherited from StormByte::Config::Item::Container
std::vector< Base::PointerType > m_items
 Items in container.
 
- Protected Attributes inherited from StormByte::Config::Item::Base
std::optional< std::string > m_name
 Item name.
 

Detailed Description

Represents a list in a configuration file that can hold other items, subgroups, and sublists recursively.

include_dirs = [
"/usr/include"
"/usr/local/include"
]

Constructor & Destructor Documentation

◆ List() [1/4]

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

Constructs a List with the given name.

Parameters
nameThe name of the list.

◆ List() [2/4]

StormByte::Config::Item::List::List ( std::string &&  name)

Constructs a List with the given name.

Parameters
nameThe name of the list.

◆ List() [3/4]

StormByte::Config::Item::List::List ( const List list)
default

Copy constructor

Parameters
listList to copy

◆ List() [4/4]

StormByte::Config::Item::List::List ( List &&  list)
defaultnoexcept

Move constructor

Parameters
listList to move

◆ ~List()

StormByte::Config::Item::List::~List ( )
overridedefaultnoexcept

Destructor

Member Function Documentation

◆ Clone()

PointerType StormByte::Config::Item::List::Clone ( ) const
inlineoverride

Clones the list

Returns
cloned list

◆ ContainerType()

constexpr Item::ContainerType StormByte::Config::Item::List::ContainerType ( ) const
inlineconstexproverridevirtualnoexcept

Gets the container type

Returns
Container type

Implements StormByte::Config::Item::Container.

◆ Move()

PointerType StormByte::Config::Item::List::Move ( )
inlineoverride

Moves the list

Returns
moved list

◆ operator=() [1/2]

List & StormByte::Config::Item::List::operator= ( const List list)
default

Assignment operator

Parameters
listList to assign

◆ operator=() [2/2]

List & StormByte::Config::Item::List::operator= ( List &&  list)
defaultnoexcept

Move assignment operator

Parameters
listList to move

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