createStringRef overloads

Synopses

Declared in <bdld_datum.h>

Return, by value, a datum having the specified StringRef value, using the specified allocator to supply memory (if needed). The behavior is undefined unless value.length() <= UINT_MAX. Note that string is not copied, and is not freed if Datum::destroy is called on the returned object.

static
Datum
createStringRef(
    bslstl::StringRef const& value,
    AllocatorType const& allocator);

Return, by value, a datum that refers to the specified string, using the specified allocator to supply memory (if needed). The behavior is undefined unless string points to a UTF‐8 encoded c‐string. The behavior is also undefined unless 'strlen(string) <= UINT_MAX'. Note that string is not copied, and is not freed if Datum::destroy is called on the returned object.

static
Datum
createStringRef(
    char const* string,
    AllocatorType const& allocator);

Return, by value, a datum that refers to the specified string having the specified length, using the specified allocator to supply memory (if needed). The behavior is undefined unless 0 != string || 0 == length. The behavior is also undefined unless length <= UINT_MAX. Note that string is not copied, and is not freed if Datum::destroy is called on the returned object.

static
Datum
createStringRef(
    char const* string,
    SizeType length,
    AllocatorType const& allocator);

Created with MrDocs