22#include <StormByte/config/exception.hxx>
23#include <StormByte/config/visibility.h>
54 static constexpr std::string TypeToString(
const Type& t)
noexcept {
63 default:
return "Unknown";
82 constexpr STORMBYTE_CONFIG_PUBLIC std::string TypeToString(
const CommentType& t)
noexcept {
84 case CommentType::SingleLineBash:
return "Bash like single line comment";
85 case CommentType::SingleLineC:
return "C++ like single line comment";
86 case CommentType::MultiLineC:
return "C/C++ like multi line comment";
87 default:
return "Unknown";
105 constexpr STORMBYTE_CONFIG_PUBLIC std::string TypeToString(
const ContainerType& t)
noexcept {
107 case ContainerType::Group:
return "Group";
108 case ContainerType::List:
return "List";
109 default:
return "Unknown";
121 case '{':
return ContainerType::Group;
122 case '[':
return ContainerType::List;
123 default:
throw Exception(
"Unknown start character " + std::string(1, start) +
" for container");
132 std::is_same_v<T, int> ||
133 std::is_same_v<T, double> ||
134 std::is_same_v<T, bool> ||
135 std::is_same_v<T, std::string> ||
136 std::is_same_v<T, std::vector<std::byte>>;
Base class for all configuration-related exceptions.
Definition exception.hxx:33
Holds child items. Group and List derive from this.
Definition container.hxx:38
Named container { … } that can hold items, subgroups and lists.
Definition group.hxx:38
Unnamed-item container [ … ].
Definition list.hxx:38
Value types allowed in Item::Value<T>.
Definition type.hxx:131
Configuration items (values, comments, groups, lists).
Definition alias.hxx:30
enum STORMBYTE_CONFIG_PUBLIC MultiLineC
/* … *‍/
Definition type.hxx:74
enum STORMBYTE_CONFIG_PUBLIC ContainerType
Group of named items.
Definition type.hxx:95
enum STORMBYTE_CONFIG_PUBLIC CommentType
# until end of line
Definition type.hxx:71
Type
Represents the type of a configuration item.
Definition type.hxx:39
@ Container
Container item.
@ Binary
Binary data (std::vector<std::byte>; text form is Base64 b"...")
@ Double
Double-precision floating-point item.
constexpr STORMBYTE_CONFIG_PUBLIC ContainerType TypeFromStartCharacter(const char &start)
Resolves a container type from its opening character.
Definition type.hxx:119
enum STORMBYTE_CONFIG_PUBLIC SingleLineC
// until end of line
Definition type.hxx:73