diff --git a/CMakeLists.txt b/CMakeLists.txt index 138dc8b..fe37cc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,25 +2,11 @@ cmake_minimum_required (VERSION 2.8.8) project (Simple-Web-Server) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra") -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - message(FATAL_ERROR "GCC version >=4.8 required.") - endif() -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) - message(FATAL_ERROR "Clang version >=3.3 required.") - endif() -elseif (MSVC14) #TODO: What about other MSVC versions? -else() - message(WARNING "Your compiler (${CMAKE_CXX_COMPILER_ID}) has not been tested on this project. Only Clang and GCC has been tested. Please report any problems at the project page on GitHub.") -endif() - - include_directories(.) find_package(Threads REQUIRED) -find_package(Boost 1.53.0 COMPONENTS regex system thread filesystem date_time REQUIRED) +find_package(Boost 1.53.0 COMPONENTS system thread filesystem date_time REQUIRED) include_directories(SYSTEM ${Boost_INCLUDE_DIR}) if(APPLE) diff --git a/server_http.hpp b/server_http.hpp index 085e345..e7be951 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -2,11 +2,11 @@ #define SERVER_HTTP_HPP #include -#include #include #include #include +#include #include #include #include @@ -75,7 +75,7 @@ namespace SimpleWeb { std::unordered_multimap header; - boost::smatch path_match; + std::smatch path_match; std::string remote_endpoint_address; unsigned short remote_endpoint_port; @@ -111,7 +111,7 @@ namespace SimpleWeb { std::function exception_handler; private: - std::vector::Response>, std::shared_ptr::Request>)> > > > > opt_resource; public: @@ -132,7 +132,7 @@ namespace SimpleWeb { it=opt_resource.begin()+(opt_resource.size()-1); it->first=res_method.first; } - it->second.emplace_back(boost::regex(res.first), res_method.second); + it->second.emplace_back(std::regex(res.first), res_method.second); } } @@ -335,8 +335,8 @@ namespace SimpleWeb { for(auto& res: opt_resource) { if(request->method==res.first) { for(auto& res_path: res.second) { - boost::smatch sm_res; - if(boost::regex_match(request->path, sm_res, res_path.first)) { + std::smatch sm_res; + if(std::regex_match(request->path, sm_res, res_path.first)) { request->path_match=std::move(sm_res); write_response(socket, request, res_path.second); return;