/////////////////////////////////////////////////////////////////////////// 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.
| 94 | // If to is specified as 0 (default value), all the remaining words will be joined. |
| 95 | // |
| 96 | std::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 |
nothing calls this directly
no outgoing calls
no test coverage detected