Struct INodeInfo#
Defined in File toml.h
Inheritance Relationships#
Derived Type#
public toml_parser::CNode(Class CNode)
Struct Documentation#
-
struct INodeInfo#
Node information interface.
Subclassed by toml_parser::CNode
Public Types
-
enum class ECommentType : int32_t#
Node comment type.
Values:
-
enumerator comment_before#
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_behind#
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator out_of_scope_comment_before#
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind#
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator comment_before
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_before
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_before
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_behind
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator comment_behind
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator comment_behind
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator out_of_scope_comment_before
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_before
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_before
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator comment_before#
-
enum ECommentType
Node comment type.
Values:
-
enumerator comment_before
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_behind
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator out_of_scope_comment_before
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator comment_before
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_before
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_before
The comment before the node. This will insert a newline and the comment text preceded by the ‘#’ character.
-
enumerator comment_behind
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator comment_behind
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator comment_behind
The comment behind the node. This will align the comment to te next tab stop and precedes the comment with the ‘#’ character.
-
enumerator out_of_scope_comment_before
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_before
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_before
An independent comment before the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator out_of_scope_comment_behind
An independent comment behind the node. This comment is not part of the node and is separated by an extra newline.
-
enumerator comment_before
Public Functions
-
virtual sdv::u8string GetName() const = 0#
Get the node name (no conversion to a literal or quoted key is made).
- Returns:
String containing the name of the node.
-
virtual sdv::u8string GetPath(bool bResolveArrays) const = 0#
Get the node path following the key rules for bar, literal and quoted keys.
- Parameters:
bResolveArrays – [in] When set, include array indices in the path. The path returned without array indices is identical to the code in the TOML file. The path returned with array indices is identical to the direct access of nodes within the parser.
- Returns:
String containing the path of the node.
-
virtual sdv::any_t GetValue() const = 0#
The node value.
- Returns:
For boolean, integer, floating point and strings, the function returns a value. Otherwise the function returns empty.
-
virtual uint32_t GetIndex() const = 0#
Get the index of this node within the parent collection.
- Returns:
The index of the node within the parent collection node or npos when no parent is available.
-
virtual IInterfaceAccess *GetParent() const = 0#
Get the parent collection node.
- Returns:
Returns the parent collection node or NULL when there is no parent collection node.
-
virtual sdv::u8string GetTOML() const = 0#
Return the TOML string belonging to this node including all potential child nodes and comments.
- Returns:
The TOML string.
-
virtual void SetComment(ECommentType eType, const sdv::u8string &ssComment) = 0#
Set or replace a comment for the node.
Set the comment text for the node. If a comment is provided as text (normal behavior), the comment text will be formatted automatically when generating the TOML text. If the comment text should not contain the comment character ‘#’ before the comment text. Comments inserted before the node will be inserted on the line before the node unless the comment is provided in raw format and is ended with a line-break and optionally whitespace. Comment inserted behind the node will be inserted on the same line as the node. Comments provided as text is automatically wrapped to 132 characters if possible. Line-breaks in the text will cause a new comment line to start.
- Parameters:
eType – [in] The comment type to set the comment text for.
ssComment – [in] String containing the comment text to set.
-
virtual sdv::u8string GetComment(ECommentType eType) = 0#
Get the current comment for the node.
- Parameters:
eType – [in] The comment type to get the comment text of.
- Returns:
String with the comment text or an empty string if no comment is available.
-
virtual void AutomaticFormat() = 0#
Format the node automatically. This will remove the whitespace between the elements within the node. Comments will not be changed.
-
virtual bool IsInline() const = 0#
Is the node inline?
- Returns:
Returns whether the node is defined as inline node.
-
virtual bool IsStandard() const = 0#
Is the node defined as standard node?
- Returns:
Returns whether the node is defined as standard node.
-
u8string GetName() const
Get the node name (no conversion to a literal or quoted key is made).
- Returns:
String containing the name of the node.
- u8string GetPath (in boolean bResolveArrays) const
Get the node path following the key rules for bar, literal and quoted keys.
- Parameters:
bResolveArrays – [in] When set, include array indices in the path. The path returned without array indices is identical to the code in the TOML file. The path returned with array indices is identical to the direct access of nodes within the parser.
- Returns:
String containing the path of the node.
-
ENodeType GetType() const
Get the node type.
- Returns:
Type of the node.
-
any GetValue() const
The node value.
- Returns:
For boolean, integer, floating point and strings, the function returns a value. Otherwise the function returns empty.
-
uint32 GetIndex() const
Get the index of this node within the parent collection.
- Returns:
The index of the node within the parent collection node or npos when no parent is available.
-
IInterfaceAccess GetParent() const
Get the parent collection node.
- Returns:
Returns the parent collection node or NULL when there is no parent collection node.
-
u8string GetTOML() const
Return the TOML string belonging to this node including all potential child nodes and comments.
- Returns:
The TOML string.
- void SetComment (in ECommentType eType, in u8string ssComment)
Set or replace a comment for the node.
Set the comment text for the node. If a comment is provided as text (normal behavior), the comment text will be formatted automatically when generating the TOML text. If the comment text should not contain the comment character ‘#’ before the comment text. Comments inserted before the node will be inserted on the line before the node unless the comment is provided in raw format and is ended with a line-break and optionally whitespace. Comment inserted behind the node will be inserted on the same line as the node. Comments provided as text is automatically wrapped to 132 characters if possible. Line-breaks in the text will cause a new comment line to start.
- Parameters:
eType – [in] The comment type to set the comment text for.
ssComment – [in] String containing the comment text to set.
- u8string GetComment (in ECommentType eType)
Get the current comment for the node.
- Parameters:
eType – [in] The comment type to get the comment text of.
- Returns:
String with the comment text or an empty string if no comment is available.
-
void AutomaticFormat()
Format the node automatically. This will remove the whitespace between the elements within the node. Comments will not be changed.
-
boolean IsInline() const
Is the node inline?
- Returns:
Returns whether the node is defined as inline node.
-
boolean IsStandard() const
Is the node defined as standard node?
- Returns:
Returns whether the node is defined as standard node.
Public Static Attributes
-
static constexpr ::sdv::interface_id _id = 0xED30713D1895D2EE#
Interface ID.
-
enum class ECommentType : int32_t#