[#BloombergLP-bslstl-StringRefData-04] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::StringRefData :relfileprefix: ../../ :mrdocs: This class is an intermediate link between `bslstl::StringRef` used in BDE and `bsl::string_view` and is kept only for compatibility with legacy code. == Synopsis Declared in `<bslstl_stringrefdata.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class CHAR_TYPE> class StringRefData : public bsl::basic_string_view<CHAR_TYPE> ---- == Base Classes [cols="1,4"] |=== | Name| Description | `bsl::basic_string_view<CHAR_TYPE>` | A non‐owning reference to a string. |=== == Type Aliases [cols="1"] |=== | Name | xref:BloombergLP/bslstl/StringRefData-04/size_type.adoc[`size_type`] |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/StringRefData-04/2constructor-02.adoc[`StringRefData`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslstl/StringRefData-04/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<StringRefData, is_trivially_copyable>`] | Declare `StringRefData` as trivially copyable. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/StringRefData-04/cStringLength.adoc[`cStringLength`] | Return the number of `CHAR_TYPE` characters in the specified null‐terminated `data` string, up to but not including the terminal null value. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/StringRefImp-02.adoc[`StringRefImp<char>`] | | xref:BloombergLP/bslstl/StringRefImp-0a.adoc[`StringRefImp<wchar_t>`] | | xref:BloombergLP/bslstl/StringRefImp-0c.adoc[`StringRefImp`] | This class provides a reference‐semantic‐like (see below) mechanism that allows `const` `std::string` values, which are represented externally as either an `std::string` or null‐terminated c‐style string (or parts thereof), to be treated both uniformly and efficiently when passed as an argument to a function in which the string's length will be needed. The interface of this class provides a subset of accessor methods found on `std::string` (but none of the manipulators) ‐‐ all of which apply to the referenced string. But, because only non‐modifiable access is afforded to the referenced string value, each of the manipulators on this type ‐‐ assignment in particular ‐‐ apply to this string‐reference object itself (as if it had pointer semantics). Hence, this class has a hybrid of reference‐ and pointer‐semantics. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#