diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx index 813176ba07a4d92e587c3666acfe4c4287023006..ea65a5c2c577a97ed2f967418816ac2b1a17a6d0 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx @@ -100,7 +100,7 @@ const ExtensionDriverAssociation k_ExtensionDriverMap[] = char const* DeduceDriverName(std::string filename) { std::transform(filename.begin(), filename.end(), filename.begin(), (int (*)(int))toupper); - if (0 == strncmp(filename.c_str(), "PG:", 3)) + if(filename.compare(0, 3, "PG:") == 0) { return "PostgreSQL"; } diff --git a/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx b/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx index def5b6b1fb47da5ac6dab9e58a14fb457e6d9e7c..db1168d135001b9481d411011b73ef76a2f1376d 100644 --- a/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx @@ -135,7 +135,7 @@ private: StreamingStatisticsVImageFilterType::Pointer statsEstimator = StreamingStatisticsVImageFilterType::New(); std::ostringstream processName; processName << "Processing Image (" << imageId+1 << "/" << imageList->Size() << ")"; - AddProcess(statsEstimator->GetStreamer(), processName.str().c_str()); + AddProcess(statsEstimator->GetStreamer(), processName.str()); statsEstimator->SetInput(image); statsEstimator->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram")); diff --git a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx index 1b1c7c98850cd9e45a5321038ffd9ba3fd71684a..9159575470f6101bf2f58ca22d5e5a43ec1ddf5e 100644 --- a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx +++ b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx @@ -212,7 +212,7 @@ private: if (IsParameterEnabled("initmod")) { std::string descModFile = GetParameterString("initmod"); - descMod = FuzzyDescriptorsModelManager::Read(descModFile.c_str()); + descMod = FuzzyDescriptorsModelManager::Read(descModFile); descList = FuzzyDescriptorsModelManager::GetDescriptorList(descMod); } else diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index 045836b9e4deced4e551055c342ec3118f28f089..af39d262e52379e4b3789842ce4a455e8afadb2f 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -141,9 +141,9 @@ private: #ifdef OTB_USE_LIBSVM clock_t tic = clock(); - std::string shapefile = GetParameterString("inshp").c_str(); - std::string XMLfile = GetParameterString("instats").c_str(); - std::string modelfile = GetParameterString("insvm").c_str(); + std::string shapefile = GetParameterString("inshp"); + std::string XMLfile = GetParameterString("instats"); + std::string modelfile = GetParameterString("insvm"); typedef double ValueType; typedef itk::VariableLengthVector<ValueType> MeasurementType; diff --git a/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx b/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx index 61a8908f9cab792791aa2c7a5ca54837ff57a1c8..9b4c8212658bd6b71ad45d4a42bfab1799a082a2 100644 --- a/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx +++ b/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx @@ -125,7 +125,7 @@ private: // Load the descriptors model std::string descModFile = GetParameterString("descmod"); - DescriptorsModelType descMod = FuzzyDescriptorsModelManager::Read(descModFile.c_str()); + DescriptorsModelType descMod = FuzzyDescriptorsModelManager::Read(descModFile); LabelSetType Bhyp, Phyp; int nbSet; diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx index 34daa10b318d8186d203dd618b0a548753e6066d..c948d5d7164d3e3014af3918be8e2137a7fa0099 100644 --- a/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx @@ -282,7 +282,7 @@ private: std::ostringstream sqloss; sqloss.str(""); sqloss<<"SELECT * FROM \""<<layername<<"\" ORDER BY label"; - otb::ogr::Layer layerTmp=ogrDS->ExecuteSQL(sqloss.str().c_str(), nullptr, nullptr); + otb::ogr::Layer layerTmp=ogrDS->ExecuteSQL(sqloss.str(), nullptr, nullptr); otb::ogr::Feature firstFeature = layerTmp.ogr().GetNextFeature(); //Geometry fusion diff --git a/Modules/Filtering/DimensionalityReduction/test/otbSparseWvltToAngleMapperListFilter.cxx b/Modules/Filtering/DimensionalityReduction/test/otbSparseWvltToAngleMapperListFilter.cxx index 961de094c3bbb96e36d7c85614931e065632c6da..ca112c92b8d37a79d9ba7db12bfbac1f6d418154 100644 --- a/Modules/Filtering/DimensionalityReduction/test/otbSparseWvltToAngleMapperListFilter.cxx +++ b/Modules/Filtering/DimensionalityReduction/test/otbSparseWvltToAngleMapperListFilter.cxx @@ -67,7 +67,6 @@ int otbSparseWvltToAngleMapperListFilterTest ( int argc, char * argv[] ) std::string inputImageName [ nbInputImages ]; for ( unsigned int i = 0; i < nbInputImages; i++ ) inputImageName[i] = parseResult->GetParameterString("--InputImages", i); - //const char * outputImageName = parseResult->GetParameterString("--OutputImages").c_str(); // Parameter (to be changed if necessary) const double threshold = parseResult->IsOptionPresent("--Threshold") ? parseResult->GetParameterDouble("--Threshold") : 10.; diff --git a/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.hxx b/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.hxx index f6e71596833cc4f22c0b7c73dbf0d7c88cb7bf00..3a47ff168f4abe0520ab7dc39c4bd6423661edd4 100644 --- a/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.hxx +++ b/Modules/Filtering/Projection/include/otbGenericRSResampleImageFilter.hxx @@ -275,7 +275,7 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage> GenericRSTransformPointerType invTransform = GenericRSTransformType::New(); m_Transform->GetInverse(invTransform); - if(strcmp(map.c_str(),"UTM")== 0) + if(map == "UTM") { // Build the UTM transform : Need the zone & the hemisphere // For this we us the geographic coordinate of the input UL corner @@ -310,7 +310,7 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage> CPLFree(utmRefC); OSRRelease(oSRS); } - else if(strcmp(map.c_str(),"WGS84")==0) + else if(map == "WGS84") { projectionRef = otb::GeoInformationConversion::ToWKT(4326); //WGS84 } diff --git a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx index 1400b49c272b8eeb92db34b8143be3ee8f79eccc..0940079a527b17afd0e0f21eaae14767b48b6872 100644 --- a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx +++ b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx @@ -539,7 +539,7 @@ void ONERAImageIO::InternalWriteImageInformation() } /*-------- This part deals with writing header information ------ */ - const std::string DataFileName = System::GetRootName(m_FileName.c_str()) + ".dat"; + const std::string DataFileName = System::GetRootName(m_FileName) + ".dat"; m_Headerfile << "# [fichier en-tete produit par les routines de otb (Orfeo ToolBox) ]" << std::endl; diff --git a/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.hxx b/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.hxx index 147b83856810617f3596c5628703e12286f957e9..7b82b888512f631c813f613630746503a92e1858 100644 --- a/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.hxx +++ b/Modules/IO/IOXML/include/otbStatisticsXMLFileReader.hxx @@ -101,7 +101,7 @@ StatisticsXMLFileReader<TMeasurementVector> unsigned int index = 0; for(unsigned int idx = 0; idx < m_MeasurementVectorContainer.size() ; ++idx) { - if(strcmp(m_MeasurementVectorContainer[idx].first.c_str(), statisticName) == 0 ) + if(m_MeasurementVectorContainer[idx].first == statisticName) { found = true; index = idx; diff --git a/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.hxx b/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.hxx index 332bf2fe57ced60bc9dadcd81d53714fa013a5cb..31dc266f95d61eb6aa7328b905cb1d7630c558b5 100644 --- a/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.hxx +++ b/Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.hxx @@ -47,7 +47,7 @@ StatisticsXMLFileWriter<TMeasurementVector> // Check if the statistic name is already added for(unsigned int idx= 0; idx< m_MeasurementVectorContainer.size(); ++idx) { - if(strcmp(m_MeasurementVectorContainer[idx].first.c_str(), name) == 0 ) + if(m_MeasurementVectorContainer[idx].first == name) { itkExceptionMacro(<<"Token selected (" <<name<<") is already added to the XML file"); diff --git a/Modules/IO/TestKernel/src/otbTestHelper.cxx b/Modules/IO/TestKernel/src/otbTestHelper.cxx index 2599f7ea278e374e5b0eec8dbdac24ffc4199972..fae2a40dfe64a70447af91c8ade41eb539f20fb5 100644 --- a/Modules/IO/TestKernel/src/otbTestHelper.cxx +++ b/Modules/IO/TestKernel/src/otbTestHelper.cxx @@ -1678,7 +1678,7 @@ std::map<std::string, int> TestHelper::RegressionTestBaselines(char *baselineFil std::string myPath = itksys::SystemTools::GetFilenamePath(baselineFilename); itksys::Directory myDir; - myDir.Load(myPath.c_str()); + myDir.Load(myPath); const unsigned int nbFiles = myDir.GetNumberOfFiles(); const std::string originalBaseline = itksys::SystemTools::GetFilenameWithoutLastExtension(baselineFilename); diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimAlosPalsarModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimAlosPalsarModel.cpp index d8f5e85b602faa555a62bc73511b50aeed7313e4..73aa0ad9b61a4555185a082ae651b71d446cf4b2 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimAlosPalsarModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimAlosPalsarModel.cpp @@ -124,7 +124,7 @@ namespace ossimplugins _sensor = new SensorParams(); /* - if(strcmp(time_dir_pix.c_str(), "INCREASE") == 0) + if(time_dir_pix == "INCREASE") { _sensor->set_col_direction(1); } @@ -138,7 +138,7 @@ namespace ossimplugins // TODO: Have to verify whether the time direction indicator should be always positive /* - if(strcmp(time_dir_lin.c_str(), "INCREASE") == 0) + if(time_dir_lin == "INCREASE") { _sensor->set_lin_direction(1); } diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimErsSarModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimErsSarModel.cpp index 337fdfcc6f24dcd1d58269efda8be8a995d476f1..7fa0bc95cd24ac8ab0bfcbfcecad5db4cfe3eeeb 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimErsSarModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimErsSarModel.cpp @@ -116,7 +116,7 @@ namespace ossimplugins _sensor = new SensorParams(); - if (strcmp(time_dir_pix.c_str(), "INCREASE") == 0) + if (time_dir_pix == "INCREASE") { _sensor->set_col_direction(1); } @@ -125,7 +125,7 @@ namespace ossimplugins _sensor->set_col_direction(-1); } - if (strcmp(time_dir_lin.c_str(), "INCREASE") == 0) + if (time_dir_lin == "INCREASE") { _sensor->set_lin_direction(1); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperDocExampleStructure.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperDocExampleStructure.cxx index 59c9448ffd3264ae8cd3f1acbf73b3ca0553e201..83c98b0b50f056e2a6b72a569f49ac7e83f6de90 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperDocExampleStructure.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperDocExampleStructure.cxx @@ -148,7 +148,7 @@ DocExampleStructure::GenerateCLExample( unsigned int exId ) // Suppress last added space res.erase( res.size()-1, 1); - return res.c_str(); + return res; } std::string diff --git a/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx b/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx index 954f4ffbc684321d4a8d0108aea7dcb8b062be07..a33f61dc7a5ce1917e5da9532a9614bc11bc74b6 100644 --- a/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx +++ b/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) #endif ApplicationRegistry::AddApplicationPath(argv[2]); - Application::Pointer appli = ApplicationRegistry::CreateApplicationFaster(module.c_str()); + Application::Pointer appli = ApplicationRegistry::CreateApplicationFaster(module); assert(!appli.IsNull());