]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkUtilities.cxx
ColourDialog -> ColourSelector
[bbtk.git] / kernel / src / bbtkUtilities.cxx
index 6ebbe6152ed020ceeb2303db6b741c9fe08c2c44..968853ff91b111f59a100382974cf1cb42f9eacb 100644 (file)
@@ -1,30 +1,34 @@
 #include "bbtkUtilities.h"
+
 
 namespace bbtk
 {
-  /*
-  //========================================================================
-    /// Usefull functions for html generation
-    static void replace( std::string& str,
-                        const std::string& from, const std::string& to )
-    {
-      using std::string;
-      string::size_type pos = str.find( from );
-      while ( pos != string::npos )
-       {
-         //    std::cout << "'" << str << "' -> '";
-         str.replace( pos, from.size(), to );
-         pos = str.find( from, pos+from.size()-1 );
-         //    std::cout << str << "'"<< std::endl;
-       } 
-    }
-  //==========================================================================
-  inline void html_format(std::string& str)
-  {
-    replace( str, "&", "&amp;" );
-    replace( str, "<", "&lt;"# );
-    replace( str, ">", "&gt;" );
-  }
-  */
+
+
+bool Utilities::loosematch(std::string stdLine,std::string stdOptions) 
+{
+       bool result=false;
+         std::vector<std::string> tokens;
+         SplitString ( stdOptions,"|", tokens);
+         int i,size=tokens.size();  
+         for (i=0; i<size; i++)
+         {               
+#ifdef WIN32
+                 if ( strcmpi(stdLine.c_str(),tokens[i].c_str())==0) 
+                 { 
+                         result=true; 
+                 }               
+#else
+                 if ( strcasecmp(stdLine.c_str(),tokens[i].c_str())==0) 
+                 { 
+                         result=true; 
+                 }               
+#endif
+
+         }
+         return result;
+}
+
+
+
 }