INI#
A simple INI parser and emitter.
Info
To use declarations from this page, include the <essence/ini.hpp> header.
-
class ini::exception : public std::exception#
Exception type for INI parsing.
-
class ini::field#
Represents a single key-value pair.
-
std::string key#
The key part of the key-value pair.
-
std::string value#
The value part of the key-value pair.
-
field::field(std::pair<std::string, std::string>)#
Alternative constructor, accepting a
std::pairof strings.
-
std::string field::string() const#
Get a string representation of the field.
-
std::string field::pretty() const#
Get a colorized string representation of the field.
- template<typename T> requires anyof<T, i64, f64, bool, null>
-
std::optional<T> as()#
Attempt to parse the field’s value as
T.
-
std::string key#
-
class ini::section : public std::vector<ini::field>#
Represents a named list of key-value pairs.
-
std::string name#
The section’s name.
-
std::string string() const#
Get a string representation of the section.
-
std::string pretty() const#
Get a colorized string representation of the section.
-
std::string name#
-
class ini::document : public std::vector<ini::section>#
Represents the entirety of an INI file.
-
ini::section top = ini::section("__TOP_LEVEL__")#
The outer, pseudo-unnamed section of the INI file.
-
std::string string() const#
Get a string representation of the document.
-
std::string pretty() const#
Get a colorized string representation of the document.
-
ini::section top = ini::section("__TOP_LEVEL__")#
-
class ini::parser#
A proxy object for parsing an input file.