string manipulation moved to utils
This commit is contained in:
parent
43b66ba7f8
commit
e4619ee6a1
@ -172,6 +172,30 @@ namespace util
|
||||
return tokens;
|
||||
}
|
||||
|
||||
std::string SplitWords(const std::string& value)
|
||||
{
|
||||
std::stringstream outStream;
|
||||
std::stringstream inStream(value);
|
||||
|
||||
char ch;
|
||||
inStream >> ch;
|
||||
outStream << ch;
|
||||
while (inStream >> ch)
|
||||
{
|
||||
if (isupper(ch))
|
||||
outStream << " ";
|
||||
outStream << ch;
|
||||
}
|
||||
return outStream.str();
|
||||
}
|
||||
|
||||
std::string MakeCapital(std::string value)
|
||||
{
|
||||
if (islower(value[0]))
|
||||
value[0] = toupper(value[0]);
|
||||
return value;
|
||||
}
|
||||
|
||||
static const std::string base64_chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
|
@ -37,6 +37,8 @@ namespace util
|
||||
int64_t GetCurrentTimeMillisec();
|
||||
|
||||
std::vector<std::string> StringSplit(const std::string& delimiter, const std::string& content);
|
||||
std::string SplitWords(const std::string& value);
|
||||
std::string MakeCapital(std::string value);
|
||||
std::string to_hex_string(uint8_t* barray, int length);
|
||||
bool IsLittleEndian();
|
||||
|
||||
|
@ -409,31 +409,7 @@ namespace cheat::feature
|
||||
return;
|
||||
}
|
||||
|
||||
std::string SplitWords(const std::string& value)
|
||||
{
|
||||
std::stringstream outStream;
|
||||
std::stringstream inStream(value);
|
||||
|
||||
char ch;
|
||||
inStream >> ch;
|
||||
outStream << ch;
|
||||
while (inStream >> ch)
|
||||
{
|
||||
if (isupper(ch))
|
||||
outStream << " ";
|
||||
outStream << ch;
|
||||
}
|
||||
return outStream.str();
|
||||
}
|
||||
|
||||
std::string MakeCapital(std::string value)
|
||||
{
|
||||
if (islower(value[0]))
|
||||
value[0] = toupper(value[0]);
|
||||
return value;
|
||||
}
|
||||
|
||||
#define ADD_FILTER_FIELD(section, name) AddFilter(MakeCapital(#section), SplitWords(#name), &game::filters::##section##::##name##)
|
||||
#define ADD_FILTER_FIELD(section, name) AddFilter(util::MakeCapital(#section), util::SplitWords(#name), &game::filters::##section##::##name##)
|
||||
void ESP::InstallFilters()
|
||||
{
|
||||
ADD_FILTER_FIELD(collection, Book);
|
||||
|
Loading…
Reference in New Issue
Block a user