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

Method findValues

src/commands/CmdEdit.cpp:139–157  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

137
138////////////////////////////////////////////////////////////////////////////////
139std::vector<std::string> CmdEdit::findValues(const std::string& text, const std::string& name) {
140 std::vector<std::string> results;
141 std::string::size_type found = 0;
142
143 while (found != std::string::npos) {
144 found = text.find(name, found + 1);
145 if (found != std::string::npos) {
146 auto eol = text.find('\n', found + 1);
147 if (eol != std::string::npos) {
148 auto value = text.substr(found + name.length(), eol - (found + name.length()));
149
150 found = eol - 1;
151 results.push_back(Lexer::trim(value, "\t "));
152 }
153 }
154 }
155
156 return results;
157}
158
159////////////////////////////////////////////////////////////////////////////////
160std::string CmdEdit::formatDate(Task& task, const std::string& attribute,

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected