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

Method makePath

json/jsoncpp.cpp:4048–4077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4046}
4047
4048void Path::makePath(const JSONCPP_STRING& path, const InArgs& in) {
4049 const char* current = path.c_str();
4050 const char* end = current + path.length();
4051 InArgs::const_iterator itInArg = in.begin();
4052 while (current != end) {
4053 if (*current == '[') {
4054 ++current;
4055 if (*current == '%')
4056 addPathInArg(path, in, itInArg, PathArgument::kindIndex);
4057 else {
4058 ArrayIndex index = 0;
4059 for (; current != end && *current >= '0' && *current <= '9'; ++current)
4060 index = index * 10 + ArrayIndex(*current - '0');
4061 args_.push_back(index);
4062 }
4063 if (current == end || *++current != ']')
4064 invalidPath(path, int(current - path.c_str()));
4065 } else if (*current == '%') {
4066 addPathInArg(path, in, itInArg, PathArgument::kindKey);
4067 ++current;
4068 } else if (*current == '.' || *current == ']') {
4069 ++current;
4070 } else {
4071 const char* beginName = current;
4072 while (current != end && !strchr("[.", *current))
4073 ++current;
4074 args_.push_back(JSONCPP_STRING(beginName, current));
4075 }
4076 }
4077}
4078
4079void Path::addPathInArg(const JSONCPP_STRING& /*path*/,
4080 const InArgs& in,

Callers

nothing calls this directly

Calls 5

ArrayIndexClass · 0.85
c_strMethod · 0.80
push_backMethod · 0.80
lengthMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected