-// -------------------------------------------------------------------------
-bool cpPlugins_ISBLANK( const char& value )
-{
- return( value == ' ' || value == '\t' || value == '\n' || value == '\r' );
-}
-
-// -------------------------------------------------------------------------
-TLines Tokenize( const std::string& str, const std::string& delims )
-{
- TLines tokens;
- if( str.size( ) > 0 )
- {
- auto ssize = str.size( );
- char* buffer = new char[ ssize + 1 ];
- for( unsigned long i = 0; i < ssize; ++i )
- buffer[ i ] = str[ i ];
- buffer[ ssize ] = '\0';
- char* next;
- char* it = cpPlugins_STRTOK( buffer, delims.c_str( ), &next );
- while( it != NULL )
- {
- tokens.push_back( std::string( it ) );
- it = cpPlugins_STRTOK( NULL, delims.c_str( ), &next );
-
- } // elihw
- delete [] buffer;
-
- } // fi
- return( tokens );
-}
-
-// -------------------------------------------------------------------------
-std::string Replace(
- const std::string& str, const std::string& sub, const std::string& nsub
- )
-{
- std::string res = str;
- size_t index;
- while( ( index = res.find( sub ) ) != std::string::npos )
- res.replace( index, sub.size( ), nsub );
- return( res );