diff options
author | Treeston <treeston.mmoc@gmail.com> | 2018-10-26 14:43:22 +0200 |
---|---|---|
committer | Treeston <treeston.mmoc@gmail.com> | 2018-10-26 14:43:22 +0200 |
commit | 338e8ba0fea8b4b15120c96fff15a6c4b1a52593 (patch) | |
tree | b9a9fce959447317011252c4b38d5519667ab3d1 /src/common/Utilities/Util.h | |
parent | 0a0312b705ecb1a318fd3abe545b571a3a349a9c (diff) |
Core/Misc: Partial merge of 3.3.5-dbedit:
- Added SmartEnum.h for enum iteration, stringification, and more, courtesy of krabicezpapundeklu/smart_enum
- Moved a bunch of enums in SharedDefines.h to the new system
- Miscellaneous utility methods ported
Diffstat (limited to 'src/common/Utilities/Util.h')
-rw-r--r-- | src/common/Utilities/Util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 549984f0e65..992cbc5d788 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -24,6 +24,7 @@ #include <string> #include <sstream> +#include <utility> #include <vector> class TC_COMMON_API Tokenizer @@ -299,6 +300,11 @@ TC_COMMON_API void HexStrToByteArray(std::string const& str, uint8* out, bool re TC_COMMON_API bool StringToBool(std::string const& str); TC_COMMON_API bool StringContainsStringI(std::string const& haystack, std::string const& needle); +template <typename T> +inline bool ValueContainsStringI(std::pair<T, std::string> const& haystack, std::string const& needle) +{ + return StringContainsStringI(haystack.second, needle); +} // simple class for not-modifyable list template <typename T> |