From 3554df2e34e63364eea3a7998e0dfb0e6be65ca4 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 30 Mar 2018 09:59:48 -0400 Subject: Started migrating to hkutil (does not build) --- lib/util.h | 61 ------------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 lib/util.h (limited to 'lib') diff --git a/lib/util.h b/lib/util.h deleted file mode 100644 index 9db8678..0000000 --- a/lib/util.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef UTIL_H_15DDCA2D -#define UTIL_H_15DDCA2D - -#include -#include -#include - -namespace verbly { - - template - std::string implode(InputIterator first, InputIterator last, std::string delimiter) - { - std::stringstream result; - - for (InputIterator it = first; it != last; it++) - { - if (it != first) - { - result << delimiter; - } - - result << *it; - } - - return result.str(); - } - - template - void split(std::string input, std::string delimiter, OutputIterator out) - { - while (!input.empty()) - { - int divider = input.find(delimiter); - if (divider == std::string::npos) - { - *out = input; - out++; - - input = ""; - } else { - *out = input.substr(0, divider); - out++; - - input = input.substr(divider+delimiter.length()); - } - } - } - - template - Container split(std::string input, std::string delimiter) - { - Container result; - - split(input, delimiter, std::back_inserter(result)); - - return result; - } - -}; - -#endif /* end of include guard: UTIL_H_15DDCA2D */ -- cgit 1.4.1