From 2e6448d9cbf2d9c39c2c2b6a2e8c8c9de527bceb Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Thu, 18 Jun 2020 09:06:04 +0200
Subject: [PATCH] Replace boost::join etc by simox::alg::join etc

---
 .../ArViz/Introspection/exceptions.cpp           | 16 ++++++++--------
 .../ArViz/Introspection/json_elements.cpp        |  9 ++++-----
 .../RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp |  4 ++--
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/source/RobotAPI/components/ArViz/Introspection/exceptions.cpp b/source/RobotAPI/components/ArViz/Introspection/exceptions.cpp
index 997a91d96..9930695fa 100644
--- a/source/RobotAPI/components/ArViz/Introspection/exceptions.cpp
+++ b/source/RobotAPI/components/ArViz/Introspection/exceptions.cpp
@@ -2,7 +2,7 @@
 
 #include <sstream>
 
-#include <boost/algorithm/string/join.hpp>
+#include <SimoxUtility/algorithm/string.h>
 
 
 namespace armarx::viz::error
@@ -12,7 +12,7 @@ namespace armarx::viz::error
     {}
 
     NoTypeNameEntryInJsonObject::NoTypeNameEntryInJsonObject(
-            const std::string& missingKey, const nlohmann::json& j) :
+        const std::string& missingKey, const nlohmann::json& j) :
         ArvizReflectionError(makeMsg(missingKey, j))
     {
     }
@@ -44,13 +44,13 @@ namespace armarx::viz::error
 
 
     TypeNameEntryAlreadyInJsonObject::TypeNameEntryAlreadyInJsonObject(
-            const std::string& key, const std::string& typeName, const nlohmann::json& j) :
-        ArvizReflectionError (makeMsg(key, typeName, j))
+        const std::string& key, const std::string& typeName, const nlohmann::json& j) :
+        ArvizReflectionError(makeMsg(key, typeName, j))
     {
     }
 
     std::string TypeNameEntryAlreadyInJsonObject::makeMsg(
-            const std::string& key, const std::string& typeName, const nlohmann::json& j)
+        const std::string& key, const std::string& typeName, const nlohmann::json& j)
     {
         std::stringstream ss;
         ss << "Key '" << key << "' already used in JSON object "
@@ -79,18 +79,18 @@ namespace armarx::viz::error
     {}
 
     SerializerAlreadyRegisteredForType::SerializerAlreadyRegisteredForType(
-            const std::string& typeName, const std::vector<std::string>& acceptedTypes) :
+        const std::string& typeName, const std::vector<std::string>& acceptedTypes) :
         ArvizReflectionError(makeMsg(typeName, acceptedTypes))
     {}
 
     std::string SerializerAlreadyRegisteredForType::makeMsg(
-            const std::string& typeName, const std::vector<std::string>& acceptedTypes)
+        const std::string& typeName, const std::vector<std::string>& acceptedTypes)
     {
         std::stringstream ss;
         ss << "There is already a registered serializer for type '" + typeName + "'.";
         if (!acceptedTypes.empty())
         {
-            ss << "\nAccepted types:\n" + boost::join(acceptedTypes, "\n- ");
+            ss << "\nAccepted types:\n" + simox::alg::join(acceptedTypes, "\n- ");
         }
         return ss.str();
     }
diff --git a/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp b/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp
index 14feae3fd..837e39030 100644
--- a/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp
+++ b/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp
@@ -1,6 +1,6 @@
 #include "json_elements.h"
 
-#include <boost/algorithm/string.hpp>
+#include <SimoxUtility/algorithm/string.h>
 
 #include <ArmarXCore/core/exceptions/local/ExpressionException.h>
 
@@ -246,17 +246,16 @@ namespace armarx::viz
                     flag_names.push_back(names.to_name(flag));
                 }
             }
-            return boost::join(flag_names, " | ");
+            return simox::alg::join(flag_names, " | ");
         }
 
         int from_flag_names(const std::string& flagString)
         {
-            std::vector<std::string> split;
-            boost::split(split, flagString, boost::is_any_of("|"));
+            bool trim_elements = true;
+            std::vector<std::string> split = simox::alg::split(flagString, "|", trim_elements);
             int flag = 0;
             for (auto& s : split)
             {
-                boost::algorithm::trim(s);
                 flag |= names.from_name(s);
             }
             return flag;
diff --git a/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp b/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp
index 594a6e6e3..aeecddbef 100644
--- a/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp
+++ b/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp
@@ -3,7 +3,7 @@
 #include <ArmarXCore/core/logging/Logging.h>
 #include <ArmarXCore/core/exceptions/local/ExpressionException.h>
 
-#include <boost/algorithm/string/join.hpp>
+#include <SimoxUtility/algorithm/string.h>
 
 #include <QCheckBox>
 #include <QDoubleSpinBox>
@@ -385,7 +385,7 @@ namespace armarx
                         keys.push_back(it.key());
                     }
                 }
-                ss << "object [" << boost::join(keys, ", ") << "]";
+                ss << "object [" << simox::alg::join(keys, ", ") << "]";
                 return QVariant(ss.str().c_str());
             }
 
-- 
GitLab