aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-07-28 08:48:48 +0200
committerShauren <shauren.trinity@gmail.com>2016-07-28 08:48:48 +0200
commit943496e56b648b050ba6e38d83a8161255c1d537 (patch)
tree21202f5d9c51057e281f24d0dbc2da6c2f40749e
parent60a6d9c85d8b5ddc227b52f828cf5fc9955626d8 (diff)
Dep: Remove boost regex dependency and replace its uses with std regex (works since gcc 4.9)
-rw-r--r--dep/boost/CMakeLists.txt2
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp16
-rw-r--r--src/server/game/DataStores/DB2Stores.h4
3 files changed, 11 insertions, 11 deletions
diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt
index 764953ab587..fc20347c2c8 100644
--- a/dep/boost/CMakeLists.txt
+++ b/dep/boost/CMakeLists.txt
@@ -26,7 +26,7 @@ if(WIN32)
set(Boost_USE_STATIC_RUNTIME OFF)
endif()
-find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams regex)
+find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams)
# Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index c79a25cc23b..d6dc6630581 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -653,7 +653,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
{
ASSERT(namesProfanity->Language < TOTAL_LOCALES || namesProfanity->Language == -1);
if (namesProfanity->Language != -1)
- _nameValidators[namesProfanity->Language].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ _nameValidators[namesProfanity->Language].emplace_back(namesProfanity->Name, std::regex::icase | std::regex::optimize);
else
{
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
@@ -661,13 +661,13 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
if (i == LOCALE_none)
continue;
- _nameValidators[i].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ _nameValidators[i].emplace_back(namesProfanity->Name, std::regex::icase | std::regex::optimize);
}
}
}
for (NamesReservedEntry const* namesReserved : sNamesReservedStore)
- _nameValidators[TOTAL_LOCALES].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ _nameValidators[TOTAL_LOCALES].emplace_back(namesReserved->Name, std::regex::icase | std::regex::optimize);
for (NamesReservedLocaleEntry const* namesReserved : sNamesReservedLocaleStore)
{
@@ -678,7 +678,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
continue;
if (namesReserved->LocaleMask & (1 << i))
- _nameValidators[i].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ _nameValidators[i].emplace_back(namesReserved->Name, std::regex::icase | std::regex::optimize);
}
}
@@ -1262,13 +1262,13 @@ std::string DB2Manager::GetNameGenEntry(uint8 race, uint8 gender, LocaleConstant
ResponseCodes DB2Manager::ValidateName(std::string const& name, LocaleConstant locale) const
{
- for (boost::regex const& regex : _nameValidators[locale])
- if (boost::regex_search(name, regex))
+ for (std::regex const& regex : _nameValidators[locale])
+ if (std::regex_search(name, regex))
return CHAR_NAME_PROFANE;
// regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific
- for (boost::regex const& regex : _nameValidators[TOTAL_LOCALES])
- if (boost::regex_search(name, regex))
+ for (std::regex const& regex : _nameValidators[TOTAL_LOCALES])
+ if (std::regex_search(name, regex))
return CHAR_NAME_RESERVED;
return CHAR_NAME_SUCCESS;
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index 06ed6c724f2..6eacd323fd5 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -21,7 +21,7 @@
#include "DB2Store.h"
#include "DB2Structure.h"
#include "SharedDefines.h"
-#include <boost/regex.hpp>
+#include <regex>
TC_GAME_API extern DB2Storage<AchievementEntry> sAchievementStore;
TC_GAME_API extern DB2Storage<AnimKitEntry> sAnimKitStore;
@@ -241,7 +241,7 @@ public:
typedef std::set<MountTypeXCapabilityEntry const*, MountTypeXCapabilityEntryComparator> MountTypeXCapabilitySet;
typedef std::unordered_map<uint32, MountTypeXCapabilitySet> MountCapabilitiesByTypeContainer;
typedef std::unordered_map<uint32, std::array<std::vector<NameGenEntry const*>, 2>> NameGenContainer;
- typedef std::array<std::vector<boost::regex>, TOTAL_LOCALES + 1> NameValidationRegexContainer;
+ typedef std::array<std::vector<std::regex>, TOTAL_LOCALES + 1> NameValidationRegexContainer;
typedef std::unordered_map<uint32, std::set<uint32>> PhaseGroupContainer;
typedef std::unordered_map<uint32, std::vector<QuestPackageItemEntry const*>> QuestPackageItemContainer;
typedef std::unordered_map<uint32, uint32> RulesetItemUpgradeContainer;