[#BloombergLP-bdld-Datum-createStringRef-04e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdld.adoc[bdld]::xref:BloombergLP/bdld/Datum.adoc[Datum]::createStringRef
:relfileprefix: ../../../
:mrdocs:

`createStringRef` overloads

== Synopses

Declared in `&lt;bdld&lowbar;datum&period;h&gt;`

Return, by value, a datum having the specified `StringRef` `value`, using the specified `allocator` to supply memory (if needed)&period; The behavior is undefined unless `value&period;length() &lt;&equals; UINT&lowbar;MAX`&period; Note that `string` is not copied, and is not freed if `Datum&colon;&colon;destroy` is called on the returned object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdld/Datum.adoc[Datum]
xref:BloombergLP/bdld/Datum/createStringRef-04b.adoc[createStringRef](
    xref:BloombergLP/bslstl/StringRef.adoc[bslstl::StringRef] const& value,
    xref:BloombergLP/bdld/Datum/AllocatorType.adoc[AllocatorType] const& allocator);
----

[.small]#xref:BloombergLP/bdld/Datum/createStringRef-04b.adoc[_» more&period;&period;&period;_]#

Return, by value, a datum that refers to the specified `string`, using the specified `allocator` to supply memory (if needed)&period; The behavior is undefined unless `string` points to a UTF&hyphen;8 encoded c&hyphen;string&period; The behavior is also undefined unless &apos;strlen(string) &lt;&equals; UINT&lowbar;MAX&apos;&period; Note that `string` is not copied, and is not freed if `Datum&colon;&colon;destroy` is called on the returned object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdld/Datum.adoc[Datum]
xref:BloombergLP/bdld/Datum/createStringRef-01.adoc[createStringRef](
    char const* string,
    xref:BloombergLP/bdld/Datum/AllocatorType.adoc[AllocatorType] const& allocator);
----

[.small]#xref:BloombergLP/bdld/Datum/createStringRef-01.adoc[_» more&period;&period;&period;_]#

Return, by value, a datum that refers to the specified `string` having the specified `length`, using the specified `allocator` to supply memory (if needed)&period; The behavior is undefined unless `0 !&equals; string &verbar;&verbar; 0 &equals;&equals; length`&period; The behavior is also undefined unless `length &lt;&equals; UINT&lowbar;MAX`&period; Note that `string` is not copied, and is not freed if `Datum&colon;&colon;destroy` is called on the returned object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdld/Datum.adoc[Datum]
xref:BloombergLP/bdld/Datum/createStringRef-0e.adoc[createStringRef](
    char const* string,
    xref:BloombergLP/bdld/Datum/SizeType.adoc[SizeType] length,
    xref:BloombergLP/bdld/Datum/AllocatorType.adoc[AllocatorType] const& allocator);
----

[.small]#xref:BloombergLP/bdld/Datum/createStringRef-0e.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
