Class CParser#

Inheritance Relationships#

Base Types#

Class Documentation#

class CParser : public sdv::IInterfaceAccess, public sdv::toml::ITOMLParser#

Creates a tree structure from input of UTF-8 encoded TOML source data.

Unnamed Group

const CNodeCollection &Root() const#

Return the root node.

Returns:

Reference to the root node collection.

CNodeCollection &Root()#

Return the root node.

Returns:

Reference to the root node collection.

Public Functions

CParser() = default#

Default constructor.

CParser(const std::string &rssString)#

Construct a new Parser object.

Parameters:

rssString[in] UTF-8 encoded data of a TOML source

void Clear()#

Clears the current parse result.

Attention

This will render any pointer invalid!

virtual bool Process(const sdv::u8string &ssContent) override#

Process the configuration from the supplied content string. Overload of sdv::toml::ITOMLParser.

Parameters:

ssContent[in] Configuration string.

Returns:

Returns ‘true’ when the configuration could be read successfully, false when not.

CLexer &Lexer()#

Get the lexer containing the token list.

Returns:

A reference to the lexer containing the token list.

std::string GenerateTOML(const std::string &rssPrefixKey = std::string()) const#

Get the TOML text based on the content.

Parameters:

rssPrefixKey[in] When present, uses the prefix node into the TOML text generation. The string must follow the key rules for separation with bare, literal and quoted keys.

Returns:

The string containing the TOML text.