Add option for choosing between std::regex and pcrecpp

This commit is contained in:
Tindy X committed 2019-12-28 03:05:54 +08:00
1 parent fe9a4c06ad
commit 2703435815
2 files changed
+19 -6

No files matched your search

+9 -2
View File
@@ -7,7 +7,12 @@
//#include <filesystem>
#include <unistd.h>
#ifdef USE_STD_REGEX
#include <regex>
#else
#include <pcrecpp.h>
#endif // USE_STD_REGEX
#include <rapidjson/document.h>
#include <openssl/md5.h>
@@ -447,7 +452,7 @@ std::string replace_all_distinct(std::string str, std::string old_value, std::st
return str;
}
/*
#ifdef USE_STD_REGEX
bool regValid(std::string &reg)
{
try
@@ -501,7 +506,8 @@ bool regMatch(std::string src, std::string match)
return false;
}
}
*/
#else
bool regValid(std::string &reg)
{
@@ -560,6 +566,7 @@ bool regMatch(std::string src, std::string match)
return false;
}
}
#endif // USE_STD_REGEX
std::string speedCalc(double speed)
{