MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / decomposePattern

Method decomposePattern

src/Lexer.cpp:1463–1476  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// / / [ ]

Source from the content-addressed store, hash-verified

1461////////////////////////////////////////////////////////////////////////////////
1462// / <pattern> / [<flags>]
1463bool Lexer::decomposePattern(const std::string& text, std::string& pattern, std::string& flags) {
1464 std::string ignored;
1465 std::string::size_type cursor = 0;
1466 if (readWord(text, "/", cursor, ignored) && ignored.length()) {
1467 auto parsed_flags = text.substr(cursor);
1468 if (parsed_flags.find('/') == std::string::npos) {
1469 flags = parsed_flags;
1470 pattern = text.substr(1, cursor - 2 - flags.length());
1471 return true;
1472 }
1473 }
1474
1475 return false;
1476}
1477
1478////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected