Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTRecord::GetFieldAsUTF16

Retrieves the field data as a Unicode UTF-16 string.

Declaration

void CTRecord::GetFieldAsUTF16(NINT FieldNumber, pWCHAR value, VRLEN size);

Description

CTRecord::GetFieldAsUTF16() retrieves the field data as a UNICODE UTF-16 string. If the underlying field type is not one of the UNICODE field types, the data is converted to UTF-16 strings. FieldNumber is the number of the field, value is a pointer to a wide (UTF-16) string buffer and size indicates the size in bytes of the string area.

Return

void

Example


void CheckData(CTRecord& hRecord, const CTString& str, NINT val)

{

WCHAR WStr[32];

TEXT s[64];

CTSIGNED t;

hRecord.GetFieldAsUTF16(0, WStr, sizeof(WStr));

ctdb_u16TOu8(WStr, s, sizeof(s));

if (strcmp(s, str) != 0)

printf("UNICODE field contents not the same written");

t = hRecord.GetFieldAsSigned(1);

if ((NINT)t != val)

printf("integer field contents not the same written");

}

See Also

SetFieldAsUTF16()

TOCIndex