1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-30 16:17:46 +00:00

boost::iequal removed

This commit is contained in:
mordred 2018-10-26 10:51:02 +02:00
parent a068da4389
commit 4f41a6a8be
2 changed files with 5 additions and 14 deletions

View file

@ -10,6 +10,7 @@
#include <functional> #include <functional>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <regex>
#ifndef CASE_INSENSITIVE_EQUALS_AND_HASH #ifndef CASE_INSENSITIVE_EQUALS_AND_HASH
#define CASE_INSENSITIVE_EQUALS_AND_HASH #define CASE_INSENSITIVE_EQUALS_AND_HASH
@ -17,7 +18,7 @@
class case_insensitive_equals { class case_insensitive_equals {
public: public:
bool operator()(const std::string &key1, const std::string &key2) const { bool operator()(const std::string &key1, const std::string &key2) const {
return boost::algorithm::iequals(key1, key2); return Core::Util::toLowerCopy( key1 ) == Core::Util::toLowerCopy( key2 );
} }
}; };
class case_insensitive_hash { class case_insensitive_hash {
@ -32,15 +33,6 @@ public:
}; };
#endif #endif
// Late 2017 TODO: remove the following checks and always use std::regex
#ifdef USE_BOOST_REGEX
#include <boost/regex.hpp>
#define REGEX_NS boost
#else
#include <regex>
#define REGEX_NS std
#endif
// TODO when switching to c++14, use [[deprecated]] instead // TODO when switching to c++14, use [[deprecated]] instead
#ifndef DEPRECATED #ifndef DEPRECATED
#ifdef __GNUC__ #ifdef __GNUC__
@ -396,7 +388,7 @@ namespace SimpleWeb {
auto range=request->header.equal_range("Connection"); auto range=request->header.equal_range("Connection");
for(auto it=range.first;it!=range.second;it++) { for(auto it=range.first;it!=range.second;it++) {
if(boost::iequals(it->second, "close")) if( Core::Util::toLoweCopy( it->second ) == "close" )
return; return;
} }
if(http_version>1.05) if(http_version>1.05)

View file

@ -1,10 +1,9 @@
#ifndef CLIENT_HTTP_HPP #ifndef CLIENT_HTTP_HPP
#define CLIENT_HTTP_HPP #define CLIENT_HTTP_HPP
#include <boost/algorithm/string/predicate.hpp>
#include <asio.hpp> #include <asio.hpp>
#include <Util/Util.h>
#include <unordered_map> #include <unordered_map>
#include <map> #include <map>
#include <random> #include <random>
@ -15,7 +14,7 @@
class case_insensitive_equals { class case_insensitive_equals {
public: public:
bool operator()( const std::string &key1, const std::string &key2 ) const { bool operator()( const std::string &key1, const std::string &key2 ) const {
return boost::algorithm::iequals( key1, key2 ); return Core::Util::toLowerCopy( key1 ) == Core::Util::toLowerCopy( key2 );
} }
}; };
class case_insensitive_hash { class case_insensitive_hash {