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`.

Functions

StringReference

public void StringReference(StringReference && )

Defined at line 41 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h

StringReference

public void StringReference(const StringReference & )

Defined at line 42 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h

operator basic_string_view

public basic_string_view operator basic_string_view()

Defined at line 52 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h

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.

StringReference

public void StringReference(const char * data)

Defined at line 299 of file ../../zircon/system/ulib/inspect/vmo/types.cc

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.

Data

public basic_string_view Data()

Defined at line 302 of file ../../zircon/system/ulib/inspect/vmo/types.cc

Access the data referenced by `this`.

ID

public uint64_t ID()

Defined at line 304 of file ../../zircon/system/ulib/inspect/vmo/types.cc

Access the state ID of the StringReference.