| 286 | // ---------------------------------------------------------------------- |
| 287 | template <typename StringType, typename ITR> |
| 288 | static inline |
| 289 | void SplitStringToIteratorAllowEmpty(const StringType& full, |
| 290 | const char* delim, |
| 291 | int pieces, |
| 292 | ITR& result) { |
| 293 | string::size_type begin_index, end_index; |
| 294 | begin_index = 0; |
| 295 | |
| 296 | for (int i = 0; (i < pieces-1) || (pieces == 0); i++) { |
| 297 | end_index = full.find_first_of(delim, begin_index); |
| 298 | if (end_index == string::npos) { |
| 299 | *result++ = full.substr(begin_index); |
| 300 | return; |
| 301 | } |
| 302 | *result++ = full.substr(begin_index, (end_index - begin_index)); |
| 303 | begin_index = end_index + 1; |
| 304 | } |
| 305 | *result++ = full.substr(begin_index); |
| 306 | } |
| 307 | |
| 308 | void SplitStringIntoNPiecesAllowEmpty(const string& full, |
| 309 | const char* delim, |
nothing calls this directly
no test coverage detected