src/tlv/builder

Types

Builder = ref object
  buf*: seq[byte]
The main builder object. To intialize, call initBuilder

Procs

proc addBool(builder: Builder; boolean: bool) {....raises: [], tags: [].}
Adds a 1 byte bool to the buffer
proc addChar(builder: Builder; value: char) {....raises: [], tags: [].}
Adds a char to the buffer
proc addInt32(builder: Builder; value: int32 = 0) {....raises: [], tags: [].}
Adds an int32 to the buffer
proc addString(builder: Builder; str: string) {....raises: [], tags: [].}
Adds an int32 (indicating the size of the string) and a string to the buffer
proc encodeString(builder: Builder): string {....raises: [], tags: [].}
Cast the buf to a string and return it
proc initBuilder(): Builder {....raises: [], tags: [].}
Initializes the builder