Document.Element

HiBON Element representation

Constructors

this
this(immutable(ubyte[]) data)

Construct an Element based on buffer @param data - buffer

Members

Functions

opEquals
bool opEquals(Element other)

Compare two elements

Properties

as
T as [@property setter]

Tries to convert the value to the type T. @return true if the function succeeds

by
auto by [@property getter]

@return the value as the HiBON type Type @throw if the element does not contain the type E and HiBONException is thrown

get
const(T) get [@property getter]

@return the value as the type T @throw if the element does not contain the type and HiBONException is thrown

index
uint index [@property getter]

@return the index of the key @throw if the key is not an index an HiBONException is thrown

isEod
bool isEod [@property getter]

@return true if the buffer block ends

isThat
bool isThat [@property getter]

* Check if the type match That template. * That template must have one parameter T as follows * @return true if the element is the type That

isType
bool isType [@property getter]

@return true if the element is of T

key
Text key [@property setter]

@return the key

keyLen
uint keyLen [@property getter]

@return the key length

keyPos
uint keyPos [@property getter]

Evaluates key position @return key position

size
size_t size [@property getter]

@return the size of the element in bytes

type
Type type [@property getter]

@return the Type of the element

valid
ErrorCode valid [@property getter]

* Check if the element is valid * @return the error code the element. ErrorCode.NONE means that the element is valid

value
const(Value) value [@property getter]

@return the HiBON Value of the element @throw if the type is invalid and HiBONException is thrown

valuePos
uint valuePos [@property getter]

@return the position of the value inside the element buffer