MCPcopy Create free account
hub / github.com/ValveSoftware/Proton / makePath

Method makePath

vrclient_x64/jsoncpp.cpp:3917–3946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3915}
3916
3917void Path::makePath(const std::string& path, const InArgs& in) {
3918 const char* current = path.c_str();
3919 const char* end = current + path.length();
3920 InArgs::const_iterator itInArg = in.begin();
3921 while (current != end) {
3922 if (*current == '[') {
3923 ++current;
3924 if (*current == '%')
3925 addPathInArg(path, in, itInArg, PathArgument::kindIndex);
3926 else {
3927 ArrayIndex index = 0;
3928 for (; current != end && *current >= '0' && *current <= '9'; ++current)
3929 index = index * 10 + ArrayIndex(*current - '0');
3930 args_.push_back(index);
3931 }
3932 if (current == end || *current++ != ']')
3933 invalidPath(path, int(current - path.c_str()));
3934 } else if (*current == '%') {
3935 addPathInArg(path, in, itInArg, PathArgument::kindKey);
3936 ++current;
3937 } else if (*current == '.') {
3938 ++current;
3939 } else {
3940 const char* beginName = current;
3941 while (current != end && !strchr("[.", *current))
3942 ++current;
3943 args_.push_back(std::string(beginName, current));
3944 }
3945 }
3946}
3947
3948void Path::addPathInArg(const std::string& /*path*/,
3949 const InArgs& in,

Callers

nothing calls this directly

Calls 3

lengthMethod · 0.80
beginMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected