TrinityCore
|
#include "Define.h"
#include "Errors.h"
#include "Random.h"
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <stdarg.h>
#include <cstring>
#include <ctime>
Go to the source code of this file.
Classes | |
struct | Finder< T, S > |
class | Tokenizer |
class | HookList< T > |
class | flag128 |
Enumerations | |
enum | ComparisionType { COMP_TYPE_EQ = 0, COMP_TYPE_HIGH, COMP_TYPE_LOW, COMP_TYPE_HIGH_EQ, COMP_TYPE_LOW_EQ, COMP_TYPE_MAX } |
Functions | |
TC_COMMON_API void | stripLineInvisibleChars (std::string &src) |
TC_COMMON_API int64 | MoneyStringToMoney (const std::string &moneyString) |
TC_COMMON_API struct tm * | localtime_r (const time_t *time, struct tm *result) |
TC_COMMON_API std::string | secsToTimeString (uint64 timeInSecs, bool shortText=false, bool hoursOnly=false) |
TC_COMMON_API uint32 | TimeStringToSecs (const std::string ×tring) |
TC_COMMON_API std::string | TimeToTimestampStr (time_t t) |
void | ApplyPercentModFloatVar (float &var, float val, bool apply) |
template<class T , class U > | |
T | CalculatePct (T base, U pct) |
template<class T , class U > | |
T | AddPct (T &base, U pct) |
template<class T , class U > | |
T | ApplyPct (T &base, U pct) |
template<class T > | |
T | RoundToInterval (T &num, T floor, T ceil) |
TC_COMMON_API bool | Utf8toWStr (const std::string &utf8str, std::wstring &wstr) |
TC_COMMON_API bool | Utf8toWStr (char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize) |
bool | Utf8toWStr (const std::string &utf8str, wchar_t *wstr, size_t &wsize) |
TC_COMMON_API bool | WStrToUtf8 (std::wstring const &wstr, std::string &utf8str) |
TC_COMMON_API bool | WStrToUtf8 (wchar_t *wstr, size_t size, std::string &utf8str) |
TC_COMMON_API size_t | utf8length (std::string &utf8str) |
TC_COMMON_API void | utf8truncate (std::string &utf8str, size_t len) |
bool | isBasicLatinCharacter (wchar_t wchar) |
bool | isExtendedLatinCharacter (wchar_t wchar) |
bool | isCyrillicCharacter (wchar_t wchar) |
bool | isEastAsianCharacter (wchar_t wchar) |
bool | isNumeric (wchar_t wchar) |
bool | isNumeric (char c) |
bool | isNumeric (char const *str) |
bool | isNumericOrSpace (wchar_t wchar) |
bool | isBasicLatinString (const std::wstring &wstr, bool numericOrSpace) |
bool | isExtendedLatinString (const std::wstring &wstr, bool numericOrSpace) |
bool | isCyrillicString (const std::wstring &wstr, bool numericOrSpace) |
bool | isEastAsianString (const std::wstring &wstr, bool numericOrSpace) |
wchar_t | wcharToUpper (wchar_t wchar) |
wchar_t | wcharToUpperOnlyLatin (wchar_t wchar) |
wchar_t | wcharToLower (wchar_t wchar) |
void | wstrToUpper (std::wstring &str) |
void | wstrToLower (std::wstring &str) |
TC_COMMON_API std::wstring | GetMainPartOfName (std::wstring const &wname, uint32 declension) |
TC_COMMON_API bool | utf8ToConsole (const std::string &utf8str, std::string &conStr) |
TC_COMMON_API bool | consoleToUtf8 (const std::string &conStr, std::string &utf8str) |
TC_COMMON_API bool | Utf8FitTo (const std::string &str, std::wstring const &search) |
TC_COMMON_API void | utf8printf (FILE *out, const char *str,...) |
TC_COMMON_API void | vutf8printf (FILE *out, const char *str, va_list *ap) |
TC_COMMON_API bool | Utf8ToUpperOnlyLatin (std::string &utf8String) |
TC_COMMON_API bool | IsIPAddress (char const *ipaddress) |
Check if the string is a valid ip address representation. More... | |
TC_COMMON_API uint32 | CreatePIDFile (std::string const &filename) |
create PID file More... | |
TC_COMMON_API uint32 | GetPID () |
TC_COMMON_API std::string | ByteArrayToHexStr (uint8 const *bytes, uint32 length, bool reverse=false) |
TC_COMMON_API void | HexStrToByteArray (std::string const &str, uint8 *out, bool reverse=false) |
TC_COMMON_API bool | StringToBool (std::string const &str) |
template<class T > | |
bool | CompareValues (ComparisionType type, T val1, T val2) |
enum ComparisionType |
|
inline |
|
inline |
|
inline |
TC_COMMON_API std::string ByteArrayToHexStr | ( | uint8 const * | bytes, |
uint32 | length, | ||
bool | reverse = false |
||
) |
|
inline |
bool CompareValues | ( | ComparisionType | type, |
T | val1, | ||
T | val2 | ||
) |
TC_COMMON_API bool consoleToUtf8 | ( | const std::string & | conStr, |
std::string & | utf8str | ||
) |
TC_COMMON_API uint32 CreatePIDFile | ( | std::string const & | filename | ) |
create PID file
TC_COMMON_API std::wstring GetMainPartOfName | ( | std::wstring const & | wname, |
uint32 | declension | ||
) |
TC_COMMON_API uint32 GetPID | ( | ) |
TC_COMMON_API void HexStrToByteArray | ( | std::string const & | str, |
uint8 * | out, | ||
bool | reverse = false |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
TC_COMMON_API bool IsIPAddress | ( | char const * | ipaddress | ) |
Check if the string is a valid ip address representation.
|
inline |
|
inline |
|
inline |
TC_COMMON_API struct tm* localtime_r | ( | const time_t * | time, |
struct tm * | result | ||
) |
TC_COMMON_API int64 MoneyStringToMoney | ( | const std::string & | moneyString | ) |
|
inline |
TC_COMMON_API std::string secsToTimeString | ( | uint64 | timeInSecs, |
bool | shortText = false , |
||
bool | hoursOnly = false |
||
) |
TC_COMMON_API bool StringToBool | ( | std::string const & | str | ) |
TC_COMMON_API void stripLineInvisibleChars | ( | std::string & | src | ) |
TC_COMMON_API uint32 TimeStringToSecs | ( | const std::string & | timestring | ) |
TC_COMMON_API std::string TimeToTimestampStr | ( | time_t | t | ) |
TC_COMMON_API bool Utf8FitTo | ( | const std::string & | str, |
std::wstring const & | search | ||
) |
TC_COMMON_API size_t utf8length | ( | std::string & | utf8str | ) |
TC_COMMON_API void utf8printf | ( | FILE * | out, |
const char * | str, | ||
... | |||
) |
TC_COMMON_API bool utf8ToConsole | ( | const std::string & | utf8str, |
std::string & | conStr | ||
) |
TC_COMMON_API bool Utf8ToUpperOnlyLatin | ( | std::string & | utf8String | ) |
TC_COMMON_API bool Utf8toWStr | ( | const std::string & | utf8str, |
std::wstring & | wstr | ||
) |
TC_COMMON_API bool Utf8toWStr | ( | char const * | utf8str, |
size_t | csize, | ||
wchar_t * | wstr, | ||
size_t & | wsize | ||
) |
TC_COMMON_API void utf8truncate | ( | std::string & | utf8str, |
size_t | len | ||
) |
TC_COMMON_API void vutf8printf | ( | FILE * | out, |
const char * | str, | ||
va_list * | ap | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
TC_COMMON_API bool WStrToUtf8 | ( | std::wstring const & | wstr, |
std::string & | utf8str | ||
) |
TC_COMMON_API bool WStrToUtf8 | ( | wchar_t * | wstr, |
size_t | size, | ||
std::string & | utf8str | ||
) |