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

Method extract_single_value

Source/cmCommandLineArgument.h:269–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267 };
268
269 std::string extract_single_value(std::string const& input,
270 ParseMode& parseState) const
271 {
272 // parse the string to get the value
273 auto possible_value = cm::string_view(input).substr(this->Name.size());
274 if (possible_value.empty()) {
275 parseState = ParseMode::ValueError;
276 } else if (possible_value[0] == '=') {
277 possible_value.remove_prefix(1);
278 if (possible_value.empty()) {
279 parseState = ParseMode::ValueError;
280 }
281 }
282 if (parseState == ParseMode::Valid && possible_value[0] == ' ') {
283 possible_value.remove_prefix(1);
284 }
285 return std::string(possible_value);
286 }
287
288 static bool IsFlag(cm::string_view arg)
289 {

Callers 1

parseMethod · 0.95

Calls 3

substrMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected