| 25 | |
| 26 | |
| 27 | StringTools::Strings |
| 28 | StringTools::split( const std::string &text, |
| 29 | char separator ) |
| 30 | { |
| 31 | Strings splittedText; |
| 32 | |
| 33 | std::string::const_iterator itStart = text.begin(); |
| 34 | while ( !text.empty() ) |
| 35 | { |
| 36 | std::string::const_iterator itSeparator = std::find( itStart, |
| 37 | text.end(), |
| 38 | separator ); |
| 39 | splittedText.push_back( text.substr( itStart - text.begin(), |
| 40 | itSeparator - itStart ) ); |
| 41 | if ( itSeparator == text.end() ) |
| 42 | break; |
| 43 | itStart = itSeparator +1; |
| 44 | } |
| 45 | |
| 46 | return splittedText; |
| 47 | } |
| 48 | |
| 49 | |
| 50 | std::string |
no test coverage detected