From 2d331aac27156fe5d1e37c7c2fac1be0b2aba55f Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Tue, 11 Sep 2018 15:20:38 +0200
Subject: [PATCH] ENH: functions ImageIOBase::*AsString are now static

---
 Modules/IO/IOGDAL/src/otbGDALImageIO.cxx          |  2 +-
 Modules/IO/IOONERA/src/otbONERAImageIO.cxx        | 10 +++++-----
 Modules/IO/IORAD/src/otbRADImageIO.cxx            |  4 ++--
 Modules/IO/ImageIO/include/otbImageFileReader.hxx |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
index 316430596a..51d39776ff 100644
--- a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
+++ b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
@@ -1313,7 +1313,7 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
       }
     else
       {
-      itkExceptionMacro(<< "This complex type is not defined :" << this->GetPixelTypeAsString(this->GetPixelType()) );
+      itkExceptionMacro(<< "This complex type is not defined :" << ImageIOBase::GetPixelTypeAsString(this->GetPixelType()) );
       }
     }
   else
diff --git a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx
index 8d98f91152..1400b49c27 100644
--- a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx
+++ b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx
@@ -384,13 +384,13 @@ void ONERAImageIO::InternalReadImageInformation()
   otbMsgDebugMacro(<< "Driver to read: ONERA");
   otbMsgDebugMacro(<< "         Read  file         : " << m_FileName);
   otbMsgDebugMacro(<< "         Size               : " << m_Dimensions[0] << "," << m_Dimensions[1]);
-  otbMsgDebugMacro(<< "         PixelType          : " << this->GetPixelTypeAsString(this->GetPixelType()));
-  otbMsgDebugMacro(<< "         ComponentType      : " << this->GetComponentTypeAsString(this->GetComponentType()));
+  otbMsgDebugMacro(<< "         PixelType          : " << ImageIOBase::GetPixelTypeAsString(this->GetPixelType()));
+  otbMsgDebugMacro(<< "         ComponentType      : " << ImageIOBase::GetComponentTypeAsString(this->GetComponentType()));
   otbMsgDebugMacro(<< "         ComponentSize      : " << this->GetComponentSize());
   otbMsgDebugMacro(<< "         NumberOfComponents : " << this->GetNumberOfComponents());
   otbMsgDebugMacro(<< "         BytePerPixel       : " << m_BytePerPixel);
-  otbMsgDebugMacro(<< "         Host byte order    : " << this->GetByteOrderAsString(m_ByteOrder));
-  otbMsgDebugMacro(<< "         File byte order    : " << this->GetByteOrderAsString(m_FileByteOrder));
+  otbMsgDebugMacro(<< "         Host byte order    : " << ImageIOBase::GetByteOrderAsString(m_ByteOrder));
+  otbMsgDebugMacro(<< "         File byte order    : " << ImageIOBase::GetByteOrderAsString(m_FileByteOrder));
 
   delete [] sHeader;
 }
@@ -595,7 +595,7 @@ void ONERAImageIO::InternalWriteImageInformation()
     otbMsgDebugMacro(<< "         ComponentType      : " << this->GetComponentType());
     otbMsgDebugMacro(<< "         NumberOfComponents : " << this->GetNumberOfComponents());
     otbMsgDebugMacro(<< "         BytePerPixel       : " << m_BytePerPixel);
-    otbMsgDebugMacro(<< "         Host byte order    : " << this->GetByteOrderAsString(m_ByteOrder));
+    otbMsgDebugMacro(<< "         Host byte order    : " << ImageIOBase::GetByteOrderAsString(m_ByteOrder));
 }
 
 } // end namespace otb
diff --git a/Modules/IO/IORAD/src/otbRADImageIO.cxx b/Modules/IO/IORAD/src/otbRADImageIO.cxx
index 1e6c45d8a8..88981cc275 100644
--- a/Modules/IO/IORAD/src/otbRADImageIO.cxx
+++ b/Modules/IO/IORAD/src/otbRADImageIO.cxx
@@ -618,8 +618,8 @@ void RADImageIO::WriteImageInformation()
   m_HeaderFile << "TYPECODAGE ";
 
   std::string lExtension;
-  std::string lStringPixelType = itksys::SystemTools::UpperCase(this->GetPixelTypeAsString(m_PixelType));
-  std::string lStringComponentType = itksys::SystemTools::UpperCase(this->GetComponentTypeAsString(this->GetComponentType()));
+  std::string lStringPixelType = itksys::SystemTools::UpperCase(ImageIOBase::GetPixelTypeAsString(m_PixelType));
+  std::string lStringComponentType = itksys::SystemTools::UpperCase(ImageIOBase::GetComponentTypeAsString(this->GetComponentType()));
 
   if (lStringPixelType == "SCALAR")
     {
diff --git a/Modules/IO/ImageIO/include/otbImageFileReader.hxx b/Modules/IO/ImageIO/include/otbImageFileReader.hxx
index 9e3215277e..275e70272c 100644
--- a/Modules/IO/ImageIO/include/otbImageFileReader.hxx
+++ b/Modules/IO/ImageIO/include/otbImageFileReader.hxx
@@ -889,7 +889,7 @@ ImageFileReader<TOutputImage, ConvertPixelTraits>
     std::ostringstream msg;
     msg <<"Couldn't convert component type: "
         << std::endl << "    "
-        << m_ImageIO->GetComponentTypeAsString(m_ImageIO->GetComponentType())
+        << ImageIOBase::GetComponentTypeAsString(m_ImageIO->GetComponentType())
         << std::endl << "to one of: "
         << std::endl << "    " << typeid(unsigned char).name()
         << std::endl << "    " << typeid(char).name()
-- 
GitLab