MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / resolve

Method resolve

json/jsoncpp.cpp:4122–4139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4120}
4121
4122Value Path::resolve(const Value& root, const Value& defaultValue) const {
4123 const Value* node = &root;
4124 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
4125 const PathArgument& arg = *it;
4126 if (arg.kind_ == PathArgument::kindIndex) {
4127 if (!node->isArray() || !node->isValidIndex(arg.index_))
4128 return defaultValue;
4129 node = &((*node)[arg.index_]);
4130 } else if (arg.kind_ == PathArgument::kindKey) {
4131 if (!node->isObject())
4132 return defaultValue;
4133 node = &((*node)[arg.key_]);
4134 if (node == &Value::nullSingleton())
4135 return defaultValue;
4136 }
4137 }
4138 return *node;
4139}
4140
4141Value& Path::make(Value& root) const {
4142 Value* node = &root;

Callers 2

ResolveCallbackMethod · 0.80
upload_new_fileMethod · 0.80

Calls 5

isArrayMethod · 0.80
isValidIndexMethod · 0.80
isObjectMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected