MCPcopy Index your code
hub / github.com/Kitware/CMake / makePath

Method makePath

Utilities/cmjsoncpp/src/lib_json/json_value.cpp:1528–1557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1526}
1527
1528void Path::makePath(const String& path, const InArgs& in) {
1529 const char* current = path.c_str();
1530 const char* end = current + path.length();
1531 auto itInArg = in.begin();
1532 while (current != end) {
1533 if (*current == '[') {
1534 ++current;
1535 if (*current == '%')
1536 addPathInArg(path, in, itInArg, PathArgument::kindIndex);
1537 else {
1538 ArrayIndex index = 0;
1539 for (; current != end && *current >= '0' && *current <= '9'; ++current)
1540 index = index * 10 + ArrayIndex(*current - '0');
1541 args_.push_back(index);
1542 }
1543 if (current == end || *++current != ']')
1544 invalidPath(path, int(current - path.c_str()));
1545 } else if (*current == '%') {
1546 addPathInArg(path, in, itInArg, PathArgument::kindKey);
1547 ++current;
1548 } else if (*current == '.' || *current == ']') {
1549 ++current;
1550 } else {
1551 const char* beginName = current;
1552 while (current != end && !strchr("[.", *current))
1553 ++current;
1554 args_.push_back(String(beginName, current));
1555 }
1556 }
1557}
1558
1559void Path::addPathInArg(const String& /*path*/, const InArgs& in,
1560 InArgs::const_iterator& itInArg,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected