class InspectData
Defined at line 27 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
Container for inspect data returned by a component.
This class provides methods for parsing common fields from diagnostics output.
Public Methods
void InspectData (const InspectData & )
Movable but not copyable.
Defined at line 44 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
void InspectData (InspectData && )
Defined at line 45 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
InspectData & operator= (const InspectData & )
Defined at line 46 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
InspectData & operator= (InspectData && )
Defined at line 47 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
const std::string & moniker ()
Return the moniker of the component that created this data.
Defined at line 50 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
uint64_t version ()
Return the version of the component that created this data.
Defined at line 53 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
const InspectData::InspectMetadata & metadata ()
Return the metadata of the component that created this data.
Defined at line 56 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
std::optional<const inspect::Hierarchy *> payload ()
Return the payload of the component that created this data, if defined.
Defined at line 59 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
inspect::Hierarchy && TakePayload ()
Defined at line 83 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.h
void InspectData (rapidjson::Document document)
Create a new InspectData wrapper around a JSON document.
Defined at line 168 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.cc
const rapidjson::Value & content ()
Return the content of the diagnostics data as a JSON value.
Defined at line 220 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.cc
const rapidjson::Value & GetByPath (const std::vector<std::string> & path)
TODO(https://fxbug.dev/42158053): Switch users to use payload() and remove GetByPath()
Returns the value at the given path in the data contents.
Defined at line 230 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.cc
std::string PrettyJson ()
Returns the data formatted in json.
Defined at line 250 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.cc
void Sort ()
Sort properties and children of this node by name, and recursively sort each child.
This method imposes a canonical ordering on every child value in the hierarchy for purposes of
comparison and output. It does not optimize operations in any way.
The sorting rule for each of children and property values is as follows:
- If and only if all names match non-negative integral strings, sort numerically.
- Otherwise, sort lexicographically.
Defined at line 257 of file ../../sdk/lib/diagnostics/reader/cpp/inspect.cc