X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FcreaSed%2FcreaSed.cpp;h=288c10d9ce356d4e868df1a6cb6e369f4b202f2b;hb=b3081c510018e9c63b6efb3882c154b047f69924;hp=51ca114fd82642ab297d8bf2015eb1f725a99c74;hpb=79358c74d60247bf322fc38d38ce7d95a6c41abf;p=crea.git diff --git a/appli/creaSed/creaSed.cpp b/appli/creaSed/creaSed.cpp index 51ca114..288c10d 100644 --- a/appli/creaSed/creaSed.cpp +++ b/appli/creaSed/creaSed.cpp @@ -1,5 +1,4 @@ -#include #include #include #include @@ -7,21 +6,19 @@ #include - - 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 ) - { - str.replace( pos, from.size(), to ); - pos = str.find( from, pos+from.size()-1 ); - } - } - - +//========================================================================== +void replace(std::string& str, + const std::string& from, + const std::string& to ) +{ + std::string::size_type pos = str.find( from ); + while ( pos != std::string::npos ) + { + str.replace( pos, from.size(), to ); + pos = str.find( from, pos+from.size()-1 ); + } +} +//========================================================================== //========================================================================== @@ -59,7 +56,7 @@ int main(int argc, char **argv) } fclose(ffIn); } else { - std::cerr << "ERROR. File : "<< argv[1] <<" Not exists." << std::endl; + std::cerr << "ERROR. File : "<< argv[1] <<" does not exists." << std::endl; return 1; }