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::Comment< T > Class Template Referencefinal

Represents a comment item in a configuration file. More...

#include <comment.hxx>

Inheritance diagram for StormByte::Config::Item::Comment< T >:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Config::Item::Comment< T >:
Collaboration graph
[legend]

Public Member Functions

 Comment (const std::string &comment)
 Constructs a Comment with the given string.
 
 Comment (std::string &&comment)
 
 Comment (const Comment &base)=default
 
 Comment (Comment &&base)=default
 
Commentoperator= (const Comment &base)=default
 
Commentoperator= (Comment &&base)=default
 
 ~Comment () noexcept override=default
 
std::string Serialize (const int &indent_level) const noexcept override
 
constexpr Item::Type Type () const noexcept override
 
constexpr CommentType CommentType () const noexcept
 
constexpr std::string CommentTypeToString () const noexcept
 
PointerType Clone () const override
 
PointerType Move () override
 
- Public Member Functions inherited from StormByte::Config::Item::Value< std::string >
 Value (const T &value)
 Constructs a Value with the given value.
 
 Value (const char *value)
 
 Value (const char *name, const char *value)
 
 Value (T &&value)
 
 Value (const std::string &name, const T &value)
 
 Value (std::string &&name, T &&value)
 
 Value (const std::string &name, const char *value)
 
 Value (std::string &&name, const char *value)
 
 Value (const Value &single)=default
 
 Value (Value &&single) noexcept=default
 
Valueoperator= (const Value &single)=default
 
Valueoperator= (Value &&single) noexcept=default
 
virtual ~Value () noexcept override=default
 
bool operator== (const Value< T > &single) const noexcept
 Checks if two Value objects are equal.
 
bool operator!= (const Value< T > &single) const noexcept
 
T & operator* () noexcept
 
const T & operator* () const noexcept
 
std::string Serialize (const int &indent_level) const noexcept override
 Serializes the item to a string.
 
- 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

- Protected Attributes inherited from StormByte::Config::Item::Value< std::string >
m_value
 The value of the item.
 
- Protected Attributes inherited from StormByte::Config::Item::Base
std::optional< std::string > m_name
 Item name.
 

Detailed Description

template<CommentType T>
class StormByte::Config::Item::Comment< T >

Represents a comment item in a configuration file.

Template Parameters
TThe type of the comment (e.g., single-line or multi-line).

Constructor & Destructor Documentation

◆ Comment() [1/4]

template<CommentType T>
StormByte::Config::Item::Comment< T >::Comment ( const std::string &  comment)
inline

Constructs a Comment with the given string.

Parameters
commentThe comment string.

◆ Comment() [2/4]

template<CommentType T>
StormByte::Config::Item::Comment< T >::Comment ( std::string &&  comment)
inline

Move Constructor

Parameters
commentcomment string

◆ Comment() [3/4]

template<CommentType T>
StormByte::Config::Item::Comment< T >::Comment ( const Comment< T > &  base)
default

Copy constructor

Parameters
basecomment to copy

◆ Comment() [4/4]

template<CommentType T>
StormByte::Config::Item::Comment< T >::Comment ( Comment< T > &&  base)
default

Move constructor

Parameters
basecomment to move

◆ ~Comment()

template<CommentType T>
StormByte::Config::Item::Comment< T >::~Comment ( )
overridedefaultnoexcept

Destructor

Member Function Documentation

◆ Clone()

template<CommentType T>
PointerType StormByte::Config::Item::Comment< T >::Clone ( ) const
inlineoverridevirtual

Clones the comment

Returns
cloned comment

Reimplemented from StormByte::Config::Item::Value< std::string >.

◆ CommentType()

template<CommentType T>
constexpr CommentType StormByte::Config::Item::Comment< T >::CommentType ( ) const
inlineconstexprnoexcept

Gets the comment string

Returns
comment string

◆ CommentTypeToString()

template<CommentType T>
constexpr std::string StormByte::Config::Item::Comment< T >::CommentTypeToString ( ) const
inlineconstexprnoexcept

Converts comment type to string

Returns
comment type string

◆ Move()

template<CommentType T>
PointerType StormByte::Config::Item::Comment< T >::Move ( )
inlineoverridevirtual

Moves the comment

Returns
moved comment

Reimplemented from StormByte::Config::Item::Value< std::string >.

◆ operator=() [1/2]

template<CommentType T>
Comment & StormByte::Config::Item::Comment< T >::operator= ( Comment< T > &&  base)
default

Move assignment operator

Parameters
basecomment to move

◆ operator=() [2/2]

template<CommentType T>
Comment & StormByte::Config::Item::Comment< T >::operator= ( const Comment< T > &  base)
default

Assignment operator

Parameters
basecomment to copy

◆ Serialize()

template<CommentType T>
std::string StormByte::Config::Item::Comment< T >::Serialize ( const int &  indent_level) const
overridevirtualnoexcept

Serializes the comment item

Parameters
indent_levelintentation level
Returns
serialized string

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

◆ Type()

template<CommentType T>
constexpr Item::Type StormByte::Config::Item::Comment< T >::Type ( ) const
inlineconstexproverridevirtualnoexcept

Gets the item type

Returns
item type

Reimplemented from StormByte::Config::Item::Value< std::string >.


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