diff --git a/lib/base/CMakeLists.txt b/lib/base/CMakeLists.txt index 108ca27c1..2a5391818 100644 --- a/lib/base/CMakeLists.txt +++ b/lib/base/CMakeLists.txt @@ -70,7 +70,6 @@ set(base_SOURCES stream.cpp stream.hpp streamlogger.cpp streamlogger.hpp streamlogger-ti.hpp string.cpp string.hpp string-script.cpp - stringbuilder.cpp stringbuilder.hpp sysloglogger.cpp sysloglogger.hpp sysloglogger-ti.hpp tcpsocket.cpp tcpsocket.hpp threadpool.cpp threadpool.hpp diff --git a/lib/base/stringbuilder.cpp b/lib/base/stringbuilder.cpp deleted file mode 100644 index 5b5a508ec..000000000 --- a/lib/base/stringbuilder.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ - -#include "base/stringbuilder.hpp" -#include - -using namespace icinga; - -void StringBuilder::Append(const String& str) -{ - m_Buffer.insert(m_Buffer.end(), str.Begin(), str.End()); -} - -void StringBuilder::Append(const std::string& str) -{ - m_Buffer.insert(m_Buffer.end(), str.begin(), str.end()); -} - -void StringBuilder::Append(const char *begin, const char *end) -{ - m_Buffer.insert(m_Buffer.end(), begin, end); -} - -void StringBuilder::Append(const char *cstr) -{ - m_Buffer.insert(m_Buffer.end(), cstr, cstr + std::strlen(cstr)); -} - -void StringBuilder::Append(char chr) -{ - m_Buffer.emplace_back(chr); -} - -String StringBuilder::ToString() const -{ - return String(m_Buffer.data(), m_Buffer.data() + m_Buffer.size()); -} diff --git a/lib/base/stringbuilder.hpp b/lib/base/stringbuilder.hpp deleted file mode 100644 index 4d806f4b7..000000000 --- a/lib/base/stringbuilder.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ - -#ifndef STRINGBUILDER_H -#define STRINGBUILDER_H - -#include "base/i2-base.hpp" -#include "base/string.hpp" -#include -#include - -namespace icinga -{ - -/** - * A string builder. - * - * @ingroup base - */ -class StringBuilder final -{ -public: - void Append(const String&); - void Append(const std::string&); - void Append(const char *, const char *); - void Append(const char *); - void Append(char); - - String ToString() const; - -private: - std::vector m_Buffer; -}; - -} - -#endif /* STRINGBUILDER_H */