StormByte C++ Library: Config module 1.0.1.9999
StormByte-Config is the configuration module of the StormByte C++ suite.
Loading...
Searching...
No Matches
Classes | Concepts | Enumerations | Functions | Variables
StormByte::Config::Item Namespace Reference

Configuration items (values, comments, groups, lists). More...

Classes

class  Base
 The base class for all configuration items. More...
 
class  Comment
 Comment item (#, // or /* *\/). More...
 
class  Container
 Holds child items. Group and List derive from this. More...
 
class  Group
 Named container { … } that can hold items, subgroups and lists. More...
 
class  List
 Unnamed-item container [ … ]. More...
 
class  Value
 Named or unnamed typed value. More...
 

Concepts

concept  AllowedValueType
 Value types allowed in Item::Value<T>.
 

Enumerations

enum class  Type : char {
  Bool , Comment , Container , Double ,
  Integer , String , Binary
}
 Represents the type of a configuration item. More...
 

Functions

bool STORMBYTE_CONFIG_PUBLIC IsNameValid (const std::string &) noexcept
 
constexpr STORMBYTE_CONFIG_PUBLIC std::string TypeToString (const CommentType &t) noexcept
 Converts a CommentType to a human-readable string.
 
constexpr STORMBYTE_CONFIG_PUBLIC std::string TypeToString (const ContainerType &t) noexcept
 Converts a ContainerType to a string.
 
constexpr STORMBYTE_CONFIG_PUBLIC ContainerType TypeFromStartCharacter (const char &start)
 Resolves a container type from its opening character.
 
 Value (const char *) -> Value< std::string >
 
 Value (const char *, const char *) -> Value< std::string >
 

Variables

enum STORMBYTE_CONFIG_PUBLIC CommentType
 # until end of line
 
enum STORMBYTE_CONFIG_PUBLIC SingleLineC = 5
 // until end of line
 
enum STORMBYTE_CONFIG_PUBLIC MultiLineC
 /**&zwj;/
 
enum STORMBYTE_CONFIG_PUBLIC ContainerType
 Group of named items.
 
enum STORMBYTE_CONFIG_PUBLIC List
 < List of unnamed items
 

Detailed Description

Configuration items (values, comments, groups, lists).

Enumeration Type Documentation

◆ Type

enum class StormByte::Config::Item::Type : char
strong

Represents the type of a configuration item.

Enumerator
Bool 

Boolean item.

Comment 

Comment item.

Container 

Container item.

Double 

Double-precision floating-point item.

Integer 

Integer item.

String 

String item.

Binary 

Binary data (std::vector<std::byte>; text form is Base64 b"...")

Function Documentation

◆ TypeFromStartCharacter()

constexpr STORMBYTE_CONFIG_PUBLIC ContainerType StormByte::Config::Item::TypeFromStartCharacter ( const char &  start)
constexpr

Resolves a container type from its opening character.

Parameters
start{ or [.
Returns
Container type.
Exceptions
Exceptionif the character is not a container opener.

◆ TypeToString() [1/2]

constexpr STORMBYTE_CONFIG_PUBLIC std::string StormByte::Config::Item::TypeToString ( const CommentType t)
constexprnoexcept

Converts a CommentType to a human-readable string.

Parameters
tComment type to convert.
Returns
String representation.

◆ TypeToString() [2/2]

constexpr STORMBYTE_CONFIG_PUBLIC std::string StormByte::Config::Item::TypeToString ( const ContainerType t)
constexprnoexcept

Converts a ContainerType to a string.

Parameters
tContainer type to convert.
Returns
String representation.

Variable Documentation

◆ MultiLineC

enum STORMBYTE_CONFIG_PUBLIC StormByte::Config::Item::MultiLineC
Initial value:
= 8
}

/**&zwj;/