Merge pull request #5992 from Icinga/feature/remove-includes

Remove unused includes
This commit is contained in:
Jean Flach 2018-01-25 09:13:02 +01:00 committed by GitHub
commit cc73eed2af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
76 changed files with 98 additions and 208 deletions

View File

@ -31,8 +31,6 @@
#include "base/convert.hpp"
#include "base/scriptglobal.hpp"
#include "base/process.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_errno.hpp>
@ -508,8 +506,7 @@ String Application::GetExePath(const String& argv0)
if (!foundSlash) {
const char *pathEnv = getenv("PATH");
if (pathEnv) {
std::vector<String> paths;
boost::algorithm::split(paths, pathEnv, boost::is_any_of(":"));
std::vector<String> paths = String(pathEnv).Split(":");
bool foundPath = false;
for (const String& path : paths) {
@ -1018,6 +1015,11 @@ int Application::Run()
return Main();
}
void Application::UpdatePidFile(const String& filename)
{
UpdatePidFile(filename, Utility::GetPid());
}
/**
* Grabs the PID file lock and updates the PID. Terminates the application
* if the PID file is already locked by another instance of the application.

View File

@ -22,14 +22,14 @@
#include "base/i2-base.hpp"
#include "base/application-ti.hpp"
#include "base/threadpool.hpp"
#include "base/utility.hpp"
#include "base/logger.hpp"
#include <ostream>
#include <iosfwd>
namespace icinga
{
class ThreadPool;
/**
* Abstract base class for applications.
*
@ -78,7 +78,8 @@ public:
static void SetDebuggingSeverity(LogSeverity severity);
static LogSeverity GetDebuggingSeverity();
void UpdatePidFile(const String& filename, pid_t pid = Utility::GetPid());
void UpdatePidFile(const String& filename);
void UpdatePidFile(const String& filename, pid_t pid);
void ClosePidFile(bool unlink);
static pid_t ReadPidFile(const String& filename);

View File

@ -34,8 +34,6 @@
#include "base/context.hpp"
#include "base/application.hpp"
#include <fstream>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <boost/exception/errinfo_file_name.hpp>
@ -113,8 +111,7 @@ void ConfigObject::ModifyAttribute(const String& attr, const Value& value, bool
Type::Ptr type = GetReflectionType();
std::vector<String> tokens;
boost::algorithm::split(tokens, attr, boost::is_any_of("."));
std::vector<String> tokens = attr.Split(".");
String fieldName = tokens[0];
@ -225,8 +222,7 @@ void ConfigObject::RestoreAttribute(const String& attr, bool updateVersion)
{
Type::Ptr type = GetReflectionType();
std::vector<String> tokens;
boost::algorithm::split(tokens, attr, boost::is_any_of("."));
std::vector<String> tokens = attr.Split(".");
String fieldName = tokens[0];
@ -279,8 +275,7 @@ void ConfigObject::RestoreAttribute(const String& attr, bool updateVersion)
{
ObjectLock olock(original_attributes);
for (const auto& kv : original_attributes) {
std::vector<String> originalTokens;
boost::algorithm::split(originalTokens, kv.first, boost::is_any_of("."));
std::vector<String> originalTokens = String(kv.first).Split(".");
if (tokens.size() > originalTokens.size())
continue;
@ -654,8 +649,7 @@ void ConfigObject::DumpModifiedAttributes(const std::function<void(const ConfigO
Type::Ptr type = object->GetReflectionType();
std::vector<String> tokens;
boost::algorithm::split(tokens, key, boost::is_any_of("."));
std::vector<String> tokens = key.Split(".");
String fieldName = tokens[0];
int fid = type->GetFieldId(fieldName);

View File

@ -24,6 +24,7 @@
#include "base/object.hpp"
#include "base/type.hpp"
#include "base/dictionary.hpp"
#include <boost/thread/mutex.hpp>
namespace icinga
{

View File

@ -21,8 +21,6 @@
#include "base/exception.hpp"
#include <boost/regex.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <set>
#include <iterator>
@ -95,8 +93,7 @@ void ConfigWriter::EmitScope(std::ostream& fp, int indentLevel, const Dictionary
EmitIndent(fp, indentLevel);
if (splitDot) {
std::vector<String> tokens;
boost::algorithm::split(tokens, kv.first, boost::is_any_of("."));
std::vector<String> tokens = kv.first.Split(".");
EmitIdentifier(fp, tokens[0], true);

View File

@ -23,7 +23,7 @@
#include "base/object.hpp"
#include "base/array.hpp"
#include "base/dictionary.hpp"
#include <fstream>
#include <iosfwd>
namespace icinga
{

View File

@ -21,7 +21,7 @@
#define CONSOLE_H
#include "base/i2-base.hpp"
#include <ostream>
#include <iosfwd>
namespace icinga
{

View File

@ -19,6 +19,7 @@
#include "base/context.hpp"
#include <boost/thread/tss.hpp>
#include <iostream>
using namespace icinga;
@ -51,11 +52,11 @@ void ContextTrace::Print(std::ostream& fp) const
if (m_Frames.empty())
return;
fp << std::endl;
fp << "\n";
int i = 0;
for (const String& frame : m_Frames) {
fp << "\t(" << i << ") " << frame << std::endl;
fp << "\t(" << i << ") " << frame << "\n";
i++;
}
}

View File

@ -22,6 +22,7 @@
#include "base/i2-base.hpp"
#include "base/object.hpp"
#include <boost/thread/mutex.hpp>
#include <map>
namespace icinga {

View File

@ -28,7 +28,6 @@
#include "base/debuginfo.hpp"
#include "base/dictionary.hpp"
#include "base/configobject.hpp"
#include <sstream>
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <boost/exception/errinfo_file_name.hpp>

View File

@ -22,12 +22,11 @@
#include "base/i2-base.hpp"
#include "base/value.hpp"
#include <vector>
#include <boost/function_types/function_type.hpp>
#include <boost/function_types/parameter_types.hpp>
#include <boost/function_types/result_type.hpp>
#include <boost/function_types/function_arity.hpp>
#include <type_traits>
#include <vector>
using namespace std::placeholders;

View File

@ -23,7 +23,7 @@
#include "base/i2-base.hpp"
#include "base/logger-ti.hpp"
#include <set>
#include <sstream>
#include <iosfwd>
namespace icinga
{

View File

@ -284,3 +284,9 @@ void icinga::intrusive_ptr_release(Object *object)
delete object;
}
}
void icinga::DefaultObjectFactoryCheckArgs(const std::vector<Value>& args)
{
if (!args.empty())
BOOST_THROW_EXCEPTION(std::invalid_argument("Constructor does not take any arguments."));
}

View File

@ -22,7 +22,6 @@
#include "base/i2-base.hpp"
#include "base/debug.hpp"
#include <boost/thread/condition_variable.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <vector>
@ -58,11 +57,12 @@ extern Value Empty;
DECLARE_PTR_TYPEDEFS(klass); \
IMPL_TYPE_LOOKUP();
void DefaultObjectFactoryCheckArgs(const std::vector<Value>& args);
template<typename T>
intrusive_ptr<Object> DefaultObjectFactory(const std::vector<Value>& args)
{
if (!args.empty())
BOOST_THROW_EXCEPTION(std::invalid_argument("Constructor does not take any arguments."));
DefaultObjectFactoryCheckArgs(args);
return new T();
}

View File

@ -19,6 +19,7 @@
#include "base/objecttype.hpp"
#include "base/initialize.hpp"
#include <boost/throw_exception.hpp>
using namespace icinga;

View File

@ -23,9 +23,6 @@
#include "base/exception.hpp"
#include "base/logger.hpp"
#include "base/function.hpp"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace icinga;
@ -69,8 +66,7 @@ PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
double value = Convert::ToDouble(valueStr.SubStr(0, pos));
std::vector<String> tokens;
boost::algorithm::split(tokens, valueStr, boost::is_any_of(";"));
std::vector<String> tokens = valueStr.Split(";");
bool counter = false;
String unit;
@ -79,7 +75,7 @@ PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
if (pos != String::NPos)
unit = valueStr.SubStr(pos, tokens[0].GetLength() - pos);
boost::algorithm::to_lower(unit);
unit = unit.ToLower();
double base = 1.0;

View File

@ -22,7 +22,7 @@
#include "base/i2-base.hpp"
#include "base/dictionary.hpp"
#include <sstream>
#include <iosfwd>
#include <deque>
#include <vector>

View File

@ -22,9 +22,9 @@
#include "base/i2-base.hpp"
#include "base/string.hpp"
#include <map>
#include <boost/thread/mutex.hpp>
#include <boost/signals2.hpp>
#include <map>
namespace icinga
{

View File

@ -49,8 +49,7 @@ Value ScriptGlobal::Get(const String& name, const Value *defaultValue)
void ScriptGlobal::Set(const String& name, const Value& value)
{
std::vector<String> tokens;
boost::algorithm::split(tokens, name, boost::is_any_of("."));
std::vector<String> tokens = name.Split(".");
if (tokens.empty())
BOOST_THROW_EXCEPTION(std::invalid_argument("Name must not be empty"));

View File

@ -37,20 +37,9 @@ class Singleton
public:
static T *GetInstance()
{
/* FIXME: This relies on static initializers being atomic. */
static boost::mutex mutex;
boost::mutex::scoped_lock lock(mutex);
static T *instance;
if (!instance)
instance = new T();
return instance;
static T instance;
return &instance;
}
private:
static T *m_Instance;
};
}

View File

@ -22,6 +22,7 @@
#include "base/i2-base.hpp"
#include "base/object.hpp"
#include <boost/thread/mutex.hpp>
namespace icinga
{

View File

@ -22,6 +22,7 @@
#include "base/i2-base.hpp"
#include "base/socket.hpp"
#include <boost/thread/condition_variable.hpp>
#include <thread>
#ifndef _WIN32

View File

@ -21,7 +21,7 @@
#define STACKTRACE_H
#include "base/i2-base.hpp"
#include <ostream>
#include <iosfwd>
namespace icinga
{

View File

@ -22,7 +22,7 @@
#include "base/i2-base.hpp"
#include "base/stream.hpp"
#include <iostream>
#include <iosfwd>
namespace icinga {

View File

@ -23,6 +23,8 @@
#include "base/i2-base.hpp"
#include "base/object.hpp"
#include <boost/signals2.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
namespace icinga
{

View File

@ -23,7 +23,7 @@
#include "base/i2-base.hpp"
#include "base/streamlogger-ti.hpp"
#include "base/timer.hpp"
#include <ostream>
#include <iosfwd>
namespace icinga
{

View File

@ -75,8 +75,7 @@ static Array::Ptr StringSplit(const String& delims)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
String self = vframe->Self;
std::vector<String> tokens;
boost::algorithm::split(tokens, self, boost::is_any_of(delims));
std::vector<String> tokens = self.Split(delims.CStr());
return Array::FromVector(tokens);
}

View File

@ -21,6 +21,9 @@
#include "base/value.hpp"
#include "base/primitivetype.hpp"
#include "base/dictionary.hpp"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>
#include <ostream>
using namespace icinga;

View File

@ -22,12 +22,7 @@
#include "base/i2-base.hpp"
#include "base/object.hpp"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/range/iterator.hpp>
#include <string.h>
#include <functional>
#include <string>
#include <iosfwd>

View File

@ -29,8 +29,6 @@
#include <mmatch.h>
#include <boost/lexical_cast.hpp>
#include <boost/thread/tss.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/uuid/uuid_io.hpp>
@ -509,8 +507,7 @@ bool Utility::Glob(const String& pathSpec, const std::function<void (const Strin
std::vector<String> files, dirs;
#ifdef _WIN32
std::vector<String> tokens;
boost::algorithm::split(tokens, pathSpec, boost::is_any_of("\\/"));
std::vector<String> tokens = pathSpec.Split("\\/");
String part1;
@ -1249,9 +1246,8 @@ unsigned long Utility::SDBM(const String& str, size_t len)
int Utility::CompareVersion(const String& v1, const String& v2)
{
std::vector<String> tokensv1, tokensv2;
boost::algorithm::split(tokensv1, v1, boost::is_any_of("."));
boost::algorithm::split(tokensv2, v2, boost::is_any_of("."));
std::vector<String> tokensv1 = v1.Split(".");
std::vector<String> tokensv2 = v2.Split(".");
for (std::vector<String>::size_type i = 0; i < tokensv2.size() - tokensv1.size(); i++)
tokensv1.emplace_back("0");

View File

@ -24,6 +24,7 @@
#include "base/string.hpp"
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>
#include <boost/throw_exception.hpp>
namespace icinga
{

View File

@ -26,8 +26,6 @@
#include "base/type.hpp"
#include <vector>
#include <boost/program_options.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
namespace icinga
{
@ -89,8 +87,7 @@ private:
#define REGISTER_CLICOMMAND(name, klass) \
INITIALIZE_ONCE([]() { \
std::vector<String> vname; \
boost::algorithm::split(vname, name, boost::is_any_of("/")); \
std::vector<String> vname = String(name).Split("/"); \
CLICommand::Register(vname, new klass()); \
})

View File

@ -33,6 +33,7 @@
#include "base/networkstream.hpp"
#include "base/exception.hpp"
#include <iostream>
#include <fstream>
#ifdef HAVE_EDITLINE
#include "cli/editline.hpp"
#endif /* HAVE_EDITLINE */
@ -455,8 +456,7 @@ incomplete:
if (commandOnceFileName.IsEmpty() && lines.find(di.Path) != lines.end()) {
String text = lines[di.Path];
std::vector<String> ulines;
boost::algorithm::split(ulines, text, boost::is_any_of("\n"));
std::vector<String> ulines = text.Split("\n");
for (int i = 1; i <= ulines.size(); i++) {
int start, len;

View File

@ -21,6 +21,7 @@
#include "base/logger.hpp"
#include "base/console.hpp"
#include "base/application.hpp"
#include "base/utility.hpp"
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <fstream>

View File

@ -29,10 +29,8 @@
#include "base/tlsutility.hpp"
#include "base/scriptglobal.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <iostream>
#include <fstream>
@ -176,8 +174,7 @@ int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& v
<< "object ApiListener \"api\" {\n";
if (vm.count("listen")) {
std::vector<String> tokens;
boost::algorithm::split(tokens, vm["listen"].as<std::string>(), boost::is_any_of(","));
std::vector<String> tokens = String(vm["listen"].as<std::string>()).Split(",");
if (tokens.size() > 0)
fp << " bind_host = \"" << tokens[0] << "\"\n";
@ -259,8 +256,7 @@ int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm,
return 1;
}
std::vector<String> tokens;
boost::algorithm::split(tokens, vm["master_host"].as<std::string>(), boost::is_any_of(","));
std::vector<String> tokens = String(vm["master_host"].as<std::string>()).Split(",");
String master_host;
String master_port = "5665";
@ -373,8 +369,7 @@ int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm,
<< "object ApiListener \"api\" {\n";
if (vm.count("listen")) {
std::vector<String> tokens;
boost::algorithm::split(tokens, vm["listen"].as<std::string>(), boost::is_any_of(","));
std::vector<String> tokens = String(vm["listen"].as<std::string>()).Split(",");
if (tokens.size() > 0)
fp << " bind_host = \"" << tokens[0] << "\"\n";

View File

@ -34,10 +34,8 @@
#include "base/console.hpp"
#include "base/exception.hpp"
#include "base/configwriter.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <fstream>
#include <iostream>
@ -60,10 +58,9 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector<std::string>& endpoi
String master_zone_name = "master"; //TODO: Find a better name.
for (const std::string& endpoint : endpoints) {
for (const String& endpoint : endpoints) {
/* extract all --endpoint arguments and store host,port info */
std::vector<String> tokens;
boost::algorithm::split(tokens, endpoint, boost::is_any_of(","));
std::vector<String> tokens = endpoint.Split(",");
Dictionary::Ptr my_master_endpoint = new Dictionary();

View File

@ -24,8 +24,6 @@
#include "base/utility.hpp"
#include "base/configtype.hpp"
#include "base/timer.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/thread/once.hpp>
using namespace icinga;
@ -59,8 +57,7 @@ String CommentNameComposer::MakeName(const String& shortName, const Object::Ptr&
Dictionary::Ptr CommentNameComposer::ParseName(const String& name) const
{
std::vector<String> tokens;
boost::algorithm::split(tokens, name, boost::is_any_of("!"));
std::vector<String> tokens = name.Split("!");
if (tokens.size() < 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid Comment name."));

View File

@ -22,8 +22,6 @@
#include "icinga/service.hpp"
#include "base/logger.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace icinga;
@ -48,8 +46,7 @@ String DependencyNameComposer::MakeName(const String& shortName, const Object::P
Dictionary::Ptr DependencyNameComposer::ParseName(const String& name) const
{
std::vector<String> tokens;
boost::algorithm::split(tokens, name, boost::is_any_of("!"));
std::vector<String> tokens = name.Split("!");
if (tokens.size() < 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid Dependency name."));

View File

@ -25,8 +25,6 @@
#include "base/configtype.hpp"
#include "base/utility.hpp"
#include "base/timer.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/thread/once.hpp>
using namespace icinga;
@ -63,8 +61,7 @@ String DowntimeNameComposer::MakeName(const String& shortName, const Object::Ptr
Dictionary::Ptr DowntimeNameComposer::ParseName(const String& name) const
{
std::vector<String> tokens;
boost::algorithm::split(tokens, name, boost::is_any_of("!"));
std::vector<String> tokens = name.Split("!");
if (tokens.size() < 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid Downtime name."));

View File

@ -37,8 +37,6 @@
#include "base/utility.hpp"
#include "base/exception.hpp"
#include <fstream>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/thread/once.hpp>
using namespace icinga;
@ -66,8 +64,7 @@ void ExternalCommandProcessor::Execute(const String& line)
if (ts == 0)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid timestamp in command: " + line));
std::vector<String> argv;
boost::algorithm::split(argv, args, boost::is_any_of(";"));
std::vector<String> argv = args.Split(";");
if (argv.empty())
BOOST_THROW_EXCEPTION(std::invalid_argument("Missing arguments in command: " + line));
@ -277,8 +274,7 @@ void ExternalCommandProcessor::ExecuteFromFile(const String& line, std::deque< s
if (ts == 0)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid timestamp in command: " + line));
std::vector<String> argv;
boost::algorithm::split(argv, args, boost::is_any_of(";"));
std::vector<String> argv = args.Split(";");
if (argv.empty())
BOOST_THROW_EXCEPTION(std::invalid_argument("Missing arguments in command: " + line));

View File

@ -34,6 +34,7 @@
#include "base/initialize.hpp"
#include "base/statsfunction.hpp"
#include "base/loader.hpp"
#include <fstream>
using namespace icinga;

View File

@ -25,8 +25,6 @@
#include "base/logger.hpp"
#include "base/debug.hpp"
#include "base/utility.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace icinga;
@ -171,8 +169,7 @@ void LegacyTimePeriod::ParseTimeSpec(const String& timespec, tm *begin, tm *end,
return;
}
std::vector<String> tokens;
boost::algorithm::split(tokens, timespec, boost::is_any_of(" "));
std::vector<String> tokens = timespec.Split(" ");
int mon = -1;
@ -335,20 +332,17 @@ bool LegacyTimePeriod::IsInDayDefinition(const String& daydef, tm *reference)
void LegacyTimePeriod::ProcessTimeRangeRaw(const String& timerange, tm *reference, tm *begin, tm *end)
{
std::vector<String> times;
boost::algorithm::split(times, timerange, boost::is_any_of("-"));
std::vector<String> times = timerange.Split("-");
if (times.size() != 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid timerange: " + timerange));
std::vector<String> hd1, hd2;
boost::algorithm::split(hd1, times[0], boost::is_any_of(":"));
std::vector<String> hd1 = times[0].Split(":");
if (hd1.size() != 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid time specification: " + times[0]));
boost::algorithm::split(hd2, times[1], boost::is_any_of(":"));
std::vector<String> hd2 = times[1].Split(":");
if (hd2.size() != 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid time specification: " + times[1]));
@ -382,9 +376,7 @@ Dictionary::Ptr LegacyTimePeriod::ProcessTimeRange(const String& timestamp, tm *
void LegacyTimePeriod::ProcessTimeRanges(const String& timeranges, tm *reference, const Array::Ptr& result)
{
std::vector<String> ranges;
boost::algorithm::split(ranges, timeranges, boost::is_any_of(","));
std::vector<String> ranges = timeranges.Split(",");
for (const String& range : ranges) {
Dictionary::Ptr segment = ProcessTimeRange(range, reference);

View File

@ -28,9 +28,7 @@
#include "base/scriptframe.hpp"
#include "base/convert.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace icinga;
@ -94,8 +92,7 @@ bool MacroProcessor::ResolveMacro(const String& macro, const ResolverList& resol
*recursive_macro = false;
std::vector<String> tokens;
boost::algorithm::split(tokens, macro, boost::is_any_of("."));
std::vector<String> tokens = macro.Split(".");
String objName;
if (tokens.size() > 1) {

View File

@ -29,8 +29,6 @@
#include "base/exception.hpp"
#include "base/initialize.hpp"
#include "base/scriptglobal.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace icinga;
@ -61,8 +59,7 @@ String NotificationNameComposer::MakeName(const String& shortName, const Object:
Dictionary::Ptr NotificationNameComposer::ParseName(const String& name) const
{
std::vector<String> tokens;
boost::algorithm::split(tokens, name, boost::is_any_of("!"));
std::vector<String> tokens = name.Split("!");
if (tokens.size() < 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid Notification name."));

View File

@ -26,8 +26,6 @@
#include "base/process.hpp"
#include "base/objectlock.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
using namespace icinga;
@ -117,8 +115,7 @@ std::pair<String, String> PluginUtility::ParseCheckOutput(const String& output)
String text;
String perfdata;
std::vector<String> lines;
boost::algorithm::split(lines, output, boost::is_any_of("\r\n"));
std::vector<String> lines = output.Split("\r\n");
for (const String& line : lines) {
size_t delim = line.FindFirstOf("|");

View File

@ -29,8 +29,6 @@
#include "base/convert.hpp"
#include "base/logger.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/thread/once.hpp>
using namespace icinga;
@ -58,8 +56,7 @@ String ScheduledDowntimeNameComposer::MakeName(const String& shortName, const Ob
Dictionary::Ptr ScheduledDowntimeNameComposer::ParseName(const String& name) const
{
std::vector<String> tokens;
boost::algorithm::split(tokens, name, boost::is_any_of("!"));
std::vector<String> tokens = name.Split("!");
if (tokens.size() < 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid ScheduledDowntime name."));

View File

@ -25,8 +25,6 @@
#include "base/objectlock.hpp"
#include "base/convert.hpp"
#include "base/utility.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace icinga;
@ -44,8 +42,7 @@ String ServiceNameComposer::MakeName(const String& shortName, const Object::Ptr&
Dictionary::Ptr ServiceNameComposer::ParseName(const String& name) const
{
std::vector<String> tokens;
boost::algorithm::split(tokens, name, boost::is_any_of("!"));
std::vector<String> tokens = name.Split("!");
if (tokens.size() < 2)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid Service name."));

View File

@ -27,10 +27,8 @@
#include "base/objectlock.hpp"
#include "base/convert.hpp"
#include "base/utility.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
using namespace icinga;

View File

@ -29,8 +29,6 @@
#include "base/logger.hpp"
#include <boost/tuple/tuple.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <fstream>
@ -142,8 +140,7 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
bag->Set("type", type);
bag->Set("options", options);
std::vector<String> tokens;
boost::algorithm::split(tokens, options, boost::is_any_of(";"));
std::vector<String> tokens = options.Split(";");
/* set default values */
bag->Set("class", LogEntryClassInfo);

View File

@ -41,9 +41,7 @@
#include "base/serializer.hpp"
#include "base/timer.hpp"
#include "base/initialize.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
using namespace icinga;
@ -122,11 +120,10 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
m_KeepAlive = (params == "on");
else if (header == "Columns") {
m_ColumnHeaders = false; // Might be explicitly re-enabled later on
boost::algorithm::split(m_Columns, params, boost::is_any_of(" "));
m_Columns = params.Split(" ");
} else if (header == "Separators") {
std::vector<String> separators;
std::vector<String> separators = params.Split(" ");
boost::algorithm::split(separators, params, boost::is_any_of(" "));
/* ugly ascii long to char conversion, but works */
if (separators.size() > 0)
m_Separators[0] = String(1, static_cast<char>(Convert::ToLong(separators[0])));
@ -154,8 +151,7 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
} else if (header == "Stats") {
m_ColumnHeaders = false; // Might be explicitly re-enabled later on
std::vector<String> tokens;
boost::algorithm::split(tokens, params, boost::is_any_of(" "));
std::vector<String> tokens = params.Split(" ");
if (tokens.size() < 2) {
m_Verb = "ERROR";

View File

@ -38,8 +38,6 @@
#include "base/objectlock.hpp"
#include <boost/tuple/tuple.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <fstream>

View File

@ -38,8 +38,6 @@
#include "base/objectlock.hpp"
#include <boost/tuple/tuple.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <fstream>

View File

@ -27,8 +27,6 @@
#include "base/function.hpp"
#include "base/utility.hpp"
#include "base/process.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/thread/once.hpp>
#include <objbase.h>
#include <mscoree.h>

View File

@ -28,8 +28,6 @@
#include "base/utility.hpp"
#include "base/process.hpp"
#include "base/convert.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
using namespace icinga;

View File

@ -35,8 +35,6 @@
#include "base/exception.hpp"
#include "base/statsfunction.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <utility>

View File

@ -40,8 +40,6 @@
#include "base/statsfunction.hpp"
#include "base/tlsutility.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/regex.hpp>

View File

@ -36,8 +36,6 @@
#include "base/exception.hpp"
#include "base/statsfunction.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/replace.hpp>
using namespace icinga;

View File

@ -22,9 +22,7 @@
#include "remote/filterutility.hpp"
#include "remote/apiaction.hpp"
#include "base/exception.hpp"
#include "base/serializer.hpp"
#include "base/logger.hpp"
#include <boost/algorithm/string.hpp>
#include <set>
using namespace icinga;

View File

@ -27,8 +27,6 @@
#include "base/configobject.hpp"
#include <vector>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
namespace icinga
{
@ -78,7 +76,7 @@ public:
std::vector<String> registerTypes; \
String typeNames = types; \
if (!typeNames.IsEmpty()) \
boost::algorithm::split(registerTypes, typeNames, boost::is_any_of(";")); \
registerTypes = typeNames.Split(";"); \
ApiAction::Ptr action = new ApiAction(registerTypes, callback); \
ApiActionRegistry::GetInstance()->Register(registerName, action); \
})

View File

@ -25,8 +25,6 @@
#include "base/json.hpp"
#include "base/convert.hpp"
#include "config/vmops.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <fstream>
using namespace icinga;
@ -319,8 +317,7 @@ void ApiListener::UpdateConfigObject(const ConfigObject::Ptr& object, const Mess
if (original_attributes) {
ObjectLock olock(original_attributes);
for (const Dictionary::Pair& kv : original_attributes) {
std::vector<String> tokens;
boost::algorithm::split(tokens, kv.first, boost::is_any_of("."));
std::vector<String> tokens = kv.first.Split(".");
Value value = object;
for (const String& token : tokens) {

View File

@ -24,11 +24,9 @@
#include "config/configitem.hpp"
#include "base/configwriter.hpp"
#include "base/exception.hpp"
#include "base/serializer.hpp"
#include "base/dependencygraph.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <fstream>
using namespace icinga;

View File

@ -22,7 +22,6 @@
#include "remote/httputility.hpp"
#include "remote/filterutility.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/join.hpp>
using namespace icinga;

View File

@ -20,7 +20,6 @@
#include "remote/configpackageutility.hpp"
#include "base/application.hpp"
#include "base/exception.hpp"
#include "base/scriptglobal.hpp"
#include "base/utility.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
@ -295,8 +294,7 @@ void ConfigPackageUtility::CollectPaths(const String& path, std::vector<std::pai
bool ConfigPackageUtility::ContainsDotDot(const String& path)
{
std::vector<String> tokens;
boost::algorithm::split(tokens, path, boost::is_any_of("/\\"));
std::vector<String> tokens = path.Split("/\\");
for (const String& part : tokens) {
if (part == "..")

View File

@ -23,7 +23,6 @@
#include "remote/filterutility.hpp"
#include "base/application.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/join.hpp>
using namespace icinga;

View File

@ -28,7 +28,6 @@
#include "base/serializer.hpp"
#include "base/timer.hpp"
#include "base/initialize.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/thread/once.hpp>
#include <set>

View File

@ -25,7 +25,6 @@
#include "remote/apiaction.hpp"
#include "remote/zone.hpp"
#include "base/configtype.hpp"
#include <boost/algorithm/string.hpp>
#include <set>
using namespace icinga;

View File

@ -24,8 +24,7 @@
#include "remote/apiaction.hpp"
#include "config/configitem.hpp"
#include "base/exception.hpp"
#include "base/serializer.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <set>
using namespace icinga;

View File

@ -24,7 +24,7 @@
#include "base/json.hpp"
#include "base/configtype.hpp"
#include "base/logger.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
using namespace icinga;

View File

@ -21,9 +21,6 @@
#include "base/logger.hpp"
#include "base/application.hpp"
#include "base/convert.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace icinga;
@ -52,8 +49,7 @@ bool HttpRequest::Parse(StreamReadContext& src, bool may_wait)
if (line == "")
return true;
std::vector<String> tokens;
boost::algorithm::split(tokens, line, boost::is_any_of(" "));
std::vector<String> tokens = line.Split(" ");
Log(LogDebug, "HttpRequest")
<< "line: " << line << ", tokens: " << tokens.size();
if (tokens.size() != 3)

View File

@ -20,8 +20,6 @@
#include "remote/httpresponse.hpp"
#include "remote/httpchunkedencoding.hpp"
#include "base/logger.hpp"
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "base/application.hpp"
#include "base/convert.hpp"
@ -132,8 +130,7 @@ bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
if (line == "")
return true;
std::vector<String> tokens;
boost::algorithm::split(tokens, line, boost::is_any_of(" "));
std::vector<String> tokens = line.Split(" ");
Log(LogDebug, "HttpRequest")
<< "line: " << line << ", tokens: " << tokens.size();
if (tokens.size() < 2)

View File

@ -20,11 +20,11 @@
#ifndef JSONRPCCONNECTION_H
#define JSONRPCCONNECTION_H
#include "remote/i2-remote.hpp"
#include "remote/endpoint.hpp"
#include "base/tlsstream.hpp"
#include "base/timer.hpp"
#include "base/workqueue.hpp"
#include "remote/i2-remote.hpp"
namespace icinga
{

View File

@ -22,8 +22,7 @@
#include "remote/filterutility.hpp"
#include "remote/apiaction.hpp"
#include "base/exception.hpp"
#include "base/serializer.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <set>
using namespace icinga;

View File

@ -23,7 +23,7 @@
#include "base/serializer.hpp"
#include "base/dependencygraph.hpp"
#include "base/configtype.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <set>
using namespace icinga;

View File

@ -24,7 +24,7 @@
#include "base/configtype.hpp"
#include "base/scriptglobal.hpp"
#include "base/logger.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <set>
using namespace icinga;

View File

@ -23,7 +23,6 @@
#include "base/configtype.hpp"
#include "base/scriptglobal.hpp"
#include "base/logger.hpp"
#include <boost/algorithm/string.hpp>
#include <set>
using namespace icinga;

View File

@ -24,7 +24,6 @@
#include "base/scriptglobal.hpp"
#include "base/logger.hpp"
#include "base/serializer.hpp"
#include <boost/algorithm/string.hpp>
#include <set>
using namespace icinga;