tagion_document_get_time

Get time from a document element

extern (C)
int
tagion_document_get_time
(,
int64_t* time
)

Parameters

element Document.Element*

element to get

time int64_t*

pointer to the returned time

Return Value

Type: int

ErrorCode

Examples

auto h = new HiBON;
string key_time = "time";
import tagion.utils.StdTime;
auto insert_time = sdt_t(12_345);
h[key_time] = insert_time;
const doc = Document(h);

Document.Element elm_time;
int rt = tagion_document_element_by_key(&doc.data[0], doc.data.length, &key_time[0], key_time.length, &elm_time);
assert(rt == ErrorCode.none, "Get document element time returned error");

long value;
rt = tagion_document_get_time(&elm_time, &value);
assert(rt == ErrorCode.none, "get time returned error");

assert(value == cast(long) insert_time, "did not read time");