BloombergLP::bdld::Datum::createUninitializedString

Create an uninitialized string buffer and load a datum referring to it.

Synopsis

Declared in <bdld_datum.h>

static
char*
createUninitializedString(
    Datum* result,
    SizeType length,
    AllocatorType const& allocator);

Description

Load the specified result with a reference to a newly created character buffer of the specified length, using the specified allocator to supply memory, and return the address of this buffer. The behavior is undefined unless length <= UINT_MAX. Note that the caller is responsible for initializing the returned buffer with a UTF-8 encoded string.

Return Value

the address of the uninitialized character buffer

Parameters

NameDescription
resultreceives the datum that refers to the buffer
lengthlength of the character buffer in bytes
allocatormemory allocator to use