equal
deleted
inserted
replaced
26 #else |
26 #else |
27 #include <unistd.h> |
27 #include <unistd.h> |
28 #endif |
28 #endif |
29 #include <stdlib.h> // for _MAX_PATH |
29 #include <stdlib.h> // for _MAX_PATH |
30 #include <stdio.h> |
30 #include <stdio.h> |
|
31 #include <cctype> |
31 |
32 |
32 #ifndef _MAX_PATH |
33 #ifndef _MAX_PATH |
33 #define _MAX_PATH (260) |
34 #define _MAX_PATH (260) |
34 #endif |
35 #endif |
35 |
36 |
183 { |
184 { |
184 MifConvString::size_type index = 0; |
185 MifConvString::size_type index = 0; |
185 while( (index = str.find(replaceFrom, index)) != MifConvString::npos ) |
186 while( (index = str.find(replaceFrom, index)) != MifConvString::npos ) |
186 { |
187 { |
187 str.replace(index,1,1,replaceTo); |
188 str.replace(index,1,1,replaceTo); |
|
189 } |
|
190 } |
|
191 } |
|
192 |
|
193 /** |
|
194 * |
|
195 */ |
|
196 void MifConvUtil::ReplaceStr( MifConvString& str, |
|
197 MifConvString replaceFrom, MifConvString replaceTo) |
|
198 { |
|
199 if( str.length() >= replaceFrom.length() ) |
|
200 { |
|
201 MifConvString::size_type index = 0; |
|
202 while( (index = str.find(replaceFrom, index)) != MifConvString::npos ) |
|
203 { |
|
204 MifConvString tmp_str = str.substr(0, index); |
|
205 tmp_str = tmp_str + replaceTo; |
|
206 str = tmp_str + str.substr(index+replaceFrom.length(), |
|
207 str.length()-index+replaceFrom.length() |
|
208 ); |
188 } |
209 } |
189 } |
210 } |
190 } |
211 } |
191 |
212 |
192 /** |
213 /** |