gfxconversion/mifconv/src/mifconv_util.cpp
branchRCL_3
changeset 11 e5e3f539dd55
parent 2 1f6339ced17d
--- a/gfxconversion/mifconv/src/mifconv_util.cpp	Tue May 11 16:43:53 2010 +0300
+++ b/gfxconversion/mifconv/src/mifconv_util.cpp	Thu Jul 15 19:16:20 2010 +0300
@@ -28,6 +28,7 @@
 #endif
 #include <stdlib.h>     // for _MAX_PATH
 #include <stdio.h>
+#include <cctype>
 
 #ifndef _MAX_PATH
 #define _MAX_PATH   (260)
@@ -192,6 +193,26 @@
 /**
  *
  */
+void MifConvUtil::ReplaceStr( MifConvString& str, 
+                              MifConvString replaceFrom, MifConvString replaceTo)
+{
+    if( str.length() >= replaceFrom.length() )
+    {        
+        MifConvString::size_type index = 0;
+        while( (index = str.find(replaceFrom, index)) != MifConvString::npos )
+        {     
+            MifConvString tmp_str = str.substr(0, index);
+            tmp_str = tmp_str + replaceTo;
+            str = tmp_str + str.substr(index+replaceFrom.length(),
+                                           str.length()-index+replaceFrom.length()
+                                           );
+        }
+    }
+}
+
+/**
+ *
+ */
 void MifConvUtil::SplitPath( const MifConvString& sourcePath, MifConvString& drive, MifConvString& path)
     {    
         if( sourcePath.length() > 0 )