### Access and modify TOML nodes Source: https://nimparsers.github.io/parsetoml/index.html Procedures for getting or setting values in arrays and tables. ```Nim proc `[]`(node: TomlValueRef; index: int): TomlValueRef {.inline, ...raises: [], tags: [], forbids: [].} ``` ```Nim proc `[]`(node: TomlValueRef; name: string): TomlValueRef {.inline, ...raises: [KeyError], tags: [], forbids: [].} ``` ```Nim proc `[]=`(obj: TomlValueRef; key: string; val: TomlValueRef) {.inline, ...raises: [], tags: [], forbids: [].} ``` -------------------------------- ### Node Creation Source: https://nimparsers.github.io/parsetoml/index.html Procedures for creating new TomlValueRef instances of various types. ```APIDOC ## newTArray ### Description Creates a new TomlValueKind.Array TomlValueRef. ## newTBool ### Description Creates a new TomlValueKind.Bool TomlValueRef. ## newTInt ### Description Creates a new TomlValueKind.Int TomlValueRef. ## newTString ### Description Creates a new TomlValueKind.String TomlValueRef. ``` -------------------------------- ### Macros and Templates Source: https://nimparsers.github.io/parsetoml/index.html Macros and templates for simplifying TOML expression creation and retrieval. ```APIDOC ## ?*(x: untyped) ### Description Macro to convert an expression to a TomlValueRef directly without explicit '?' markers. ## parseToml(x: untyped) ### Description Macro to convert an expression to a TomlValueRef directly. ## ?(j: TomlValueRef) ### Description Template for TOML value reference handling. ## simpleGetOrDefault(node: TomlValueRef; key: string) ### Description Template to retrieve a value by key or return a default. ``` -------------------------------- ### TOML Templates Source: https://nimparsers.github.io/parsetoml/index.html Templates for wrapping TOML values and performing simple key lookups. ```nim template `?`(j: TomlValueRef): TomlValueRef ``` ```nim template simpleGetOrDefault{ `{}`(node, [key]) }(node: TomlValueRef; key: string): TomlValueRef ``` -------------------------------- ### Utility Procedures Source: https://nimparsers.github.io/parsetoml/index.html Utility procedures for copying, dumping, and checking key existence in TOML structures. ```APIDOC ## Utility Procedures ### copy(p: TomlValueRef): TomlValueRef Performs a deep copy of `a`. ### dump(table: TomlTableRef; indentLevel: int = 0) Dump out the entire table as it was parsed. This procedure is mostly useful for debugging purposes. ### existsKey(node: TomlValueRef; key: string): bool **Deprecated** Deprecated for `hasKey`. ``` -------------------------------- ### Debug and retrieve values Source: https://nimparsers.github.io/parsetoml/index.html Procedures for dumping tables and retrieving typed values with defaults. ```Nim proc dump(table: TomlTableRef; indentLevel: int = 0) {....raises: [], tags: [], forbids: [].} ``` ```Nim proc existsKey(node: TomlValueRef; key: string): bool {....deprecated, raises: [], tags: [], forbids: [].} ``` ```Nim proc getBiggestInt(n: TomlValueRef; default: int64 = 0): int64 {....raises: [], tags: [], forbids: [].} ``` ```Nim proc getBool(n: TomlValueRef; default: bool = false): bool {....raises: [], tags: [], forbids: [].} ``` -------------------------------- ### Construct TomlValueRef objects Source: https://nimparsers.github.io/parsetoml/index.html Generic constructors for creating various TOML data types from Nim types. ```Nim proc `?`(b: bool): TomlValueRef {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `?`(keyVals: openArray[tuple[key: string, val: TomlValueRef]]): TomlValueRef {. ...raises: [], tags: [], forbids: [].} ``` ```Nim proc `?`(n: float): TomlValueRef {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `?`(n: int64): TomlValueRef {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `?`(o: enum): TomlValueRef ``` ```Nim proc `?`(o: object): TomlValueRef ``` ```Nim proc `?`(o: ref object): TomlValueRef ``` ```Nim proc `?`(s: string): TomlValueRef {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `?`[T](elements: openArray[T]): TomlValueRef ``` -------------------------------- ### String Conversion Procedures Source: https://nimparsers.github.io/parsetoml/index.html Procedures for converting TOML date, date-time, time, and value types into their string representations. ```APIDOC ## TOML String Conversion Procedures ### `$`(val: TomlDate): string Converts the TOML date object into the ISO format read by the parser. ### `$`(val: TomlDateTime): string Converts the TOML date-time object into the ISO format read by the parser. ### `$`(val: TomlTime): string Converts the TOML time object into the ISO format read by the parser. ### `$`(val: TomlValue): string Turns whatever value into a type and value representation, used by `dump`. ### `$`(val: TomlValueRef): string Turns whatever value into a regular Nim value representation. ``` -------------------------------- ### Convert Expressions to TomlValueRef Source: https://nimparsers.github.io/parsetoml/index.html Macros to convert expressions directly to TomlValueRef without explicit '?' markers. ```nim macro `?*`(x: untyped): untyped ``` ```nim macro parseToml(x: untyped): untyped ``` -------------------------------- ### Manage TOML collections Source: https://nimparsers.github.io/parsetoml/index.html Procedures for adding, checking existence, copying, and deleting elements in TOML structures. ```Nim proc add(father, child: TomlValueRef) {....raises: [], tags: [], forbids: [].} ``` ```Nim proc add(obj: TomlValueRef; key: string; val: TomlValueRef) {....raises: [], tags: [], forbids: [].} ``` ```Nim proc contains(node: TomlValueRef; key: string): bool {....raises: [], tags: [], forbids: [].} ``` ```Nim proc contains(node: TomlValueRef; val: TomlValueRef): bool {. ...raises: [Exception, KeyError], tags: [RootEffect], forbids: [].} ``` ```Nim proc copy(p: TomlValueRef): TomlValueRef {....raises: [], tags: [], forbids: [].} ``` ```Nim proc delete(obj: TomlValueRef; key: string) {....raises: [], tags: [], forbids: [].} ``` -------------------------------- ### Set TOML Node Values Source: https://nimparsers.github.io/parsetoml/index.html Traverses the node and sets the value at the specified location, creating missing keys as needed. ```nim proc `{}=`(node: TomlValueRef; keys: varargs[string]; value: TomlValueRef) {. ...raises: [KeyError], tags: [], forbids: [].} ``` -------------------------------- ### TOML Value Construction Source: https://nimparsers.github.io/parsetoml/index.html Procedures for constructing `TomlValueRef` objects from various Nim types. ```APIDOC ## TOML Value Construction ### `?`(b: bool): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.Bool TomlValueRef`. ### `?`(keyVals: openArray[tuple[key: string, val: TomlValueRef]]): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.Table TomlValueRef`. ### `?`(n: float): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.Float TomlValueRef`. ### `?`(n: int64): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.Int TomlValueRef`. ### `?`(o: enum): TomlValueRef Construct a TomlValueRef that represents the specified enum value as a string. Creates a new `TomlValueKind.String TomlValueRef`. ### `?`(o: object): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.Table TomlValueRef`. ### `?`(o: ref object): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.Table TomlValueRef`. ### `?`(s: string): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.String TomlValueRef`. ### `?`[T](elements: openArray[T]): TomlValueRef Generic constructor for TOML data. Creates a new `TomlValueKind.Array TomlValueRef`. ``` -------------------------------- ### Conversion and Serialization Source: https://nimparsers.github.io/parsetoml/theindex.html Functions for converting TOML structures to other formats like JSON. ```APIDOC ## toJson ### Description Converts a TomlTableRef or TomlValueRef into a JsonNode. ### Parameters - **value** (TomlValueRef) - Required - The TOML value to convert. ``` -------------------------------- ### Serialize TOML Tables Source: https://nimparsers.github.io/parsetoml/index.html Converts TOML tables or values into TOML formatted strings for file output. ```nim proc toTomlString(value: TomlTableRef; parents = ""): string {. ...raises: [Exception], tags: [RootEffect], forbids: [].} ``` ```nim proc toTomlString(value: TomlValueRef): string {....raises: [Exception], tags: [RootEffect], forbids: [].} ``` -------------------------------- ### TOML Type Constructors Source: https://nimparsers.github.io/parsetoml/index.html Functions for creating new TOML values of various types. ```APIDOC ## TOML Type Constructors ### Description Provides functions to create new TOML values of different types. ### Methods #### `newTArray(): TomlValueRef` Creates a new empty TOML array. #### `newTBool(b: bool): TomlValueRef` Creates a new TOML boolean value. #### `newTFloat(n: float): TomlValueRef` Creates a new TOML float value. #### `newTInt(n: int64): TomlValueRef` Creates a new TOML integer value. #### `newTNull(): TomlValueRef` Creates a new TOML null value. #### `newTString(s: string): TomlValueRef` Creates a new TOML string value. #### `newTTable(): TomlValueRef` Creates a new empty TOML table. ### Parameters - **b** (bool) - The boolean value. - **n** (float or int64) - The numeric value. - **s** (string) - The string value. ### Returns - **TomlValueRef**: A reference to the newly created TOML value. ``` -------------------------------- ### TOML Conversion and Serialization Source: https://nimparsers.github.io/parsetoml/index.html Procedures for converting TOML structures to JSON nodes or TOML-formatted strings. ```APIDOC ## toJson(value: TomlValueRef) ### Description Converts a TOML table to a JSON node following the toml-test JSON encoding specification. ### Parameters - **value** (TomlValueRef) - Required - The TOML value to convert. ## toTomlString(value: TomlTableRef; parents = "") ### Description Converts a TOML table to a TOML formatted string for file output. ### Parameters - **value** (TomlTableRef) - Required - The TOML table to serialize. - **parents** (string) - Optional - Parent keys for the string representation. ## toTomlString(value: TomlValueRef) ### Description Converts a TOML value to a TOML formatted string. ``` -------------------------------- ### Value Retrieval and Manipulation Source: https://nimparsers.github.io/parsetoml/index.html Procedures for retrieving typed values from TomlValueRef nodes or checking for key existence. ```APIDOC ## getInt ### Description Retrieves the int value of a TomlValueKind.Int TomlValueRef. Returns default if n is not an Int or is nil. ## getStr ### Description Retrieves the string value of a TomlValueKind.String TomlValueRef. Returns default if n is not a String or is nil. ## hasKey ### Description Checks if a specific key exists in a TomlValueRef node. ### Parameters - **node** (TomlValueRef) - Required - The node to check. - **key** (string) - Required - The key to look for. ``` -------------------------------- ### Check equality for TomlValueRef Source: https://nimparsers.github.io/parsetoml/index.html Compares two nodes for equality. ```Nim func `==`(a, b: TomlValueRef): bool {....raises: [Exception, KeyError], tags: [RootEffect], forbids: [].} ``` -------------------------------- ### Convert TOML types to string Source: https://nimparsers.github.io/parsetoml/index.html Procedures to convert TOML date, time, and value objects into ISO format or string representations. ```Nim proc `$`(val: TomlDate): string {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `$`(val: TomlDateTime): string {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `$`(val: TomlTime): string {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `$`(val: TomlValue): string {....raises: [], tags: [], forbids: [].} ``` ```Nim proc `$`(val: TomlValueRef): string {....raises: [Exception], tags: [RootEffect], forbids: [].} ``` -------------------------------- ### TOML Value Comparison Source: https://nimparsers.github.io/parsetoml/index.html Procedure for checking the equality of two TOML value references. ```APIDOC ## TOML Value Comparison ### `==`(a, b: TomlValueRef): bool Check two nodes for equality. ``` -------------------------------- ### Value Retrieval Procedures Source: https://nimparsers.github.io/parsetoml/index.html Procedures for retrieving specific types of values from TOML nodes. ```APIDOC ## Value Retrieval Procedures ### getBiggestInt(n: TomlValueRef; default: int64 = 0): int64 Retrieves the int64 value of a `TomlValueKind.Int TomlValueRef`. Returns `default` if `n` is not a `TomlValueKind.Int`, or if `n` is nil. ### getBool(n: TomlValueRef; default: bool = false): bool Retrieves the boolean value of a `TomlValueKind.Bool TomlValueRef`. Returns `default` if `n` is not a `TomlValueKind.Bool`, or if `n` is nil. ``` -------------------------------- ### Traverse and Access TOML Nodes Source: https://nimparsers.github.io/parsetoml/index.html Retrieves values from a TOML node using a path of keys, returning nil if the path is invalid. ```nim proc `{}`(node: TomlValueRef; keys: varargs[string]): TomlValueRef {....raises: [], tags: [], forbids: [].} ``` -------------------------------- ### TOML Parsing Functions Source: https://nimparsers.github.io/parsetoml/index.html Functions for parsing TOML data from files, streams, or strings. ```APIDOC ## TOML Parsing Functions ### Description Provides functions to parse TOML content from various sources. ### Methods #### `parseFile(f: File, fileName: string = "")` Parses TOML from a given file. #### `parseFile(fileName: string)` Parses TOML from a file specified by its name. #### `parseStream(inputStream: streams.Stream, fileName: string = "")` Parses TOML from an input stream. #### `parseString(tomlStr: string, fileName: string = "")` Parses TOML from a string. ### Parameters #### `parseFile(f: File, fileName: string = "")` - **f** (File) - The file object to read from. - **fileName** (string) - Optional name of the file for error reporting. #### `parseFile(fileName: string)` - **fileName** (string) - The path to the TOML file. #### `parseStream(inputStream: streams.Stream, fileName: string = "")` - **inputStream** (streams.Stream) - The stream to read TOML data from. - **fileName** (string) - Optional name of the file for error reporting. #### `parseString(tomlStr: string, fileName: string = "")` - **tomlStr** (string) - The string containing TOML data. - **fileName** (string) - Optional name of the file for error reporting. ### Returns - **TomlValueRef** - A reference to the parsed TOML value. ``` -------------------------------- ### Convert TomlValueRef to TOML String Source: https://nimparsers.github.io/parsetoml/theindex.html Converts a generic TOML value reference to its string representation. ```APIDOC ## proc toTomlString(value: TomlValueRef): string ### Description Converts a generic TOML value reference (which could be a string, integer, boolean, etc.) to its TOML formatted string representation. ### Method N/A (Procedure Signature) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **string** - The TOML formatted string representation of the value. ``` -------------------------------- ### Operator Overloads Source: https://nimparsers.github.io/parsetoml/index.html Overloaded operators for convenient manipulation and comparison of TOML values. ```APIDOC ## Operator Overloads ### Description Provides overloaded operators for convenient manipulation and comparison of TOML values. ### Operators #### `$` (String Conversion) - `$(val: TomlDate): string` - `$(val: TomlDateTime): string` - `$(val: TomlTime): string` - `$(val: TomlValue): string` - `$(val: TomlValueRef): string` Converts various TOML types to their string representation. #### `==` (Equality Comparison) - `==(a, b: TomlValueRef): bool` Compares two `TomlValueRef` for equality. #### `?` (Conditional/Optional Access) - `?(b: bool): TomlValueRef` - `?(keyVals: openArray[tuple[key: string, val: TomlValueRef]]): TomlValueRef` - `?(n: float): TomlValueRef` - `?(n: int64): TomlValueRef` - `?(o: enum): TomlValueRef` - `?(o: object): TomlValueRef` - `?(o: ref object): TomlValueRef` - `?(s: string): TomlValueRef` - `?[T](elements: openArray[T]): TomlValueRef` Provides conditional or optional access/creation of `TomlValueRef` based on input type. #### `[]` (Array/Table Indexing) - `[](node: TomlValueRef; index: int): TomlValueRef` Accesses an element in a TOML array by index. - `[](node: TomlValueRef; name: string): TomlValueRef` Accesses a value in a TOML table by key. #### `[]=` (Array/Table Assignment) - `[]=(obj: TomlValueRef; key: string; val: TomlValueRef)` Assigns a value to a key in a TOML table. #### `{}` (Table Element Access) - `{}`(node: TomlValueRef; keys: varargs[string]): TomlValueRef Accesses nested values within a TOML table using multiple keys. #### `{}=` (Table Element Assignment) - `{}=`(node: TomlValueRef; keys: varargs[string]; value: TomlValueRef) Assigns a value to a nested key in a TOML table. ### Parameters - **val**, **a**, **b**, **node**, **obj** (TomlValueRef): The TOML value references involved in the operation. - **key** (string): The key for table access or assignment. - **index** (int): The index for array access. - **keys** (varargs[string]): Multiple keys for nested table access. - **value** (TomlValueRef): The value to assign. - **b** (bool): Boolean value for conditional access. - **n** (float or int64): Numeric value for conditional access. - **s** (string): String value for conditional access. - **keyVals**: Key-value pairs for conditional table creation. - **elements**: Elements for creating an array. - **o**: Enum, object, or ref object for conditional access. ### Returns - **string**: String representation of the TOML value. - **bool**: Result of equality comparison. - **TomlValueRef**: The accessed or created TOML value. - **void**: For assignment operations. ``` -------------------------------- ### TOML Serialization Source: https://nimparsers.github.io/parsetoml/index.html Functions for converting TOML data structures back into string or JSON formats. ```APIDOC ## TOML Serialization ### Description Provides functions to serialize TOML data structures into different formats. ### Methods #### `toJson(table: TomlTableRef): JsonNode` Converts a TOML table to a `JsonNode`. #### `toJson(value: TomlValueRef): JsonNode` Converts a TOML value to a `JsonNode`. #### `toTomlString(table: TomlTableRef, parents = ""): string` Converts a TOML table to its TOML string representation. #### `toTomlString(value: TomlValueRef): string` Converts a TOML value to its TOML string representation. ### Parameters - **table** (TomlTableRef) - The TOML table to convert. - **value** (TomlValueRef) - The TOML value to convert. - **parents** (string) - Internal parameter for recursive calls. ### Returns - **JsonNode**: The JSON representation of the TOML data. - **string**: The TOML string representation of the data. ``` -------------------------------- ### TomlValueRef Manipulation Source: https://nimparsers.github.io/parsetoml/theindex.html Procedures for accessing, modifying, and querying TomlValueRef nodes. ```APIDOC ## [] (Access) ### Description Accesses a child node by index or key. ### Parameters - **node** (TomlValueRef) - Required - The parent node. - **index** (int) - Required - The index for array access. - **name** (string) - Required - The key for table access. ## []= (Assignment) ### Description Assigns a value to a key within a TomlValueRef object. ### Parameters - **obj** (TomlValueRef) - Required - The target object. - **key** (string) - Required - The key to set. - **val** (TomlValueRef) - Required - The value to assign. ``` -------------------------------- ### Convert TomlTableRef to TOML String Source: https://nimparsers.github.io/parsetoml/theindex.html Converts a TOML table reference to its string representation. ```APIDOC ## proc toTomlString(value: TomlTableRef; parents = "") ### Description Converts a TOML table reference to its string representation. Allows specifying parent keys for nested structures. ### Method N/A (Procedure Signature) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **string** - The TOML formatted string representation of the table. ``` -------------------------------- ### Node Traversal and Modification Source: https://nimparsers.github.io/parsetoml/index.html Operators for accessing and setting values within TOML nodes using key paths. ```APIDOC ## {}(node: TomlValueRef; keys: varargs[string]) ### Description Traverses the node and retrieves the value at the given key path. Returns nil if keys do not exist or intermediate structures are not objects. ## {}=(node: TomlValueRef; keys: varargs[string]; value: TomlValueRef) ### Description Traverses the node and sets the value at the given location. Missing keys are created automatically. ``` -------------------------------- ### Array and Table Access/Modification Source: https://nimparsers.github.io/parsetoml/index.html Procedures for accessing and modifying elements within TOML arrays and tables. ```APIDOC ## Array and Table Access/Modification ### `[]`(node: TomlValueRef; index: int): TomlValueRef Gets the node at `index` in an Array. Result is undefined if `index` is out of bounds, but as long as array bound checks are enabled it will result in an exception. ### `[]`(node: TomlValueRef; name: string): TomlValueRef Gets a field from a `TomlValueKind.Table`, which must not be nil. If the value at `name` does not exist, raises KeyError. ### `[]=`(obj: TomlValueRef; key: string; val: TomlValueRef) Sets a field from a `TomlValueKind.Table`. ### add(father, child: TomlValueRef) Adds `child` to a TomlValueKind.Array node `father`. ### add(obj: TomlValueRef; key: string; val: TomlValueRef) Sets a field from a `TomlValueKind.Table`. ### contains(node: TomlValueRef; key: string): bool Checks if `key` exists in `node`. ### contains(node: TomlValueRef; val: TomlValueRef): bool Checks if `val` exists in array `node`. ### delete(obj: TomlValueRef; key: string) Deletes `obj[key]`. ``` -------------------------------- ### TOML Value Manipulation Source: https://nimparsers.github.io/parsetoml/index.html Functions for modifying and querying TOML table structures. ```APIDOC ## TOML Value Manipulation ### Description Provides functions for manipulating and querying TOML table structures. ### Methods #### `add(father: TomlValueRef, child: TomlValueRef)` Adds a child node to a parent node. #### `add(obj: TomlValueRef, key: string, val: TomlValueRef)` Adds a key-value pair to a TOML table. #### `contains(node: TomlValueRef, key: string): bool` Checks if a TOML table contains a specific key. #### `contains(node: TomlValueRef, val: TomlValueRef): bool` Checks if a TOML array contains a specific value. #### `copy(p: TomlValueRef): TomlValueRef` Creates a deep copy of a TOML value reference. #### `delete(obj: TomlValueRef, key: string)` Deletes a key-value pair from a TOML table. #### `existsKey(node: TomlValueRef, key: string): bool` Checks if a TOML table has a specific key. #### `hasKey(node: TomlValueRef, key: string): bool` Alias for `existsKey`. #### `len(n: TomlValueRef): int` Returns the number of elements in a TOML array or the number of keys in a TOML table. #### `simpleGetOrDefault(node: TomlValueRef, key: string): TomlValueRef` Retrieves a value from a TOML table, returning a default if the key is not found. This is a simplified version of `getOrDefault`. ### Parameters - **father** (TomlValueRef) - The parent node. - **child** (TomlValueRef) - The child node to add. - **obj** (TomlValueRef) - The TOML table to modify. - **key** (string) - The key to add, check, or delete. - **val** (TomlValueRef) - The value to add. - **node** (TomlValueRef) - The TOML value reference to query. - **n** (TomlValueRef) - The TOML value reference. ### Returns - **bool**: `true` if the key/value exists, `false` otherwise. - **int**: The number of elements/keys. - **TomlValueRef**: The added/copied/retrieved value. ``` -------------------------------- ### Parsing TOML Data Source: https://nimparsers.github.io/parsetoml/theindex.html Functions used to parse TOML content from various sources into a TomlValueRef structure. ```APIDOC ## parseFile ### Description Parses a TOML file into a TomlValueRef. ### Parameters - **f** (File) - Required - The file handle to read from. - **fileName** (string) - Optional - The name of the file for error reporting. ## parseString ### Description Parses a TOML formatted string into a TomlValueRef. ### Parameters - **tomlStr** (string) - Required - The TOML string content. - **fileName** (string) - Optional - The name of the file for error reporting. ``` -------------------------------- ### TOML Value Accessors Source: https://nimparsers.github.io/parsetoml/index.html Functions to retrieve specific data types from a TomlValueRef, with optional default values. ```APIDOC ## TOML Value Accessors ### Description Provides methods to safely extract values of specific types from a `TomlValueRef`. ### Methods #### `getBiggestInt(n: TomlValueRef, default: int64 = 0): int64` Retrieves the value as the biggest possible integer type (`int64`). #### `getBool(n: TomlValueRef, default: bool = false): bool` Retrieves the value as a boolean. #### `getElems(n: TomlValueRef, default: seq[TomlValueRef] = @[]): seq[TomlValueRef]` Retrieves the value as a sequence of `TomlValueRef` (for TOML arrays). #### `getFloat(n: TomlValueRef, default: float = 0.0): float` Retrieves the value as a float. #### `getInt(n: TomlValueRef, default: int = 0): int` Retrieves the value as an integer. #### `getStr(n: TomlValueRef, default: string = ""): string` Retrieves the value as a string. #### `getTable(n: TomlValueRef, default = new(TomlTableRef)): TomlTableRef` Retrieves the value as a TOML table. ### Parameters - **n** (TomlValueRef) - The TOML value reference to extract data from. - **default** - The default value to return if the extraction fails or the type does not match. ``` -------------------------------- ### Convert TOML to JSON Source: https://nimparsers.github.io/parsetoml/index.html Converts a TOML table to a JSON node following the BurntSushi/toml-test specification. ```nim proc toJson(value: TomlValueRef): JsonNode {....raises: [Exception], tags: [RootEffect], forbids: [].} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.