From fd58a419a9888833a567777430410a580ab8e8f2 Mon Sep 17 00:00:00 2001 From: antao Date: Thu, 15 Nov 2018 14:31:10 +0800 Subject: [PATCH] Rename HttpApiController to HttpController --- drogon_ctl/create.cc | 4 +- drogon_ctl/create_controller.cc | 30 ++++++------- drogon_ctl/create_controller.h | 10 ++--- examples/simple_example/api_Attachment.h | 4 +- examples/simple_example/api_v1_ApiTest.h | 4 +- examples/simple_example/main.cc | 12 ++--- lib/inc/drogon/HttpAppFramework.h | 14 +++--- .../drogon/{HttpApiBinder.h => HttpBinder.h} | 18 ++++---- .../{HttpApiController.h => HttpController.h} | 12 ++--- lib/inc/drogon/drogon.h | 2 +- lib/inc/drogon/utils/FunctionTraits.h | 4 +- lib/src/HttpAppFrameworkImpl.cc | 44 +++++++++---------- lib/src/HttpAppFrameworkImpl.h | 19 ++++---- 13 files changed, 88 insertions(+), 89 deletions(-) rename lib/inc/drogon/{HttpApiBinder.h => HttpBinder.h} (90%) rename lib/inc/drogon/{HttpApiController.h => HttpController.h} (83%) diff --git a/drogon_ctl/create.cc b/drogon_ctl/create.cc index e4fa03d8..e1bde6be 100755 --- a/drogon_ctl/create.cc +++ b/drogon_ctl/create.cc @@ -25,8 +25,8 @@ std::string create::detail() "drogon_ctl create view //create HttpView source files from csp file\n" "drogon_ctl create controller [-s] [-n ] //" "create HttpSimpleController source files\n" - "drogon_ctl create controller -a <[namespace::]class_name> //" - "create HttpApiController source files\n" + "drogon_ctl create controller -h <[namespace::]class_name> //" + "create HttpController source files\n" "drogon_ctl create controller -w [-n ] //" "create WebSocketController source files\n" "drogon_ctl create project //" diff --git a/drogon_ctl/create_controller.cc b/drogon_ctl/create_controller.cc index 0dc146a0..9b3dbb77 100755 --- a/drogon_ctl/create_controller.cc +++ b/drogon_ctl/create_controller.cc @@ -33,9 +33,9 @@ void create_controller::handleCommand(std::vector ¶meters) parameters.erase(iter); break; } - else if (*iter == "-a" || *iter == "--api") + else if (*iter == "-a" || *iter == "-h" || *iter == "--http") { - type = API; + type = Http; parameters.erase(iter); break; } @@ -125,7 +125,7 @@ void create_controller::handleCommand(std::vector ¶meters) createWebsockController(parameters, namespaceName); } else - createApiController(parameters); + createHttpController(parameters); } void create_controller::createSimpleController(std::vector &ctlNames, const std::string &namespaceName) @@ -311,9 +311,9 @@ void create_controller::newWebsockControllerSourceFile(std::ofstream &file, cons file << "}\n"; } -void create_controller::createApiController(std::vector &apiClasses) +void create_controller::createHttpController(std::vector &httpClasses) { - for (auto iter = apiClasses.begin(); iter != apiClasses.end(); iter++) + for (auto iter = httpClasses.begin(); iter != httpClasses.end(); iter++) { if ((*iter)[0] == '-') { @@ -321,31 +321,31 @@ void create_controller::createApiController(std::vector &apiClasses return; } } - for (auto className : apiClasses) + for (auto className : httpClasses) { - createApiController(className); + createHttpController(className); } } -void create_controller::createApiController(const std::string &className) +void create_controller::createHttpController(const std::string &className) { std::regex regex("::"); std::string ctlName = std::regex_replace(className, regex, std::string("_")); - std::cout << "create api controller:" << className << std::endl; + std::cout << "create http controller:" << className << std::endl; std::string headFileName = ctlName + ".h"; std::string sourceFilename = ctlName + ".cc"; std::ofstream oHeadFile(headFileName.c_str(), std::ofstream::out); std::ofstream oSourceFile(sourceFilename.c_str(), std::ofstream::out); if (!oHeadFile || !oSourceFile) return; - newApiControllerHeaderFile(oHeadFile, className); - newApiControllerSourceFile(oSourceFile, className, ctlName); + newHttpControllerHeaderFile(oHeadFile, className); + newHttpControllerSourceFile(oSourceFile, className, ctlName); } -void create_controller::newApiControllerHeaderFile(std::ofstream &file, const std::string &className) +void create_controller::newHttpControllerHeaderFile(std::ofstream &file, const std::string &className) { file << "#pragma once\n"; - file << "#include \n"; + file << "#include \n"; file << "using namespace drogon;\n"; std::string indent = ""; std::string class_name = className; @@ -361,7 +361,7 @@ void create_controller::newApiControllerHeaderFile(std::ofstream &file, const st indent.append(" "); pos = class_name.find("::"); } - file << indent << "class " << class_name << ":public drogon::HttpApiController<" << class_name << ">\n"; + file << indent << "class " << class_name << ":public drogon::HttpController<" << class_name << ">\n"; file << indent << "{\n"; file << indent << "public:\n"; indent.append(" "); @@ -390,7 +390,7 @@ void create_controller::newApiControllerHeaderFile(std::ofstream &file, const st file << indent << "}\n"; } while (indent != ""); } -void create_controller::newApiControllerSourceFile(std::ofstream &file, const std::string &className, const std::string &filename) +void create_controller::newHttpControllerSourceFile(std::ofstream &file, const std::string &className, const std::string &filename) { file << "#include \"" << filename << ".h\"\n"; auto pos = className.rfind("::"); diff --git a/drogon_ctl/create_controller.h b/drogon_ctl/create_controller.h index e15edfc2..34c5443e 100755 --- a/drogon_ctl/create_controller.h +++ b/drogon_ctl/create_controller.h @@ -29,7 +29,7 @@ class create_controller : public DrObject, public CommandHand enum ControllerType { Simple = 0, - API, + Http, WebSocket }; void createSimpleController(std::vector &ctlNames, const std::string &namespaceName = ""); @@ -37,14 +37,14 @@ class create_controller : public DrObject, public CommandHand void createWebsockController(std::vector &ctlNames, const std::string &namespaceName = ""); void createWebsockController(const std::string &ctlName, const std::string &namespaceName = ""); - void createApiController(std::vector &apiClasses); - void createApiController(const std::string &className); + void createHttpController(std::vector &httpClasses); + void createHttpController(const std::string &className); void newSimpleControllerHeaderFile(std::ofstream &file, const std::string &ctlName, const std::string &namespaceName = ""); void newSimpleControllerSourceFile(std::ofstream &file, const std::string &ctlName, const std::string &namespaceName = ""); void newWebsockControllerHeaderFile(std::ofstream &file, const std::string &ctlName, const std::string &namespaceName = ""); void newWebsockControllerSourceFile(std::ofstream &file, const std::string &ctlName, const std::string &namespaceName = ""); - void newApiControllerHeaderFile(std::ofstream &file, const std::string &className); - void newApiControllerSourceFile(std::ofstream &file, const std::string &className, const std::string &filename); + void newHttpControllerHeaderFile(std::ofstream &file, const std::string &className); + void newHttpControllerSourceFile(std::ofstream &file, const std::string &className, const std::string &filename); }; } // namespace drogon_ctl diff --git a/examples/simple_example/api_Attachment.h b/examples/simple_example/api_Attachment.h index 7da30b13..d788178e 100644 --- a/examples/simple_example/api_Attachment.h +++ b/examples/simple_example/api_Attachment.h @@ -1,9 +1,9 @@ #pragma once -#include +#include using namespace drogon; namespace api { -class Attachment : public drogon::HttpApiController +class Attachment : public drogon::HttpController { public: METHOD_LIST_BEGIN diff --git a/examples/simple_example/api_v1_ApiTest.h b/examples/simple_example/api_v1_ApiTest.h index 63a76748..63d7f2bf 100755 --- a/examples/simple_example/api_v1_ApiTest.h +++ b/examples/simple_example/api_v1_ApiTest.h @@ -1,11 +1,11 @@ #pragma once -#include +#include using namespace drogon; namespace api { namespace v1 { -class ApiTest : public drogon::HttpApiController +class ApiTest : public drogon::HttpController { public: METHOD_LIST_BEGIN diff --git a/examples/simple_example/main.cc b/examples/simple_example/main.cc index b3b00f98..bacb1fc0 100755 --- a/examples/simple_example/main.cc +++ b/examples/simple_example/main.cc @@ -59,7 +59,7 @@ namespace api { namespace v1 { -class Test : public HttpApiController +class Test : public HttpController { public: METHOD_LIST_BEGIN @@ -109,10 +109,10 @@ int main() app().setThreadNum(4); // trantor::Logger::setLogLevel(trantor::Logger::TRACE); //class function - app().registerHttpApiMethod("/api/v1/handle1/{1}/{2}/?p3={3}&p4={4}", &A::handle); - app().registerHttpApiMethod("/api/v1/handle11/{1}/{2}/?p3={3}&p4={4}", &A::staticHandle); + app().registerHttpMethod("/api/v1/handle1/{1}/{2}/?p3={3}&p4={4}", &A::handle); + app().registerHttpMethod("/api/v1/handle11/{1}/{2}/?p3={3}&p4={4}", &A::staticHandle); //lambda example - app().registerHttpApiMethod("/api/v1/handle2/{1}/{2}", [](const HttpRequestPtr &req, const std::function &callback, int a, float b) { + app().registerHttpMethod("/api/v1/handle2/{1}/{2}", [](const HttpRequestPtr &req, const std::function &callback, int a, float b) { LOG_DEBUG << "int a=" << a; LOG_DEBUG << "float b=" << b; HttpViewData data; @@ -127,13 +127,13 @@ int main() B b; //functor example - app().registerHttpApiMethod("/api/v1/handle3/{1}/{2}", b); + app().registerHttpMethod("/api/v1/handle3/{1}/{2}", b); A tmp; std::function &, int, const std::string &, const std::string &, int)> func = std::bind(&A::handle, &tmp, _1, _2, _3, _4, _5, _6); //api example for std::function - app().registerHttpApiMethod("/api/v1/handle4/{4}/{3}/{1}", func); + app().registerHttpMethod("/api/v1/handle4/{4}/{3}/{1}", func); app().setDocumentRoot("./"); app().enableSession(60); diff --git a/lib/inc/drogon/HttpAppFramework.h b/lib/inc/drogon/HttpAppFramework.h index 16abedd6..cca125f6 100755 --- a/lib/inc/drogon/HttpAppFramework.h +++ b/lib/inc/drogon/HttpAppFramework.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -77,15 +77,15 @@ class HttpAppFramework : public trantor::NonCopyable const std::string &crtlName, const std::vector &filtersAndMethods = std::vector()) = 0; template - void registerHttpApiMethod(const std::string &pathPattern, + void registerHttpMethod(const std::string &pathPattern, FUNCTION &&function, const std::vector &filtersAndMethods = std::vector()) { LOG_TRACE << "pathPattern:" << pathPattern; - HttpApiBinderBasePtr binder; + HttpBinderBasePtr binder; binder = std::make_shared< - HttpApiBinder>(std::forward(function)); + HttpBinder>(std::forward(function)); std::vector validMethods; std::vector filters; @@ -111,7 +111,7 @@ class HttpAppFramework : public trantor::NonCopyable } } - registerHttpApiController(pathPattern, binder, validMethods, filters); + registerHttpController(pathPattern, binder, validMethods, filters); } virtual void enableSession(const size_t timeout = 0) = 0; virtual void disableSession() = 0; @@ -139,8 +139,8 @@ class HttpAppFramework : public trantor::NonCopyable virtual void setIdleConnectionTimeout(size_t timeout) = 0; private: - virtual void registerHttpApiController(const std::string &pathPattern, - const HttpApiBinderBasePtr &binder, + virtual void registerHttpController(const std::string &pathPattern, + const HttpBinderBasePtr &binder, const std::vector &validMethods = std::vector(), const std::vector &filters = std::vector()) = 0; }; diff --git a/lib/inc/drogon/HttpApiBinder.h b/lib/inc/drogon/HttpBinder.h similarity index 90% rename from lib/inc/drogon/HttpApiBinder.h rename to lib/inc/drogon/HttpBinder.h index c03144e4..763013ea 100755 --- a/lib/inc/drogon/HttpApiBinder.h +++ b/lib/inc/drogon/HttpBinder.h @@ -56,25 +56,25 @@ struct BinderArgTypeTraits static const bool isValid = true; }; -class HttpApiBinderBase +class HttpBinderBase { public: - virtual void handleHttpApiRequest(std::list &pathParameter, + virtual void handleHttpRequest(std::list &pathParameter, const HttpRequestPtr &req, std::function callback) = 0; virtual size_t paramCount() = 0; - virtual ~HttpApiBinderBase() {} + virtual ~HttpBinderBase() {} protected: static std::map> _objMap; static std::mutex _objMutex; }; -typedef std::shared_ptr HttpApiBinderBasePtr; +typedef std::shared_ptr HttpBinderBasePtr; template -class HttpApiBinder : public HttpApiBinderBase +class HttpBinder : public HttpBinderBase { public: typedef FUNCTION FunctionType; - virtual void handleHttpApiRequest(std::list &pathParameter, + virtual void handleHttpRequest(std::list &pathParameter, const HttpRequestPtr &req, std::function callback) override { run(pathParameter, req, callback); @@ -83,13 +83,13 @@ class HttpApiBinder : public HttpApiBinderBase { return traits::arity; } - HttpApiBinder(FUNCTION &&func) : _func(std::forward(func)) + HttpBinder(FUNCTION &&func) : _func(std::forward(func)) { - static_assert(traits::isHTTPApiFunction, "Your API handler function interface is wrong!"); + static_assert(traits::isHTTPFunction, "Your API handler function interface is wrong!"); } void test() { - std::cout << "argument_count=" << argument_count << " " << traits::isHTTPApiFunction << std::endl; + std::cout << "argument_count=" << argument_count << " " << traits::isHTTPFunction << std::endl; } private: diff --git a/lib/inc/drogon/HttpApiController.h b/lib/inc/drogon/HttpController.h similarity index 83% rename from lib/inc/drogon/HttpApiController.h rename to lib/inc/drogon/HttpController.h index 930bf83e..bb67c6b9 100755 --- a/lib/inc/drogon/HttpApiController.h +++ b/lib/inc/drogon/HttpController.h @@ -39,7 +39,7 @@ namespace drogon { template -class HttpApiController : public DrObject +class HttpController : public DrObject { protected: template @@ -47,8 +47,8 @@ class HttpApiController : public DrObject const std::string &pattern, const std::vector &filtersAndMethods = std::vector()) { - std::string path = std::string("/") + HttpApiController::classTypeName(); - LOG_TRACE << "classname:" << HttpApiController::classTypeName(); + std::string path = std::string("/") + HttpController::classTypeName(); + LOG_TRACE << "classname:" << HttpController::classTypeName(); //transform(path.begin(), path.end(), path.begin(), tolower); std::string::size_type pos; @@ -57,11 +57,11 @@ class HttpApiController : public DrObject path.replace(pos, 2, "/"); } if (pattern.empty() || pattern[0] == '/') - app().registerHttpApiMethod(path + pattern, + app().registerHttpMethod(path + pattern, std::forward(function), filtersAndMethods); else - app().registerHttpApiMethod(path + "/" + pattern, + app().registerHttpMethod(path + "/" + pattern, std::forward(function), filtersAndMethods); } @@ -83,5 +83,5 @@ class HttpApiController : public DrObject } }; template -typename HttpApiController::methodRegister HttpApiController::_register; +typename HttpController::methodRegister HttpController::_register; } // namespace drogon diff --git a/lib/inc/drogon/drogon.h b/lib/inc/drogon/drogon.h index 7664abf6..1232f3d0 100644 --- a/lib/inc/drogon/drogon.h +++ b/lib/inc/drogon/drogon.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/inc/drogon/utils/FunctionTraits.h b/lib/inc/drogon/utils/FunctionTraits.h index 28f98e11..6452a0e6 100755 --- a/lib/inc/drogon/utils/FunctionTraits.h +++ b/lib/inc/drogon/utils/FunctionTraits.h @@ -76,7 +76,7 @@ template < struct FunctionTraits< ReturnType (*)(const HttpRequestPtr &req, const std::function &callback, Arguments...)> : FunctionTraits { - static const bool isHTTPApiFunction = true; + static const bool isHTTPFunction = true; }; //normal function @@ -95,7 +95,7 @@ struct FunctionTraits< static const std::size_t arity = sizeof...(Arguments); - static const bool isHTTPApiFunction = false; + static const bool isHTTPFunction = false; static const bool isClassFunction = false; static const std::string name() { return std::string("Normal or Static Function"); } }; diff --git a/lib/src/HttpAppFrameworkImpl.cc b/lib/src/HttpAppFrameworkImpl.cc index 62b2ce13..ef25f825 100755 --- a/lib/src/HttpAppFrameworkImpl.cc +++ b/lib/src/HttpAppFrameworkImpl.cc @@ -42,8 +42,8 @@ using namespace drogon; using namespace std::placeholders; -std::map> HttpApiBinderBase::_objMap; -std::mutex HttpApiBinderBase::_objMutex; +std::map> HttpBinderBase::_objMap; +std::mutex HttpBinderBase::_objMutex; static void godaemon(void) { @@ -108,7 +108,7 @@ void HttpAppFrameworkImpl::setFileTypes(const std::vector &types) void HttpAppFrameworkImpl::initRegex() { std::string regString; - for (auto &binder : _apiCtrlVector) + for (auto &binder : _ctrlVector) { std::regex reg("\\(\\[\\^/\\]\\*\\)"); std::string tmp = std::regex_replace(binder.pathParameterPattern, reg, "[^/]*"); @@ -118,7 +118,7 @@ void HttpAppFrameworkImpl::initRegex() if (regString.length() > 0) regString.resize(regString.length() - 1); //remove the last '|' LOG_TRACE << "regex string:" << regString; - _apiRegex = std::regex(regString, std::regex_constants::icase); + _ctrlRegex = std::regex(regString, std::regex_constants::icase); } void HttpAppFrameworkImpl::registerWebSocketController(const std::string &pathName, const std::string &ctrlName, @@ -182,8 +182,8 @@ void HttpAppFrameworkImpl::registerHttpSimpleController(const std::string &pathN } } } -void HttpAppFrameworkImpl::addApiPath(const std::string &path, - const HttpApiBinderBasePtr &binder, +void HttpAppFrameworkImpl::addHttpPath(const std::string &path, + const HttpBinderBasePtr &binder, const std::vector &validMethods, const std::vector &filters) { @@ -235,7 +235,7 @@ void HttpAppFrameworkImpl::addApiPath(const std::string &path, paras = results.suffix(); } } - struct ApiBinder _binder; + struct CtrlBinder _binder; _binder.parameterPlaces = std::move(places); _binder.queryParametersPlaces = std::move(parametersPlaces); _binder.binderPtr = binder; @@ -250,12 +250,12 @@ void HttpAppFrameworkImpl::addApiPath(const std::string &path, } } { - std::lock_guard guard(_apiCtrlMutex); - _apiCtrlVector.push_back(std::move(_binder)); + std::lock_guard guard(_ctrlMutex); + _ctrlVector.push_back(std::move(_binder)); } } -void HttpAppFrameworkImpl::registerHttpApiController(const std::string &pathPattern, - const HttpApiBinderBasePtr &binder, +void HttpAppFrameworkImpl::registerHttpController(const std::string &pathPattern, + const HttpBinderBasePtr &binder, const std::vector &validMethods, const std::vector &filters) { @@ -264,7 +264,7 @@ void HttpAppFrameworkImpl::registerHttpApiController(const std::string &pathPatt std::string path(pathPattern); //std::transform(path.begin(), path.end(), path.begin(), tolower); - addApiPath(path, binder, validMethods, filters); + addHttpPath(path, binder, validMethods, filters); } void HttpAppFrameworkImpl::setThreadNum(size_t threadNum) { @@ -1012,22 +1012,22 @@ void HttpAppFrameworkImpl::onAsyncRequest(const HttpRequestPtr &req, const std:: }); return; } - //find api controller - if (_apiRegex.mark_count() > 0) + //find http controller + if (_ctrlRegex.mark_count() > 0) { std::smatch result; - if (std::regex_match(req->path(), result, _apiRegex)) + if (std::regex_match(req->path(), result, _ctrlRegex)) { for (size_t i = 1; i < result.size(); i++) { //FIXME:Is there any better way to find the sub-match index without using loop? if (!result[i].matched) continue; - if (result[i].str() == req->path() && i <= _apiCtrlVector.size()) + if (result[i].str() == req->path() && i <= _ctrlVector.size()) { size_t ctlIndex = i - 1; - auto &binder = _apiCtrlVector[ctlIndex]; - LOG_TRACE << "got api access,regex=" << binder.pathParameterPattern; + auto &binder = _ctrlVector[ctlIndex]; + //LOG_TRACE << "got http access,regex=" << binder.pathParameterPattern; if (binder._validMethodsFlags.size() > 0) { assert(binder._validMethodsFlags.size() > req->method()); @@ -1042,7 +1042,7 @@ void HttpAppFrameworkImpl::onAsyncRequest(const HttpRequestPtr &req, const std:: } auto &filters = binder.filtersName; doFilters(filters, req, callback, needSetJsessionid, session_id, [=]() { - auto &binder = _apiCtrlVector[ctlIndex]; + auto &binder = _ctrlVector[ctlIndex]; HttpResponsePtr responsePtr; { @@ -1102,15 +1102,15 @@ void HttpAppFrameworkImpl::onAsyncRequest(const HttpRequestPtr &req, const std:: paraList.push_back(std::move(p)); } - binder.binderPtr->handleHttpApiRequest(paraList, req, [=](const HttpResponsePtr &resp) { - LOG_TRACE << "api resp:needSetJsessionid=" << needSetJsessionid << ";JSESSIONID=" << session_id; + binder.binderPtr->handleHttpRequest(paraList, req, [=](const HttpResponsePtr &resp) { + LOG_TRACE << "http resp:needSetJsessionid=" << needSetJsessionid << ";JSESSIONID=" << session_id; auto newResp = resp; if (resp->expiredTime() >= 0) { //cache the response; std::dynamic_pointer_cast(resp)->makeHeaderString(); { - auto &binderIterm = _apiCtrlVector[ctlIndex]; + auto &binderIterm = _ctrlVector[ctlIndex]; std::lock_guard guard(*(binderIterm.binderMtx)); _responseCacheMap->insert(binderIterm.pathParameterPattern, resp, resp->expiredTime()); binderIterm.responsePtr = resp; diff --git a/lib/src/HttpAppFrameworkImpl.h b/lib/src/HttpAppFrameworkImpl.h index bb8e17a0..1178875b 100644 --- a/lib/src/HttpAppFrameworkImpl.h +++ b/lib/src/HttpAppFrameworkImpl.h @@ -87,8 +87,8 @@ class HttpAppFrameworkImpl : public HttpAppFramework trantor::EventLoop *loop(); private: - virtual void registerHttpApiController(const std::string &pathPattern, - const HttpApiBinderBasePtr &binder, + virtual void registerHttpController(const std::string &pathPattern, + const HttpBinderBasePtr &binder, const std::vector &validMethods = std::vector(), const std::vector &filters = std::vector()) override; @@ -101,8 +101,8 @@ class HttpAppFrameworkImpl : public HttpAppFramework void onWebsockDisconnect(const WebSocketConnectionPtr &wsConnPtr); void onConnection(const TcpConnectionPtr &conn); void readSendFile(const std::string &filePath, const HttpRequestPtr &req, const HttpResponsePtr &resp); - void addApiPath(const std::string &path, - const HttpApiBinderBasePtr &binder, + void addHttpPath(const std::string &path, + const HttpBinderBasePtr &binder, const std::vector &validMethods, const std::vector &filters); void initRegex(); @@ -148,23 +148,22 @@ class HttpAppFrameworkImpl : public HttpAppFramework std::unordered_map _websockCtrlMap; std::mutex _websockCtrlMutex; - struct ApiBinder + struct CtrlBinder { std::string pathParameterPattern; std::vector parameterPlaces; std::map queryParametersPlaces; - HttpApiBinderBasePtr binderPtr; + HttpBinderBasePtr binderPtr; std::vector filtersName; std::unique_ptr binderMtx = std::unique_ptr(new std::mutex); std::weak_ptr responsePtr; std::vector _validMethodsFlags; std::regex _regex; }; - //std::unordered_map_apiCtrlMap; - std::vector _apiCtrlVector; - std::mutex _apiCtrlMutex; + std::vector _ctrlVector; + std::mutex _ctrlMutex; - std::regex _apiRegex; + std::regex _ctrlRegex; bool _enableLastModify = true; std::set _fileTypeSet = {"html", "js", "css", "xml", "xsl", "txt", "svg", "ttf", "otf", "woff2", "woff", "eot", "png", "jpg", "jpeg",