| 2929 | } |
| 2930 | |
| 2931 | void Path::makePath(const std::string &path, const InArgs &in) { |
| 2932 | const char *current = path.c_str(); |
| 2933 | const char *end = current + path.length(); |
| 2934 | InArgs::const_iterator itInArg = in.begin(); |
| 2935 | while (current != end) { |
| 2936 | if (*current == '[') { |
| 2937 | ++current; |
| 2938 | if (*current == '%') |
| 2939 | addPathInArg(path, in, itInArg, PathArgument::kindIndex); |
| 2940 | else { |
| 2941 | ArrayIndex index = 0; |
| 2942 | for (; current != end && *current >= '0' && *current <= '9'; ++current) |
| 2943 | index = index * 10 + ArrayIndex(*current - '0'); |
| 2944 | args_.push_back(index); |
| 2945 | } |
| 2946 | if (current == end || *current++ != ']') |
| 2947 | invalidPath(path, int(current - path.c_str())); |
| 2948 | } else if (*current == '%') { |
| 2949 | addPathInArg(path, in, itInArg, PathArgument::kindKey); |
| 2950 | ++current; |
| 2951 | } else if (*current == '.') { |
| 2952 | ++current; |
| 2953 | } else { |
| 2954 | const char *beginName = current; |
| 2955 | while (current != end && !strchr("[.", *current)) |
| 2956 | ++current; |
| 2957 | args_.push_back(std::string(beginName, current)); |
| 2958 | } |
| 2959 | } |
| 2960 | } |
| 2961 | |
| 2962 | void Path::addPathInArg(const std::string & /*path*/, |
| 2963 | const InArgs &in, |