1
#include <cppunit/tools/StringTools.h>
2
#include <cppunit/portability/Stream.h>
10
StringTools::toString( int value )
19
StringTools::toString( double value )
28
StringTools::split( const std::string &text,
33
std::string::const_iterator itStart = text.begin();
34
while ( !text.empty() )
36
std::string::const_iterator itSeparator = std::find( itStart,
39
splittedText.push_back( text.substr( itStart - text.begin(),
40
itSeparator - itStart ) );
41
if ( itSeparator == text.end() )
43
itStart = itSeparator +1;
51
StringTools::wrap( const std::string &text,
54
const char lineBreak = '\n';
55
Strings lines = split( text, lineBreak );
58
for ( Strings::const_iterator it = lines.begin(); it != lines.end(); ++it )
60
if ( it != lines.begin() )
63
const std::string &line = *it;
64
unsigned int index =0;
65
while ( index < line.length() )
67
std::string lineSlice( line.substr( index, wrapColumn ) );
70
if ( index < line.length() )