tagion_document_get_version

Return the version of the document

extern (C)
int
tagion_document_get_version
(
const uint8_t* buf
,
const size_t buf_len
,
uint32_t* ver
)

Parameters

buf uint8_t*

doc buf

buf_len size_t

doc len

ver uint32_t*

The returned version number

Return Value

Type: int

ErrorCode

Examples

auto h = new HiBON;
h["version_test"] = 2;
const doc = Document(h);

uint ver = 10; // set the version equal to something else since current ver is 0 
int rt = tagion_document_get_version(&doc.data[0], doc.data.length, &ver);
assert(rt == ErrorCode.none);
import tagion.hibon.HiBONBase : HIBON_VERSION;
assert(ver == HIBON_VERSION);