AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Common.cpp File Reference
#include "Common.h"

Go to the source code of this file.

Functions

LocaleConstant GetLocaleByName (const std::string &name)
 
const std::string GetNameByLocaleConstant (LocaleConstant localeConstant)
 
void CleanStringForMysqlQuery (std::string &str)
 

Variables

char const * localeNames [TOTAL_LOCALES]
 

Function Documentation

◆ CleanStringForMysqlQuery()

void CleanStringForMysqlQuery ( std::string &  str)
55{
56 std::string::size_type n = 0;
57 while ((n = str.find('\\')) != str.npos) { str.erase(n, 1); }
58 while ((n = str.find('"')) != str.npos) { str.erase(n, 1); }
59 while ((n = str.find('\'')) != str.npos) { str.erase(n, 1); }
60}

Referenced by WorldSession::HandleMailTakeItem(), WorldSession::HandleSendMail(), and Map::LogEncounterFinished().

◆ GetLocaleByName()

◆ GetNameByLocaleConstant()

const std::string GetNameByLocaleConstant ( LocaleConstant  localeConstant)
45{
46 if (localeConstant < TOTAL_LOCALES)
47 {
48 return localeNames[localeConstant];
49 }
50
51 return "enUS"; // Default value for unsupported or invalid LocaleConstant
52}

References localeNames, and TOTAL_LOCALES.

Referenced by server_commandscript::HandleServerSetMotdCommand().

Variable Documentation

◆ localeNames