← API Reference Class

asge::config::toml::_internal::Table

#include <TOML_Parser.hpp>

Inherits from std::enable_shared_from_this< Table >.

Inheritance

classDiagram
    class N1["asge::config::toml::_internal::Table"]
    class N2["std::enable_shared_from_this"]
    N2 <|-- N1
    click N1 href "classasge_1_1config_1_1toml_1_1__internal_1_1Table.html"

Collaboration

classDiagram
    class N1["asge::config::toml::_internal::Table"]
    class N2["std::enable_shared_from_this"]
    N2 <|-- N1
    click N1 href "classasge_1_1config_1_1toml_1_1__internal_1_1Table.html"

Public Types

#using pointer = typename std::shared_ptr< Table >

Private Attributes

#std::string m_Nameprivate
#std::unordered_map< std::string, TOMLEntry > m_kvPairsprivate
#std::vector< pointer > m_SubTablesprivate
#std::weak_ptr< Table > m_ParentTableprivate
#TableType m_Typeprivate

Private Member Functions

#std::string GetAbsoluteName() const noexceptprivate
#void PrintTable(std::ostream &oss) const noexceptprivate
#Result< TOMLEntry * > FindEntry(std::string const &inPath) noexceptprivate

Resolves a dotted path to the TOMLEntry of an already-existing key, recursing into subtables exactly like Get<T>/GetTable do.

Shared by Set/SetTypedArray so the path-walking logic (and its error codes) lives in exactly one place.

Public Member Functions

#Table(std::string const &inName, TableType inType)
#Table(TableType inType)
#Table(Table const &)=delete
#Table & operator=(Table const &)=delete
#Table(Table &&)=default
#Table & operator=(Table &&)=default
#~Table()=default
#BoolResult AddKvPair(std::string const &inKey, TOMLEntry inEntry) noexcept
#void AddSubTable(pointer inChild) noexcept
#void SetParent(std::weak_ptr< Table > inParent) noexcept
#std::vector< pointer > const & GetSubTables() const noexcept
#std::string const & GetName() const noexcept
#Result< pointer > GetTable(std::string const &inPath) const noexcept
#template<typename RetType> Result< RetType const * > Get(std::string const &inPath) const
#template<typename T> VectorResult< T > GetTypedArray(std::string const &inPath) const
#template<typename T> BoolResult Set(std::string const &inPath, T inValue) noexcept

Overwrites the value of an already-existing key, preserving its original TOMLTypeInfo (string subtype, numeric kind, ...).

Does not create missing keys or tables.

#template<typename T> BoolResult SetTypedArray(std::string const &inPath, std::vector< T > const &inValues) noexcept

Overwrites an already-existing array-valued key with new elements, reusing the array's existing per-element TOMLTypeInfo (or a sensible default if the existing array was empty).

#template<typename T> BoolResult SetOrCreate(std::string const &inKey, T inValue) noexcept

Like Set(), but creates the key with a default TOMLTypeInfo if it doesn't exist yet, instead of failing.

Only vivifies the leaf key, not missing intermediate tables (a dotted inKey into a missing subtable still errors) — pair with FindOrCreateTable for that, as TOMLBuilder does.

#template<typename T> BoolResult SetOrCreateTypedArray(std::string const &inKey, std::vector< T > const &inValues) noexcept

Like SetTypedArray(), but creates the key if it doesn't exist yet.

Seeds an empty array entry with the right per-element shape and delegates the actual fill (nested-array recursion included) to SetTypedArray, so that logic lives in one place.

Friends

#friend operator<<