MCPcopy Create free account
hub / github.com/SOUI2/soui / makePath

Method makePath

third-part/jsoncpp/src/lib_json/json_value.cpp:1549–1578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1547}
1548
1549void Path::makePath(const JSONCPP_STRING& path, const InArgs& in) {
1550 const char* current = path.c_str();
1551 const char* end = current + path.length();
1552 InArgs::const_iterator itInArg = in.begin();
1553 while (current != end) {
1554 if (*current == '[') {
1555 ++current;
1556 if (*current == '%')
1557 addPathInArg(path, in, itInArg, PathArgument::kindIndex);
1558 else {
1559 ArrayIndex index = 0;
1560 for (; current != end && *current >= '0' && *current <= '9'; ++current)
1561 index = index * 10 + ArrayIndex(*current - '0');
1562 args_.push_back(index);
1563 }
1564 if (current == end || *++current != ']')
1565 invalidPath(path, int(current - path.c_str()));
1566 } else if (*current == '%') {
1567 addPathInArg(path, in, itInArg, PathArgument::kindKey);
1568 ++current;
1569 } else if (*current == '.' || *current == ']') {
1570 ++current;
1571 } else {
1572 const char* beginName = current;
1573 while (current != end && !strchr("[.", *current))
1574 ++current;
1575 args_.push_back(JSONCPP_STRING(beginName, current));
1576 }
1577 }
1578}
1579
1580void Path::addPathInArg(const JSONCPP_STRING& /*path*/,
1581 const InArgs& in,

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.45
lengthMethod · 0.45
beginMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected