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

Method joinWords

src/commands/CmdContext.cpp:96–109  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Joins all the words in the specified interval <from, to) to one string, which is then returned. If to is specified as 0 (default value), all the remaining words will be joined.

Source from the content-addressed store, hash-verified

94// If to is specified as 0 (default value), all the remaining words will be joined.
95//
96std::string CmdContext::joinWords(const std::vector<std::string>& words, unsigned int from,
97 unsigned int to /* = 0 */) {
98 std::string value = "";
99
100 if (to == 0) to = words.size();
101
102 for (unsigned int i = from; i < to; ++i) {
103 if (i > from) value += ' ';
104
105 value += words[i];
106 }
107
108 return value;
109}
110
111////////////////////////////////////////////////////////////////////////////////
112// Validate the context as valid for writing and fail the write context definition

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected