]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/OS/String.cxx
Moved to version 1.0
[cpPlugins.git] / lib / cpPlugins / OS / String.cxx
diff --git a/lib/cpPlugins/OS/String.cxx b/lib/cpPlugins/OS/String.cxx
deleted file mode 100644 (file)
index 0bb9b59..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <cpPlugins/OS/String.h>
-#include <cstring>
-
-// -------------------------------------------------------------------------
-#ifdef cpPlugins_OS_Windows
-#  define cpPlugins_STRTOK( A, B, N ) strtok_s( A, B, N )
-#else // cpPlugins_OS_Windows
-#  define cpPlugins_STRTOK( A, B, N ) std::strtok( A, B )
-#endif // cpPlugins_OS_Windows
-
-// -------------------------------------------------------------------------
-std::vector< std::string > cpPlugins::OS::String::
-Tokenize( const std::string& str, const std::string& delims )
-{
-  std::vector< std::string > 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 );
-}
-
-// eof - $RCSfile$