diff --git a/simgear/io/HTTPClient.cxx b/simgear/io/HTTPClient.cxx index 1126691c..86eeb6bc 100644 --- a/simgear/io/HTTPClient.cxx +++ b/simgear/io/HTTPClient.cxx @@ -35,8 +35,6 @@ #include #include -#include - #include #include @@ -297,7 +295,7 @@ void Client::makeRequest(const Request_ptr& r) } } - std::string method = boost::to_lower_copy(r->method()); + const std::string method = strutils::lowercase (r->method()); if (method == "get") { curl_easy_setopt(curlRequest, CURLOPT_HTTPGET, 1); } else if (method == "put") { @@ -530,8 +528,8 @@ size_t Client::requestHeaderCallback(char *rawBuffer, size_t size, size_t nitems return byteSize; } - std::string key = strutils::simplify(h.substr(0, colonPos)); - std::string lkey = boost::to_lower_copy(key); + const std::string key = strutils::simplify(h.substr(0, colonPos)); + const std::string lkey = strutils::lowercase (key); std::string value = strutils::strip(h.substr(colonPos + 1)); req->responseHeader(lkey, value); diff --git a/simgear/io/test_DNS.cxx b/simgear/io/test_DNS.cxx index db99ae16..d9a52528 100644 --- a/simgear/io/test_DNS.cxx +++ b/simgear/io/test_DNS.cxx @@ -7,8 +7,6 @@ #include #include -#include - #include #include "DNSClient.hxx" diff --git a/simgear/io/test_HTTP.cxx b/simgear/io/test_HTTP.cxx index 601c1037..13723741 100644 --- a/simgear/io/test_HTTP.cxx +++ b/simgear/io/test_HTTP.cxx @@ -5,8 +5,6 @@ #include #include -#include - #include #include "HTTPClient.hxx" diff --git a/simgear/io/test_HTTP.hxx b/simgear/io/test_HTTP.hxx index f8dde98c..028b5dfc 100644 --- a/simgear/io/test_HTTP.hxx +++ b/simgear/io/test_HTTP.hxx @@ -1,6 +1,7 @@ #ifndef SIMGEAR_IO_TEST_HTTP_HXX #define SIMGEAR_IO_TEST_HTTP_HXX +#include #include #include diff --git a/simgear/io/test_repository.cxx b/simgear/io/test_repository.cxx index 0148fc5c..9c641b77 100644 --- a/simgear/io/test_repository.cxx +++ b/simgear/io/test_repository.cxx @@ -5,8 +5,6 @@ #include #include -#include - #include #include "test_HTTP.hxx" diff --git a/simgear/io/text_DNS.cxx b/simgear/io/text_DNS.cxx index cabc4813..14ae23e9 100644 --- a/simgear/io/text_DNS.cxx +++ b/simgear/io/text_DNS.cxx @@ -5,8 +5,6 @@ #include #include -#include - #include #include "HTTPClient.hxx" diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index a252480f..48d6b638 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -47,8 +48,6 @@ #include "sg_path.hxx" -#include - using std::string; using simgear::strutils::starts_with; @@ -398,7 +397,7 @@ string SGPath::extension() const { } string SGPath::lower_extension() const { - return boost::to_lower_copy(extension()); + return simgear::strutils::lowercase (extension()); } string SGPath::complete_lower_extension() const @@ -412,7 +411,7 @@ string SGPath::complete_lower_extension() const string::size_type firstDot = path.find(".", index); if ((firstDot != string::npos) && (path.find(sgDirPathSep, firstDot) == string::npos)) { - return boost::to_lower_copy(path.substr(firstDot + 1)); + return simgear::strutils::lowercase (path.substr(firstDot + 1)); } else { return ""; } diff --git a/simgear/package/Package.cxx b/simgear/package/Package.cxx index a5fca6ce..8bc8e60a 100644 --- a/simgear/package/Package.cxx +++ b/simgear/package/Package.cxx @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -44,8 +43,7 @@ void Package::initWithProps(const SGPropertyNode* aProps) m_props = const_cast(aProps); // cache tag values for (auto c : aProps->getChildren("tag")) { - std::string t(c->getStringValue()); - m_tags.insert(boost::to_lower_copy(t)); + m_tags.insert (strutils::lowercase (c->getStringValue())); } m_id = m_props->getStringValue("id"); @@ -97,8 +95,7 @@ bool Package::matches(const SGPropertyNode* aFilter) const } if (filter_name == "tag") { - std::string tag(aFilter->getStringValue()); - boost::to_lower(tag); + const std::string tag = strutils::lowercase (aFilter->getStringValue()); return (m_tags.find(tag) != m_tags.end()); } @@ -110,18 +107,16 @@ bool Package::matches(const SGPropertyNode* aFilter) const // substring search of name, description, across variants too if ((filter_name == "text") || (filter_name == "name")) { handled = true; - std::string n(aFilter->getStringValue()); - boost::to_lower(n); + const std::string n = strutils::lowercase (aFilter->getStringValue()); - size_t pos = boost::to_lower_copy(name()).find(n); + const size_t pos = strutils::lowercase (name()).find(n); if (pos != std::string::npos) { return true; } for (auto var : m_props->getChildren("variant")) { if (var->hasChild("name")) { - std::string variantName(var->getStringValue("name")); - boost::to_lower(variantName); + const std::string variantName = strutils::lowercase (var->getStringValue("name")); size_t pos = variantName.find(n); if (pos != std::string::npos) { return true; @@ -146,12 +141,10 @@ bool Package::matches(const SGPropertyNode* aFilter) const bool Package::matchesDescription(const std::string &search) const { - std::string n(search); - boost::to_lower(n); + const std::string n = strutils::lowercase (search); bool localized; - auto d = getLocalisedString(m_props, "description", &localized); - boost::to_lower(d); + const auto d = strutils::lowercase (getLocalisedString(m_props, "description", &localized)); if (d.find(n) != std::string::npos) { return true; } @@ -159,7 +152,7 @@ bool Package::matchesDescription(const std::string &search) const // try non-localized description too, if the abovce was a localized one if (localized) { const std::string baseDesc = m_props->getStringValue("description"); - auto pos = boost::to_lower_copy(baseDesc).find(n); + const auto pos = strutils::lowercase (baseDesc).find(n); if (pos != std::string::npos) { return true; } @@ -167,9 +160,8 @@ bool Package::matchesDescription(const std::string &search) const // try each variant's description for (auto var : m_props->getChildren("variant")) { - auto vd = getLocalisedString(var, "description", &localized); + const auto vd = strutils::lowercase (getLocalisedString(var, "description", &localized)); if (!vd.empty()) { - boost::to_lower(vd); if (vd.find(n) != std::string::npos) { return true; } @@ -177,8 +169,7 @@ bool Package::matchesDescription(const std::string &search) const if (localized) { // try non-localized variant description - std::string vd = var->getStringValue("description"); - boost::to_lower(vd); + const std::string vd = strutils::lowercase (var->getStringValue("description")); if (vd.find(n) != std::string::npos) { return true; }