Struct INodeInfo#

Inheritance Relationships#

Derived Type#

Struct Documentation#

struct INodeInfo#

Node information interface.

Subclassed by toml_parser::CNode

Public Types

enum class ECommentFlags : int32_t#

Comment access flags.

The comment access flags contain the comment code snippet index (0..15) as well as flags to receive the comments in interpreted or raw form. For comment code snippets are defined for all nodes, the comments before and after the node not related to the node and the comments before and after the node related to the node. Comment or whitespace in between the node tokens are part of the other 11 indices (each node interprets this differently).

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_index_mask#

Comment type mask to be used ot filter the comment type.

enumerator raw_comment#

Store the comment exactly as provided (whitespace and comments).

enumerator replace_whitespace#

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

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_index_mask

Comment type mask to be used ot filter the comment type.

enumerator comment_index_mask

Comment type mask to be used ot filter the comment type.

enumerator comment_index_mask

Comment type mask to be used ot filter the comment type.

enumerator raw_comment

Store the comment exactly as provided (whitespace and comments).

enumerator raw_comment

Store the comment exactly as provided (whitespace and comments).

enumerator raw_comment

Store the comment exactly as provided (whitespace and comments).

enumerator replace_whitespace

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

enumerator replace_whitespace

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

enumerator replace_whitespace

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

enum ECommentFlags

Comment access flags.

The comment access flags contain the comment code snippet index (0..15) as well as flags to receive the comments in interpreted or raw form. For comment code snippets are defined for all nodes, the comments before and after the node not related to the node and the comments before and after the node related to the node. Comment or whitespace in between the node tokens are part of the other 11 indices (each node interprets this differently).

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_index_mask

Comment type mask to be used ot filter the comment type.

enumerator raw_comment

Store the comment exactly as provided (whitespace and comments).

enumerator replace_whitespace

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

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_index_mask

Comment type mask to be used ot filter the comment type.

enumerator comment_index_mask

Comment type mask to be used ot filter the comment type.

enumerator comment_index_mask

Comment type mask to be used ot filter the comment type.

enumerator raw_comment

Store the comment exactly as provided (whitespace and comments).

enumerator raw_comment

Store the comment exactly as provided (whitespace and comments).

enumerator raw_comment

Store the comment exactly as provided (whitespace and comments).

enumerator replace_whitespace

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

enumerator replace_whitespace

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

enumerator replace_whitespace

When set, the comment will replace the current whitespace as well. Used with SetComment function. Automatically enabled for raw comments.

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 ENodeType GetType() const = 0#

Get the node type.

Returns:

Type 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(const sdv::u8string &ssComment, uint32_t uiFlags) = 0#

Set or replace a comment for the node.

Remark

This function can also be used to insert whitespace (with or without comments) when used in raw mode. Set the comment text for the node. If a comment is proided as text (normal behavior), the comment text will be formatted automatically when generating the TOML text. If the comment is provided as raw comment, the text should contain all whitespace and the comment ‘#’ character before the comment text. Comments inserted before the enode will be inserted on the line before the node uness the comment is provided in raw format and is ended with a newline 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 80 characters if possible. Newlines in the text will cause a new comment line to start.

Parameters:
  • ssComment[in] String containing the comment text or the raw comment string to set.

  • uiFlags[in] One or more ECommentFlags flags influencing the behavior of the comment.

virtual sdv::u8string GetComment(uint32_t uiFlags) = 0#

Get the current comment for the node.

Remark

To receive the whitespace formatting the node, use this function in raw mode.

Parameters:

uiFlags[in] One or more ECommentFlags flags identifying the string format of the comment to return.

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.

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 u8string ssComment, in uint32 uiFlags)

Set or replace a comment for the node.

Remark

This function can also be used to insert whitespace (with or without comments) when used in raw mode. Set the comment text for the node. If a comment is proided as text (normal behavior), the comment text will be formatted automatically when generating the TOML text. If the comment is provided as raw comment, the text should contain all whitespace and the comment ‘#’ character before the comment text. Comments inserted before the enode will be inserted on the line before the node uness the comment is provided in raw format and is ended with a newline 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 80 characters if possible. Newlines in the text will cause a new comment line to start.

Parameters:
  • ssComment[in] String containing the comment text or the raw comment string to set.

  • uiFlags[in] One or more ECommentFlags flags influencing the behavior of the comment.

u8string GetComment (in uint32 uiFlags)

Get the current comment for the node.

Remark

To receive the whitespace formatting the node, use this function in raw mode.

Parameters:

uiFlags[in] One or more ECommentFlags flags identifying the string format of the comment to return.

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.

Public Static Attributes

static constexpr ::sdv::interface_id _id = 0x74CE8D0D93E7F270#

Interface ID.