REFAC: remove unnecessary calls to c_str
- Jul 18, 2018
-
-
Victor Poughon authored
-
- Jul 13, 2018
-
-
Victor Poughon authored
-
- Jul 10, 2018
-
-
Victor Poughon authored
This was done with the following script: # Use C++11 sstream constructor from string # Exclude 'ThirdParty' because it uses ossimFilename type find Modules/ Examples/ -not -iwholename "*ThirdParty*" -type f -print0 | xargs -0 sed -i -E "s/std::ifstream (.*)\((.*)\.c_str\(\)/std::ifstream \1\(\2/" find Modules/ Examples/ -not -iwholename "*ThirdParty*" -type f -print0 | xargs -0 sed -i -E "s/std::ofstream (.*)\((.*)\.c_str\(\)/std::ofstream \1\(\2/" # Use C++11 ::open(const std::string&) of ifstream, ofstream, etc. # Exclude ThirdParty because of ossimFilename type find Modules/ Examples/ -not -iwholename "*ThirdParty*" -type f -print0 | xargs -0 sed -i -E "s/\.open\((.*).c_str\(\)/\.open\(\1/" # No need for c_str when outputing to std::cout and such find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/\.c_str\(\) ?<</ <</" # Use itk::ExceptionObject::SetDescription and SetLocation string versions find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/e\.SetDescription\((.*)\.c_str\(\)\)/e\.SetDescription\(\1\)/" find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/e\.SetLocation\((.*)\.c_str\(\)\)/e\.SetLocation\(\1\)/" # Use itksys::SystemTool:: string versions find Modules/ Examples/ -type f -print0 | xargs -0 sed -i -E "s/itksys::SystemTools::(.*)\((.*)\.c_str\(\)/itksys::SystemTools::\1\(\2/" # Exclude otbLogger because it uses GetCurrentDateTime which does not have a string version git checkout -- Modules/Core/Common/src/otbLogger.cxx # Exclude test/otbOGRLayerStreamStitchingFilter.cxx because there's a double use which is not compatible with the regex git checkout -- Modules/Segmentation/OGRProcessing/test/otbOGRLayerStreamStitchingFilter.cxx
-