MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / splitIndexedField

Function splitIndexedField

lib/config/proto.cc:70–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70static 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
87static ProtoField resolveProtoPath(
88 google::protobuf::Message* message, const std::string& path, bool create)

Callers 1

resolveProtoPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected