/* * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 * Copyright (C) 2021+ WarheadCore */ #ifndef _ACORE_TOKENIZE_H_ #define _ACORE_TOKENIZE_H_ #include "Common.h" #include #include namespace Acore { std::vector Tokenize(std::string_view str, char sep, bool keepEmpty); /* this would return string_view into temporary otherwise */ std::vector Tokenize(std::string&&, char, bool) = delete; std::vector Tokenize(std::string const&&, char, bool) = delete; /* the delete overload means we need to make this explicit */ inline std::vector Tokenize(char const* str, char sep, bool keepEmpty) { return Tokenize(std::string_view(str ? str : ""), sep, keepEmpty); } } #endif // _ACORE_TOKENIZE_H_