mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
feat(Core/Common): delete old Tokenizer (#10121)
This commit is contained in:
@@ -31,44 +31,6 @@
|
||||
#include <string>
|
||||
#include <utf8.h>
|
||||
|
||||
Tokenizer::Tokenizer(const std::string& src, const char sep, uint32 vectorReserve)
|
||||
{
|
||||
m_str = new char[src.length() + 1];
|
||||
memcpy(m_str, src.c_str(), src.length() + 1);
|
||||
|
||||
if (vectorReserve)
|
||||
{
|
||||
m_storage.reserve(vectorReserve);
|
||||
}
|
||||
|
||||
char* posold = m_str;
|
||||
char* posnew = m_str;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (*posnew == sep)
|
||||
{
|
||||
m_storage.push_back(posold);
|
||||
posold = posnew + 1;
|
||||
|
||||
*posnew = '\0';
|
||||
}
|
||||
else if (*posnew == '\0')
|
||||
{
|
||||
// Hack like, but the old code accepted these kind of broken strings,
|
||||
// so changing it would break other things
|
||||
if (posold != posnew)
|
||||
{
|
||||
m_storage.push_back(posold);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
++posnew;
|
||||
}
|
||||
}
|
||||
|
||||
void stripLineInvisibleChars(std::string& str)
|
||||
{
|
||||
static std::string const invChars = " \t\7\n";
|
||||
|
||||
Reference in New Issue
Block a user