From 4093e285fd54bd0be89bc1474ff71562ddb6c4ad Mon Sep 17 00:00:00 2001
From: Steven Murray <Steven.Murray@cern.ch>
Date: Sun, 14 Oct 2018 13:00:34 +0200
Subject: [PATCH] Acs::str2DriveId() no longer depends on utils::splitString()

---
 mediachanger/acs/Acs.cpp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/mediachanger/acs/Acs.cpp b/mediachanger/acs/Acs.cpp
index 714d98ec63..e622b199c9 100644
--- a/mediachanger/acs/Acs.cpp
+++ b/mediachanger/acs/Acs.cpp
@@ -17,12 +17,12 @@
  */
 
 #include "Acs.hpp"
-#include "common/utils/utils.hpp"
 
 #include <iomanip>
 #include <sstream>
 #include <stdint.h>
 #include <string.h>
+#include <vector>
 
 //------------------------------------------------------------------------------
 // destructor
@@ -35,7 +35,20 @@ cta::mediachanger::acs::Acs::~Acs() {
 //------------------------------------------------------------------------------
 DRIVEID cta::mediachanger::acs::Acs::str2DriveId(const std::string &str) {
   std::vector<std::string> components;
-  cta::utils::splitString(str, ':', components);
+
+  if(!str.empty()) {
+    const char separator = ':';
+    std::string::size_type beginIndex = 0;
+    std::string::size_type endIndex   = str.find(separator);
+
+    while(endIndex != std::string::npos) {
+      components.push_back(str.substr(beginIndex, endIndex - beginIndex));
+      beginIndex = ++endIndex;
+      endIndex = str.find(separator, endIndex);
+    }
+
+    components.push_back(str.substr(beginIndex));
+  }
 
   // The drive ID should consist of 4 components: ACS, LSM, Panel and Transport
   if(4 != components.size()) {
-- 
GitLab