| 68 | } |
| 69 | |
| 70 | static int splitIndexedField(std::string& item) |
| 71 | { |
| 72 | static const std::regex INDEX_REGEX("(\\w+)\\[([0-9]+)\\]"); |
| 73 | int index = -1; |
| 74 | |
| 75 | std::smatch dmatch; |
| 76 | if (std::regex_match(item, dmatch, INDEX_REGEX)) |
| 77 | { |
| 78 | auto stem = dmatch[1]; |
| 79 | index = std::stoi(dmatch[2]); |
| 80 | |
| 81 | item = stem; |
| 82 | } |
| 83 | |
| 84 | return index; |
| 85 | } |
| 86 | |
| 87 | static ProtoField resolveProtoPath( |
| 88 | google::protobuf::Message* message, const std::string& path, bool create) |