MCPcopy Create free account
hub / github.com/PlayFab/gsdk / makePath

Method makePath

cpp/cppsdk/jsoncpp.cpp:4046–4075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

lengthMethod · 0.80
beginMethod · 0.80

Tested by

no test coverage detected