Skip to content

TKGenerator

Description

Internal class used by TOMLKit to generate TOML from a Dictionary.

Properties

Name Type Read-Only
CurrentLevel Integer
Indents(0) String
IsInArray Boolean
KeyStack() String
mIsInArrayCount Integer
OutputArr() String
StringEncoderMB MemoryBlock
USLocale Locale

Methods

Name Parameters Returns
AddKeyAndValue key As String, value As Variant, toArr() As String
Constructor
ConvertToString d As Dictionary String
ConvertToString arr() As Variant String
ConvertToString value As Variant String
EncodeArray value As Variant Variant()
EncodeDateTime dt As DateTime String
EncodeDictionary sourceDict As Dictionary Dictionary
EncodeDouble value As Double String
EncodeInteger value As Integer String
EncodeValue source As Variant Variant
Generate sourceDict As Dictionary String
IndentForCurrentLevel String
IsDictionaryArray value As Variant Boolean
ProcessTOMLDictionary tomlDict As Dictionary
SortKeyArray keyArr() As String, valueArr() As Variant
ToBasicString mbIn As MemoryBlock, isKey As Boolean String

Constants

Name Type
kComma String
kCommaAndSpace String
kCurlyBraceClose String
kCurlyBraceOpen String
kDot String
kEqualsWithSpaces String
kFalse String
kIndent String
kQuote String
kSpace String
kSquareBracketClose String
kSquareBracketCloseDoubleWithSpace String
kSquareBracketCloseWithSpace String
kSquareBracketOpen String
kSquareBracketOpenAndSpace String
kSquareBracketOpenDoubleAndSpace String
kTrue String
kUnderscore String

kComma As String The , character.


kCommaAndSpace As String The , character combination.


kCurlyBraceClose As String The } character.


kCurlyBraceOpen As String The { character.


kDot As String The . character.


kEqualsWithSpaces As String The = character combination.


kFalse As String The false string.


kIndent As String The indent character.


kQuote As String The " character.


kSpace As String The space character.


kSquareBracketClose As String The ] character.


kSquareBracketCloseDoubleWithSpace As String The ]] character combination.


kSquareBracketCloseWithSpace As String The ] character combination.


kSquareBracketOpen As String The [ character.


kSquareBracketOpenAndSpace As String The [ character combination.


kSquareBracketOpenDoubleAndSpace As String The [[ character combination.


kTrue As String The true string.


kUnderscore As String The _ character.


Property Descriptions

CurrentLevel As Integer

The current level.


Indents(0) As String

This property is shared.

Stores the indent for the current level.


IsInArray As Boolean

True if the generator is currently within an array.


KeyStack() As String

The key stack.


mIsInArrayCount As Integer

Internal use.


OutputArr() As String

Holds the string being built.


StringEncoderMB As MemoryBlock

A MemoryBlock used to encode strings.


USLocale As Locale

This property is shared.

The US locale.


Method Descriptions

AddKeyAndValue(key As String, value As Variant, toArr() As String) Internal use.


Constructor()

The default constructor.


ConvertToString(d As Dictionary) As String

Returns a string representation of d.


ConvertToString(arr() As Variant) As String

Returns a string representation of arr().


ConvertToString(value As Variant) As String

Returns a string representation of value.


EncodeArray(value As Variant) As Variant()

Internal use. Encodes an array.


EncodeDateTime(dt As DateTime) As String

Internal use. Encodes a DateTime.


EncodeDictionary(sourceDict As Dictionary) As Dictionary

Internal use. Encodes a Dictionary.


EncodeDouble(value As Double) As String

Internal use. Encodes a Double.


EncodeInteger(value As Integer) As String

Internal use. Encodes an Integer.


EncodeValue(source As Variant) As Variant

Internal use. Encodes a Variant value.


Generate(sourceDict As Dictionary) As String

Generates TOML from sourceDict.


IndentForCurrentLevel() As String

Returns the indent for the current level.


IsDictionaryArray(value As Variant) As Boolean

Internal use. Returns True if value is a Dictionary array.


ProcessTOMLDictionary(tomlDict As Dictionary)

Internal use. Processes a TOML dictionary.


SortKeyArray(keyArr() As String, valueArr() As Variant) This method is shared.

Internal delegate method for sorting an array.


ToBasicString(mbIn As MemoryBlock, isKey As Boolean) As String

Internal use. Returns mbln as a string.