class StringReference
Defined at line 39 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h
StringReference is deprecated. There is no benefit to using it. Prefer `std::string_view`
or types convertible to `std::string_view`.
Public Methods
void StringReference (StringReference && )
Defined at line 41 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h
void StringReference (const StringReference & )
Defined at line 42 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h
std::string_view operator basic_string_view ()
Rational for implicit conversion: StringReference is basically a wrapper around
a string_view along with a reference id. The reference ID is no longer needed due
to internal management of string references in State. This is added at the same time
as internal string reference management, so the underlying data is no longer needed or
useful. However because this is in the SDK the class cannot be deleted yet. Given that
a deprecation warning is added (which should prevent weird uses of StringReference in place
of std::string_view), and that this significantly simplifies code, the implicit conversion
seems justified.
Defined at line 52 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h
void StringReference (const char * data)
Create a new `StringReference` for the given value.
StringReference treats the data as borrowed; the caller is responsible for lifetime
management. `data` must live as long as the StringReference. `data` must be null
terminated.
Defined at line 299 of file ../../zircon/system/ulib/inspect/vmo/types.cc
std::string_view Data ()
Access the data referenced by `this`.
Defined at line 302 of file ../../zircon/system/ulib/inspect/vmo/types.cc
uint64_t ID ()
Access the state ID of the StringReference.
Defined at line 304 of file ../../zircon/system/ulib/inspect/vmo/types.cc