EvEmu
0.8.4
11 September 2021
|
#include "utils/Buffer.h"
Go to the source code of this file.
Functions | |
std::string | GenerateKey (size_t length) |
Generates random key. More... | |
bool | IsNumber (char c) |
Checks whether character is a number. More... | |
bool | IsNumber (const char *str, size_t len) |
Checks whether string is a number. More... | |
bool | IsNumber (const std::string &str) |
Checks whether string is a number. More... | |
bool | IsHexNumber (char c) |
Checks whether character is a hexadecimal number. More... | |
bool | IsHexNumber (const char *str, size_t len) |
Checks whether string is a hexadecimal number. More... | |
bool | IsHexNumber (const std::string &str) |
Checks whether string is a hexadecimal number. More... | |
bool | IsPrintable (char c) |
Checks whether character is printable. More... | |
bool | IsPrintable (const char *str, size_t len) |
Checks whether string is printable. More... | |
bool | IsPrintable (const std::string &str) |
Checks whether string is printable. More... | |
const char * | itoa (int64 num) |
Convers num to string. More... | |
void | ListToINString (const std::vector< int32 > &ints, std::string &into, const char *if_empty="") |
void | MakeUpperString (const char *source, char *target) |
toupper() for strings. More... | |
void | MakeLowerString (const char *source, char *target) |
tolower() for strings. More... | |
bool | PyDecodeEscape (const char *str, Buffer &into) |
Decodes string escapes into actual characters. More... | |
void | SearchReplace (std::string &subject, const std::string &search, const std::string &replace) |
Does search & replace on subject. More... | |
void | SplitPath (const std::string &path, std::vector< std::string > &into) |
Splits path to its components. More... | |
Variables | |
const std::string | NULL_STRING |
std::string to use where you would use NULL for const char*. More... | |
std::string GenerateKey | ( | size_t | length | ) |
Generates random key.
[in] | length | Length of key to generate. |
Definition at line 32 of file utils_string.cpp.
References key(), and MakeRandomInt().
bool IsHexNumber | ( | char | c | ) |
Checks whether character is a hexadecimal number.
[in] | c | The character to be checked. |
true | The character is a hexadecimal number. |
false | The character is not a hexadecimal number. |
Definition at line 86 of file utils_string.cpp.
Referenced by Seperator::isHexNumber(), and IsHexNumber().
bool IsHexNumber | ( | const char * | str, |
size_t | len | ||
) |
Checks whether string is a hexadecimal number.
[in] | str | The string to be checked. |
[in] | len | Length of the string. |
true | The string is a hexadecimal number. |
false | The string is not a hexadecimal number. |
Definition at line 91 of file utils_string.cpp.
References IsHexNumber().
bool IsHexNumber | ( | const std::string & | str | ) |
Checks whether string is a hexadecimal number.
[in] | str | The string to be checked. |
true | The string is a hexadecimal number. |
false | The string is not a hexadecimal number. |
Definition at line 128 of file utils_string.cpp.
References IsHexNumber().
bool IsNumber | ( | char | c | ) |
Checks whether character is a number.
[in] | c | The character to be checked. |
true | The character is a number. |
false | The character is not a number. |
Definition at line 45 of file utils_string.cpp.
Referenced by Command_unspawn(), Seperator::isNumber(), and IsNumber().
bool IsNumber | ( | const char * | str, |
size_t | len | ||
) |
Checks whether string is a number.
[in] | str | The string to be checked. |
[in] | len | Length of the string. |
true | The string is a number. |
false | The string is not a number. |
Definition at line 50 of file utils_string.cpp.
References IsNumber().
bool IsNumber | ( | const std::string & | str | ) |
Checks whether string is a number.
[in] | str | The string to be checked. |
true | The string is a number. |
false | The string is not a number. |
Definition at line 81 of file utils_string.cpp.
References IsNumber().
bool IsPrintable | ( | char | c | ) |
Checks whether character is printable.
[in] | c | The character to be checked. |
true | The character is printable. |
false | The character is not printable. |
Definition at line 133 of file utils_string.cpp.
Referenced by IsPrintable().
bool IsPrintable | ( | const char * | str, |
size_t | len | ||
) |
Checks whether string is printable.
[in] | str | String to be checked. |
[in] | len | Length of string. |
true | The string is printable. |
false | The string is not printable. |
Definition at line 141 of file utils_string.cpp.
References IsPrintable().
bool IsPrintable | ( | const std::string & | str | ) |
Checks whether string is printable.
[in] | str | String to be checked. |
true | The string is printable. |
false | The string is not printable. |
Definition at line 152 of file utils_string.cpp.
References IsPrintable().
const char* itoa | ( | int64 | num | ) |
Convers num to string.
[in] | num | The number to be converted. |
Definition at line 159 of file utils_string.cpp.
References _ITOA_BUFLEN, and snprintf.
Referenced by APIAccountManager::_APIKeyRequest(), APICharacterManager::_CharacterSheet(), APIServerManager::_ServerStatus(), APICharacterManager::_SkillInTraining(), APICharacterManager::_SkillQueue(), PlanetSE::CreateCustomsOffice(), APICharacterDB::GetCharacterAttributes(), APICharacterDB::GetCharacterSkillQueue(), APICharacterDB::GetCharacterSkillsTrained(), Sentry::Killed(), CustomsSE::Killed(), NPC::Killed(), DroneSE::Killed(), StructureSE::Killed(), ShipSE::Killed(), Inventory::LoadContents(), DestinyManager::MoveObject(), and ModuleManager::UnloadCharge().
void ListToINString | ( | const std::vector< int32 > & | ints, |
std::string & | into, | ||
const char * | if_empty = "" |
||
) |
function to convert a vector of numbers to a string containing string representatives of those numbers.
[in] | ints | contains the numbers that need to converted. |
[in] | if_empty | is the default value added if ints is empty. |
[out] | into | contains the string representatives of the numbers. |
Definition at line 169 of file utils_string.cpp.
References snprintf.
Referenced by ConfigDB::GetMultiAllianceShortNamesEx(), ConfigDB::GetMultiCorpTickerNamesEx(), ConfigDB::GetMultiGraphicsEx(), ConfigDB::GetMultiInvTypesEx(), ConfigDB::GetMultiLocationsEx(), ConfigDB::GetMultiOwnersEx(), ConfigDB::GetMultiStationEx(), and MissionDB::LoadMissionBookMark().
void MakeLowerString | ( | const char * | source, |
char * | target | ||
) |
tolower() for strings.
[in] | source | Source string. |
[out] | target | Array which receives result. |
Definition at line 212 of file utils_string.cpp.
void MakeUpperString | ( | const char * | source, |
char * | target | ||
) |
toupper() for strings.
[in] | source | Source string. |
[out] | target | Array which receives result. |
Definition at line 201 of file utils_string.cpp.
bool PyDecodeEscape | ( | const char * | str, |
Buffer & | into | ||
) |
Decodes string escapes into actual characters.
Based on PyString_DecodeEscape from Python.
[in] | str | Escaped string. |
[out] | into | The result will be put here. |
true | Decode ran OK. |
false | Error occured during decoding. |
Definition at line 223 of file utils_string.cpp.
References Buffer::Append().
Referenced by DestinyDumpLogText(), and UnmarshalLogText().
void SearchReplace | ( | std::string & | subject, |
const std::string & | search, | ||
const std::string & | replace | ||
) |
Does search & replace on subject.
[in,out] | subject | String to be searched. |
[in] | search | String which shall be replaced. |
[in] | replace | String with which to replace. |
Definition at line 311 of file utils_string.cpp.
Referenced by BaseRowsetReader::iterator::GetAsString().
void SplitPath | ( | const std::string & | path, |
std::vector< std::string > & | into | ||
) |
Splits path to its components.
[in] | path | Path to split. |
[out] | into | Vector which receives components of the path. |
Definition at line 321 of file utils_string.cpp.
Referenced by StuffExtract().
const std::string NULL_STRING |
std::string to use where you would use NULL for const char*.
Definition at line 30 of file utils_string.cpp.