MCPcopy Create free account
hub / github.com/Kitware/CMake / GetMatchedArguments

Method GetMatchedArguments

Source/kwsys/CommandLineArguments.cxx:127–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127bool CommandLineArguments::GetMatchedArguments(
128 std::vector<std::string>* matches, std::string const& arg)
129{
130 matches->clear();
131 CommandLineArguments::Internal::CallbacksMap::iterator it;
132
133 // Does the argument match to any we know about?
134 for (it = this->Internals->Callbacks.begin();
135 it != this->Internals->Callbacks.end(); ++it) {
136 CommandLineArguments::Internal::String const& parg = it->first;
137 CommandLineArgumentsCallbackStructure* cs = &it->second;
138 if (cs->ArgumentType == CommandLineArguments::NO_ARGUMENT ||
139 cs->ArgumentType == CommandLineArguments::SPACE_ARGUMENT) {
140 if (arg == parg) {
141 matches->push_back(parg);
142 }
143 } else if (arg.find(parg) == 0) {
144 matches->push_back(parg);
145 }
146 }
147 return !matches->empty();
148}
149
150int CommandLineArguments::Parse()
151{

Callers 1

ParseMethod · 0.95

Calls 6

push_backMethod · 0.80
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected