![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "Util.h"#include "Common.h"#include "Containers.h"#include "IpAddress.h"#include "StringConvert.h"#include "Tokenize.h"#include <algorithm>#include <boost/core/demangle.hpp>#include <cctype>#include <cstdarg>#include <sstream>#include <string>#include <utf8.h>Go to the source code of this file.
Functions | |
| void | stripLineInvisibleChars (std::string &str) |
| std::string | secsToTimeString (uint64 timeInSecs, bool shortText) |
| Optional< int32 > | MoneyStringToMoney (std::string_view moneyString) |
| uint32 | TimeStringToSecs (const std::string ×tring) |
| bool | IsIPAddress (char const *ipaddress) |
| Check if the string is a valid ip address representation. | |
| uint32 | CreatePIDFile (std::string const &filename) |
| create PID file | |
| uint32 | GetPID () |
| std::size_t | utf8length (std::string &utf8str) |
| void | utf8truncate (std::string &utf8str, std::size_t len) |
| bool | Utf8toWStr (char const *utf8str, std::size_t csize, wchar_t *wstr, std::size_t &wsize) |
| bool | Utf8toWStr (std::string_view utf8str, std::wstring &wstr) |
| bool | WStrToUtf8 (wchar_t const *wstr, std::size_t size, std::string &utf8str) |
| bool | WStrToUtf8 (std::wstring_view wstr, std::string &utf8str) |
| void | wstrToUpper (std::wstring &str) |
| void | wstrToLower (std::wstring &str) |
| void | strToUpper (std::string &str) |
| void | strToLower (std::string &str) |
| std::wstring | GetMainPartOfName (std::wstring const &wname, uint32_t declension) |
| bool | utf8ToConsole (std::string_view utf8str, std::string &conStr) |
| bool | consoleToUtf8 (std::string_view conStr, std::string &utf8str) |
| bool | Utf8FitTo (std::string_view str, std::wstring_view search) |
| void | utf8printf (FILE *out, const char *str,...) |
| void | vutf8printf (FILE *out, const char *str, va_list *ap) |
| bool | Utf8ToUpperOnlyLatin (std::string &utf8String) |
| bool | StringEqualI (std::string_view a, std::string_view b) |
| bool | StringContainsStringI (std::string_view haystack, std::string_view needle) |
| bool | StringCompareLessI (std::string_view a, std::string_view b) |
| std::string | GetTypeName (std::type_info const &info) |
| bool consoleToUtf8 | ( | std::string_view | conStr, |
| std::string & | utf8str | ||
| ) |
References WStrToUtf8().
Referenced by Acore::ACLogSink< T >::write().
| uint32 CreatePIDFile | ( | std::string const & | filename | ) |
| std::wstring GetMainPartOfName | ( | std::wstring const & | wname, |
| uint32_t | declension | ||
| ) |
References isCyrillicCharacter().
Referenced by ObjectMgr::CheckDeclinedNames().
| uint32 GetPID | ( | ) |
Referenced by CreatePIDFile().
| std::string GetTypeName | ( | std::type_info const & | info | ) |
| bool IsIPAddress | ( | char const * | ipaddress | ) |
Check if the string is a valid ip address representation.
Referenced by ban_commandscript::HandleBanHelper(), ban_commandscript::HandleBanInfoIPCommand(), and ban_commandscript::HandleUnBanHelper().
References Acore::Tokenize().
Referenced by modify_commandscript::HandleModifyMoneyCommand().
| std::string secsToTimeString | ( | uint64 | timeInSecs, |
| bool | shortText | ||
| ) |
References DAY, HOUR, and MINUTE.
Referenced by BanMgr::BanAccount(), BanMgr::BanAccountByPlayerName(), BanMgr::BanCharacter(), BanMgr::BanIP(), GmTicket::FormatMessageString(), ban_commandscript::HandleBanCharacterCommand(), ban_commandscript::HandleBanHelper(), ban_commandscript::HandleBanInfoCharacterCommand(), ban_commandscript::HandleBanInfoHelper(), ban_commandscript::HandleBanInfoIPCommand(), deserter_commandscript::HandleDeserterAdd(), deserter_commandscript::HandleDeserterRemove(), deserter_commandscript::HandleDeserterRemoveAll(), event_commandscript::HandleEventInfoCommand(), gobject_commandscript::HandleGameObjectTargetCommand(), instance_commandscript::HandleInstanceListBindsCommand(), instance_commandscript::HandleInstanceUnbindCommand(), WorldSession::HandleMessagechatOpcode(), misc_commandscript::HandleMuteCommand(), npc_commandscript::HandleNpcInfoCommand(), npc_commandscript::HandleNpcSetSpawnTimeCommand(), misc_commandscript::HandlePInfoCommand(), server_commandscript::HandleServerInfoCommand(), WorldSession::HandleTextEmoteOpcode(), main(), GmTicket::SetChatLog(), World::ShutdownMsg(), and World::ShutdownServ().
| bool StringCompareLessI | ( | std::string_view | a, |
| std::string_view | b | ||
| ) |
Referenced by StringCompareLessI_T::operator()().
| bool StringContainsStringI | ( | std::string_view | haystack, |
| std::string_view | needle | ||
| ) |
Referenced by arena_commandscript::HandleArenaLookupCommand(), and ValueContainsStringI().
| bool StringEqualI | ( | std::string_view | a, |
| std::string_view | b | ||
| ) |
Referenced by Acore::Impl::StringConvertImpl::For< T, std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool > > >::FromString(), Acore::Impl::StringConvertImpl::For< bool, void >::FromString(), Acore::Impl::StringConvertImpl::For< T, std::enable_if_t< std::is_floating_point_v< T > > >::FromString(), Acore::Impl::ChatCommands::ChatCommandNode::GetAutoCompletionsFor(), Field::GetData(), GuildMgr::GetGuildByName(), misc_commandscript::HandleLinkGraveCommand(), modify_commandscript::HandleModifyGenderCommand(), misc_commandscript::HandleNearGraveCommand(), Acore::Impl::ChatCommands::ArgInfo< T, std::enable_if_t< std::is_enum_v< T > > >::Match(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelpFor(), StringStartsWithI(), Acore::ChatCommands::ExactSequence< chars >::TryConsume(), and Acore::Impl::ChatCommands::ChatCommandNode::TryExecuteCommand().
| void stripLineInvisibleChars | ( | std::string & | str | ) |
| void strToLower | ( | std::string & | str | ) |
References charToLower().
Referenced by ExtractGameobjectModels().
| void strToUpper | ( | std::string & | str | ) |
References charToUpper().
| uint32 TimeStringToSecs | ( | const std::string & | timestring | ) |
References DAY, HOUR, and MINUTE.
Referenced by BanMgr::BanAccount(), BanMgr::BanAccountByPlayerName(), BanMgr::BanCharacter(), BanMgr::BanIP(), ban_commandscript::HandleBanCharacterCommand(), ban_commandscript::HandleBanHelper(), bf_commandscript::HandleBattlefieldTimer(), deserter_commandscript::HandleDeserterAdd(), deserter_commandscript::HandleDeserterRemoveAll(), misc_commandscript::HandleMuteCommand(), npc_commandscript::HandleNpcSetSpawnTimeCommand(), server_commandscript::HandleServerIdleRestartCommand(), server_commandscript::HandleServerIdleShutDownCommand(), server_commandscript::HandleServerRestartCommand(), and server_commandscript::HandleServerShutDownCommand().
| bool Utf8FitTo | ( | std::string_view | str, |
| std::wstring_view | search | ||
| ) |
References Utf8toWStr(), and wstrToLower().
Referenced by learn_commandscript::HandleLearnAllRecipesCommand(), lookup_commandscript::HandleLookupAreaCommand(), lookup_commandscript::HandleLookupCreatureCommand(), lookup_commandscript::HandleLookupEventCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupItemCommand(), lookup_commandscript::HandleLookupItemSetCommand(), lookup_commandscript::HandleLookupMapCommand(), lookup_commandscript::HandleLookupObjectCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupTaxiNodeCommand(), lookup_commandscript::HandleLookupTitleCommand(), WorldSession::HandleWhoOpcode(), and list_commandscript::ShouldListAura().
| std::size_t utf8length | ( | std::string & | utf8str | ) |
Referenced by AccountMgr::ChangeEmail(), AccountMgr::ChangePassword(), AccountMgr::ChangeUsername(), and AccountMgr::CreateAccount().
| void utf8printf | ( | FILE * | out, |
| const char * | str, | ||
| ... | |||
| ) |
References vutf8printf().
Referenced by AppenderConsole::_write().
| bool utf8ToConsole | ( | std::string_view | utf8str, |
| std::string & | conStr | ||
| ) |
References Utf8toWStr().
| bool Utf8ToUpperOnlyLatin | ( | std::string & | utf8String | ) |
References Utf8toWStr(), wcharToUpperOnlyLatin(), and WStrToUtf8().
Referenced by AccountMgr::ChangeEmail(), AccountMgr::ChangePassword(), AccountMgr::ChangeUsername(), RASession::CheckAccessLevel(), RASession::CheckPassword(), AccountMgr::CheckPassword(), AccountMgr::CreateAccount(), account_commandscript::HandleAccountDeleteCommand(), account_commandscript::HandleAccountRemoveLockCountryCommand(), account_commandscript::HandleAccountSet2FACommand(), account_commandscript::HandleAccountSetAddonCommand(), account_commandscript::HandleAccountSetEmailCommand(), account_commandscript::HandleAccountSetGmLevelCommand(), account_commandscript::HandleAccountSetPasswordCommand(), ban_commandscript::HandleBanHelper(), ban_commandscript::HandleBanInfoAccountCommand(), lookup_commandscript::HandleLookupPlayerAccountCommand(), misc_commandscript::HandleMuteInfoCommand(), ban_commandscript::HandleUnBanHelper(), PlayerDump::InitializeTables(), AccountInfo::LoadResult(), StringsEqualCaseInsensitive(), and Acore::ChatCommands::AccountIdentifier::TryConsume().
| bool Utf8toWStr | ( | char const * | utf8str, |
| std::size_t | csize, | ||
| wchar_t * | wstr, | ||
| std::size_t & | wsize | ||
| ) |
References Acore::CheckedBufferOutputIterator< T >::remaining().
Referenced by ObjectMgr::AddGameTele(), ObjectMgr::AddProfanityPlayerName(), ObjectMgr::AddReservedPlayerName(), ObjectMgr::CheckDeclinedNames(), ObjectMgr::CheckPetName(), ObjectMgr::CheckPlayerName(), ObjectMgr::DeleteGameTele(), ChannelMgr::GetChannel(), ObjectMgr::GetGameTele(), Graveyard::GetGraveyard(), ChannelMgr::GetJoinChannel(), WorldSession::HandleAuctionListItems(), go_commandscript::HandleGoXYZCommand(), lookup_commandscript::HandleLookupAreaCommand(), lookup_commandscript::HandleLookupCreatureCommand(), lookup_commandscript::HandleLookupEventCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupItemCommand(), lookup_commandscript::HandleLookupItemSetCommand(), lookup_commandscript::HandleLookupMapCommand(), lookup_commandscript::HandleLookupObjectCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupTaxiNodeCommand(), lookup_commandscript::HandleLookupTeleCommand(), lookup_commandscript::HandleLookupTitleCommand(), modify_commandscript::HandleModifyRepCommand(), WorldSession::HandlePetRename(), server_commandscript::HandleServerIdleRestartCommand(), server_commandscript::HandleServerIdleShutDownCommand(), server_commandscript::HandleServerRestartCommand(), server_commandscript::HandleServerSetMotdCommand(), server_commandscript::HandleServerShutDownCommand(), WorldSession::HandleSetPlayerDeclinedNames(), WorldSession::HandleWhoOpcode(), ObjectMgr::IsProfanityName(), ObjectMgr::IsReservedName(), ObjectMgr::IsValidChannelName(), ObjectMgr::IsValidCharterName(), ChannelMgr::LoadChannels(), ObjectMgr::LoadGameTele(), Graveyard::LoadGraveyardFromDB(), ObjectMgr::LoadProfanityNamesFromDB(), ObjectMgr::LoadProfanityNamesFromDBC(), ObjectMgr::LoadReservedPlayerNamesDB(), ObjectMgr::LoadReservedPlayerNamesDBC(), normalizePlayerName(), SearchableAuctionEntry::SetItemNames(), Acore::ChatCommands::WTail::TryConsume(), Acore::Impl::ChatCommands::ArgInfo< std::wstring, void >::TryConsume(), WhoListCacheMgr::Update(), Utf8FitTo(), utf8ToConsole(), Utf8ToUpperOnlyLatin(), and vutf8printf().
| bool Utf8toWStr | ( | std::string_view | utf8str, |
| std::wstring & | wstr | ||
| ) |
Referenced by Utf8toWStr().
| void utf8truncate | ( | std::string & | utf8str, |
| std::size_t | len | ||
| ) |
Referenced by PlayerSocial::SetFriendNote(), and Guild::BankTab::SetText().
| void vutf8printf | ( | FILE * | out, |
| const char * | str, | ||
| va_list * | ap | ||
| ) |
References Utf8toWStr().
Referenced by utf8printf().
| void wstrToLower | ( | std::wstring & | str | ) |
References wcharToLower().
Referenced by ObjectMgr::AddGameTele(), ObjectMgr::AddProfanityPlayerName(), ObjectMgr::AddReservedPlayerName(), ObjectMgr::CheckPlayerName(), ObjectMgr::DeleteGameTele(), ChannelMgr::GetChannel(), ObjectMgr::GetGameTele(), Graveyard::GetGraveyard(), ChannelMgr::GetJoinChannel(), WorldSession::HandleAuctionListItems(), learn_commandscript::HandleLearnAllRecipesCommand(), lookup_commandscript::HandleLookupAreaCommand(), lookup_commandscript::HandleLookupCreatureCommand(), lookup_commandscript::HandleLookupEventCommand(), lookup_commandscript::HandleLookupFactionCommand(), lookup_commandscript::HandleLookupItemCommand(), lookup_commandscript::HandleLookupItemSetCommand(), lookup_commandscript::HandleLookupMapCommand(), lookup_commandscript::HandleLookupObjectCommand(), lookup_commandscript::HandleLookupQuestCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupSpellCommand(), lookup_commandscript::HandleLookupTaxiNodeCommand(), lookup_commandscript::HandleLookupTeleCommand(), lookup_commandscript::HandleLookupTitleCommand(), modify_commandscript::HandleModifyRepCommand(), WorldSession::HandleWhoOpcode(), ObjectMgr::IsProfanityName(), ObjectMgr::IsReservedName(), list_commandscript::ListAurasCommand(), ObjectMgr::LoadGameTele(), Graveyard::LoadGraveyardFromDB(), ObjectMgr::LoadProfanityNamesFromDB(), ObjectMgr::LoadReservedPlayerNamesDB(), normalizePlayerName(), SearchableAuctionEntry::SetItemNames(), WhoListCacheMgr::Update(), and Utf8FitTo().
| void wstrToUpper | ( | std::wstring & | str | ) |
References wcharToUpper().
| bool WStrToUtf8 | ( | std::wstring_view | wstr, |
| std::string & | utf8str | ||
| ) |
| bool WStrToUtf8 | ( | wchar_t const * | wstr, |
| std::size_t | size, | ||
| std::string & | utf8str | ||
| ) |
Referenced by CliThread(), consoleToUtf8(), server_commandscript::HandleServerIdleRestartCommand(), server_commandscript::HandleServerIdleShutDownCommand(), server_commandscript::HandleServerRestartCommand(), server_commandscript::HandleServerSetMotdCommand(), server_commandscript::HandleServerShutDownCommand(), normalizePlayerName(), and Utf8ToUpperOnlyLatin().