MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / resolvePossibleRef

Function resolvePossibleRef

src/osvr/Server/JSONResolvePossibleRef.cpp:72–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 Json::Value resolvePossibleRef(Json::Value const &input,
73 bool stringAcceptableResult,
74 std::vector<std::string> const &searchPath) {
75 Json::Value ret{Json::nullValue};
76 if (input.isString()) {
77 ret = loadFromFile(input.asString(), searchPath);
78 if (ret.isNull() && stringAcceptableResult) {
79 ret = input;
80 }
81 return ret;
82 }
83 if (input.isObject() && input.isMember("$ref")) {
84 /// @todo remove things after the filename in the ref.
85 ret = loadFromFile(input["$ref"].asString(), searchPath);
86 if (!ret.isNull()) {
87 return ret;
88 }
89 }
90 ret = input;
91 return ret;
92 }
93} // namespace server
94} // namespace osvr

Callers 2

processDisplayMethod · 0.85

Calls 1

loadFromFileFunction · 0.85

Tested by

no test coverage detected