KeyValues Class

This class has no description.

Methods 36

Name Description
KeyValues

Creates a new KeyValues structure. The Handle must be closed with CloseHandle() or delete.

ExportToFile

Exports a KeyValues tree to a file. The tree is dumped from the current position.

ImportFromFile

Imports a file in KeyValues format. The file is read into the current position of the tree.

ImportFromString

Converts a given string to a KeyValues tree. The string is read into the current postion of the tree.

Import

Imports subkeys in the given KeyValues, at the current position in that KeyValues, into the current position in this KeyValues. Note that this copies keys; it does not embed a reference to them.

SetString

Sets a string value of a KeyValues key.

SetNum

Sets an integer value of a KeyValues key.

SetUInt64

Sets a large integer value of a KeyValues key.

SetFloat

Sets a floating point value of a KeyValues key.

SetColor

Sets a set of color values of a KeyValues key.

SetColor4

Sets a set of color values of a KeyValues key.

SetVector

Sets a vector value of a KeyValues key.

GetString

Retrieves a string value from a KeyValues key.

GetNum

Retrieves an integer value from a KeyValues key.

GetFloat

Retrieves a floating point value from a KeyValues key.

GetColor

Retrieves a set of color values from a KeyValues key.

GetColor4

Retrieves a set of color values from a KeyValues key.

GetUInt64

Retrieves a large integer value from a KeyValues key.

GetVector

Retrieves a vector value from a KeyValues key.

JumpToKey

Sets the current position in the KeyValues tree to the given key.

JumpToKeySymbol

Sets the current position in the KeyValues tree to the given key.

GotoFirstSubKey

Sets the current position in the KeyValues tree to the first sub key. This native adds to the internal traversal stack.

GotoNextKey

Sets the current position in the KeyValues tree to the next sub key. This native does NOT add to the internal traversal stack, and thus GoBack() is not needed for each successive call to this function.

SavePosition

Saves the current position in the traversal stack onto the traversal stack. This can be useful if you wish to use KvGotoNextKey() and have the previous key saved for backwards traversal.

GoBack

Jumps back to the previous position. Returns false if there are no previous positions (i.e., at the root node). This should be called once for each successful Jump call, in order to return to the top node. This function pops one node off the internal traversal stack.

DeleteKey

Removes the given key from the current position.

DeleteThis

Removes the current sub-key and attempts to set the position to the sub-key after the removed one. If no such sub-key exists, the position will be the parent key in the traversal stack. Given the sub-key having position "N" in the traversal stack, the removal will always take place from position "N-1."

Rewind

Sets the position back to the top node, emptying the entire node traversal history. This can be used instead of looping KvGoBack() if recursive iteration is not important.

GetSectionName

Retrieves the current section name.

SetSectionName

Sets the current section name.

GetDataType

Returns the data type at a key.

SetEscapeSequences

Sets whether or not the KeyValues parser will read escape sequences. For example, \n would be read as a literal newline. This defaults to false for new KeyValues structures.

NodesInStack

Returns the position in the jump stack; I.e. the number of calls required for KvGoBack to return to the root node. If at the root node, 0 is returned.

FindKeyById

Finds a KeyValues name by id.

GetNameSymbol

Finds a KeyValues id inside a KeyValues tree.

GetSectionSymbol

Retrieves the current section id.