faaf044
commit be2f060b67e9718994b731757480dacecf074fce
faaf044
Author: Alejandro Alvarez Ayllon <a.alvarezayllon@gmail.com>
faaf044
Date:   Tue Jul 21 10:38:22 2020 +0200
faaf044
faaf044
    boost::io::quoted changed in boost 1.73
faaf044
faaf044
diff --git a/SEFramework/src/lib/FITS/FitsFile.cpp b/SEFramework/src/lib/FITS/FitsFile.cpp
faaf044
index 7d4bf431..542eb416 100644
faaf044
--- a/SEFramework/src/lib/FITS/FitsFile.cpp
faaf044
+++ b/SEFramework/src/lib/FITS/FitsFile.cpp
faaf044
@@ -35,7 +35,6 @@
faaf044
 #include <boost/algorithm/string/trim.hpp>
faaf044
 
faaf044
 #include "ElementsKernel/Exception.h"
faaf044
-
faaf044
 #include "SEFramework/FITS/FitsFile.h"
faaf044
 
faaf044
 namespace SourceXtractor {
faaf044
@@ -67,9 +66,23 @@ static typename MetadataEntry::value_t valueAutoCast(const std::string& value) {
faaf044
   } catch (...) {
faaf044
   }
faaf044
 
faaf044
-  std::stringstream quoted(value);
faaf044
+  // Single quotes are used as escape code of another single quote, and
faaf044
+  // the string starts and ends with single quotes.
faaf044
+  // We used to use boost::io::quoted here, but it seems that starting with 1.73 it
faaf044
+  // does not work well when the escape code and the delimiter are the same
faaf044
   std::string unquoted;
faaf044
-  quoted >> boost::io::quoted(unquoted, '\'', '\'');
faaf044
+  bool escape = false;
faaf044
+  unquoted.reserve(value.size());
faaf044
+  for (auto i = value.begin(); i != value.end(); ++i) {
faaf044
+    if (*i == '\'' && !escape) {
faaf044
+      escape = true;
faaf044
+      // skip this char
faaf044
+    }
faaf044
+    else {
faaf044
+      escape = false;
faaf044
+      unquoted.push_back(*i);
faaf044
+    }
faaf044
+  }
faaf044
   return unquoted;
faaf044
 }
faaf044
 
faaf044
diff --git a/SEFramework/src/lib/FITS/FitsImageSource.cpp b/SEFramework/src/lib/FITS/FitsImageSource.cpp
faaf044
index 68aa860b..c4b06629 100644
faaf044
--- a/SEFramework/src/lib/FITS/FitsImageSource.cpp
faaf044
+++ b/SEFramework/src/lib/FITS/FitsImageSource.cpp
faaf044
@@ -31,7 +31,6 @@
faaf044
 #include <boost/regex.hpp>
faaf044
 #include <boost/algorithm/string/case_conv.hpp>
faaf044
 #include <boost/algorithm/string/trim.hpp>
faaf044
-#include <boost/io/detail/quoted_manip.hpp>
faaf044
 
faaf044
 #include <ElementsKernel/Exception.h>
faaf044
 
faaf044
diff --git a/SEImplementation/src/lib/Output/LdacWriter.cpp b/SEImplementation/src/lib/Output/LdacWriter.cpp
faaf044
index d34aff9a..7d2d1deb 100644
faaf044
--- a/SEImplementation/src/lib/Output/LdacWriter.cpp
faaf044
+++ b/SEImplementation/src/lib/Output/LdacWriter.cpp
faaf044
@@ -16,13 +16,18 @@
faaf044
  */
faaf044
 
faaf044
 #include <sstream>
faaf044
-#include <boost/io/detail/quoted_manip.hpp>
faaf044
 #include <AlexandriaKernel/memory_tools.h>
faaf044
 #include "SEFramework/Property/DetectionFrame.h"
faaf044
 #include "SEImplementation/Output/LdacWriter.h"
faaf044
 #include "SEImplementation/Configuration/DetectionImageConfig.h"
faaf044
 #include "SOURCEXTRACTORPLUSPLUS_VERSION.h"
faaf044
 
faaf044
+#if BOOST_VERSION < 107300
faaf044
+#include <boost/io/detail/quoted_manip.hpp>
faaf044
+#else
faaf044
+#include <boost/io/quoted.hpp>
faaf044
+#endif
faaf044
+
faaf044
 namespace SourceXtractor {
faaf044
 
faaf044
 using Euclid::Configuration::ConfigManager;