MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / get

Method get

source/core/StarFormattedJson.cpp:106–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106FormattedJson FormattedJson::get(String const& key) const {
107 if (type() != Json::Type::Object)
108 throw JsonException::format("Cannot call get with key on FormattedJson type {}, must be Object type", typeName());
109
110 Maybe<pair<ElementLocation, ElementLocation>> entry = m_objectEntryLocations.maybe(key);
111 if (entry.isNothing())
112 throw JsonException::format("No such key in FormattedJson::get(\"{}\")", key);
113
114 return getFormattedJson(entry->second);
115}
116
117FormattedJson FormattedJson::get(size_t index) const {
118 if (type() != Json::Type::Array)

Callers 2

insertBeforeMethod · 0.45
insertAfterMethod · 0.45

Calls 6

isNothingMethod · 0.80
formatFunction · 0.70
typeFunction · 0.50
maybeMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected