| 1526 | } |
| 1527 | |
| 1528 | void 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 | |
| 1559 | void Path::addPathInArg(const String& /*path*/, const InArgs& in, |
| 1560 | InArgs::const_iterator& itInArg, |