mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
feat(Core/Logging): rework logging (#4692)
* feat(Core/Logging): rework logging * correct level for sql.sql * del unused config options * Correct build * correct after merge * whitespace 20:29:37 1. 'Player.cpp'. Replace (1) 20:29:37 2. 'ObjectMgr.cpp'. Replace (3) * 1 * correct logging * correct affter merge * 1 * 2 * LOG_LEVEL_WARN * #include "AppenderDB.h" * 3 * 4 * 5 * 1. 'WorldSocket.cpp'. Replace (1) * 6 * 1
This commit is contained in:
25
src/common/Utilities/Tokenize.cpp
Normal file
25
src/common/Utilities/Tokenize.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
* Copyright (C) 2021+ WarheadCore <https://github.com/WarheadCore>
|
||||
*/
|
||||
|
||||
#include "Tokenize.h"
|
||||
|
||||
std::vector<std::string_view> acore::Tokenize(std::string_view str, char sep, bool keepEmpty)
|
||||
{
|
||||
std::vector<std::string_view> tokens;
|
||||
|
||||
size_t start = 0;
|
||||
for (size_t end = str.find(sep); end != std::string_view::npos; end = str.find(sep, start))
|
||||
{
|
||||
if (keepEmpty || (start < end))
|
||||
tokens.push_back(str.substr(start, end - start));
|
||||
|
||||
start = end + 1;
|
||||
}
|
||||
|
||||
if (keepEmpty || (start < str.length()))
|
||||
tokens.push_back(str.substr(start));
|
||||
|
||||
return tokens;
|
||||
}
|
||||
Reference in New Issue
Block a user