AzerothCore 3.3.5a
OpenSource WoW Emulator
|
Class used to access individual fields of database query result. More...
#include "Field.h"
Public Member Functions | |
Field () | |
~Field ()=default | |
bool | IsNull () const |
template<typename T > | |
std::enable_if_t< std::is_arithmetic_v< T >, T > | Get () const |
template<typename T > | |
std::enable_if_t< std::is_same_v< std::string, T >, T > | Get () const |
template<typename T > | |
std::enable_if_t< std::is_same_v< std::string_view, T >, T > | Get () const |
template<typename T > | |
std::enable_if_t< std::is_same_v< Binary, T >, T > | Get () const |
template<typename T , std::size_t S> | |
std::enable_if_t< std::is_same_v< Binary, T >, std::array< uint8, S > > | Get () const |
template<typename T > | |
Acore::Types::is_chrono_v< T > | Get (bool convertToUin32=true) const |
DatabaseFieldTypes | GetType () |
Protected Member Functions | |
void | SetByteValue (char const *newValue, uint32 length) |
void | SetStructuredValue (char const *newValue, uint32 length) |
bool | IsType (DatabaseFieldTypes type) const |
bool | IsNumeric () const |
Protected Attributes | |
struct { | |
char const * value | |
uint32 length | |
bool raw | |
} | data |
Private Member Functions | |
template<typename T > | |
T | GetData () const |
std::string | GetDataString () const |
std::string_view | GetDataStringView () const |
Binary | GetDataBinary () const |
void | LogWrongType (std::string_view getter, std::string_view typeName) const |
void | SetMetadata (QueryResultFieldMetadata const *fieldMeta) |
void | GetBinarySizeChecked (uint8 *buf, std::size_t size) const |
Private Attributes | |
QueryResultFieldMetadata const * | meta |
Friends | |
class | ResultSet |
class | PreparedResultSet |
Class used to access individual fields of database query result.
Guideline on field type matching:
MySQL type | method to use |
---|---|
TINYINT | Get<bool>, Get<int8>, Get<uint8> |
SMALLINT | Get<int16>, Get<uint16> |
MEDIUMINT, INT | Get<int32>, Get<uint32> |
BIGINT | Get<int64>, Get<uint64> |
FLOAT | Get<float> |
DOUBLE, DECIMAL | Get<double> |
CHAR, VARCHAR, | Get<std::string>, Get<std::string_view> |
TINYTEXT, MEDIUMTEXT, | Get<std::string>, Get<std::string_view> |
TEXT, LONGTEXT | Get<std::string>, Get<std::string_view> |
TINYBLOB, MEDIUMBLOB, | Get<Binary>, Get<std::string> |
BLOB, LONGBLOB | Get<Binary>, Get<std::string> |
BINARY, VARBINARY | Get<Binary> |
Return types of aggregate functions:
Function | Type |
---|---|
MIN, MAX | Same as the field |
SUM, AVG | DECIMAL |
COUNT | BIGINT |
Field::Field | ( | ) |
|
default |
|
inline |
Referenced by Player::_LoadActions(), Pet::_LoadAuras(), Player::_LoadAuras(), Player::_LoadBrewOfTheMonth(), Player::_LoadCharacterSettings(), Player::_LoadDailyQuestStatus(), Player::_LoadEntryPointData(), Player::_LoadEquipmentSets(), lfg::LFGMgr::_LoadFromDB(), Player::_LoadGlyphs(), Player::_LoadHomeBind(), Player::_LoadInventory(), Player::_LoadItem(), Player::_LoadMail(), Player::_LoadMailedItem(), Player::_LoadMonthlyQuestStatus(), Player::_LoadPetStable(), Player::_LoadQuestStatus(), Player::_LoadQuestStatusRewarded(), Player::_LoadSeasonalQuestStatus(), Player::_LoadSkills(), Pet::_LoadSpellCooldowns(), Player::_LoadSpellCooldowns(), Player::_LoadWeeklyQuestStatus(), World::_UpdateRealmCharCount(), AccountInfo::AccountInfo(), Guild::AddMember(), AppendTableDump(), SecretMgr::AttemptTransition(), BanMgr::BanIP(), Player::BuildEnumData(), CharacterDatabaseCleaner::CheckUnique(), Player::DeleteFromDB(), Player::DeleteOldRecoveryItems(), npc_shattrath_daily_quest::DoAction(), Battleground::EndBattleground(), character_commandscript::GetDeletedCharacterInfoList(), Player::GetZoneIdFromDB(), account_commandscript::HandleAccount2FARemoveCommand(), account_commandscript::HandleAccountOnlineListCommand(), ban_commandscript::HandleBanInfoCharacterCommand(), ban_commandscript::HandleBanInfoHelper(), ban_commandscript::HandleBanInfoIPCommand(), ban_commandscript::HandleBanListCharacterCommand(), ban_commandscript::HandleBanListHelper(), ban_commandscript::HandleBanListIPCommand(), WorldSession::HandleCharacterAuraFrozen(), WorldSession::HandleCharCustomizeCallback(), WorldSession::HandleCharFactionOrRaceChangeCallback(), WorldSession::HandleCharRenameCallBack(), deserter_commandscript::HandleDeserterAdd(), deserter_commandscript::HandleDeserterRemove(), gobject_commandscript::HandleGameObjectNearCommand(), gobject_commandscript::HandleGameObjectTargetCommand(), gear_commandscript::HandleGearStatsCommand(), gm_commandscript::HandleGMListFullCommand(), item_commandscript::HandleItemRefundCommand(), item_commandscript::HandleItemRestoreListCommand(), list_commandscript::HandleListCreatureCommand(), list_commandscript::HandleListItemCommand(), list_commandscript::HandleListObjectCommand(), npc_commandscript::HandleNpcNearCommand(), WorldSession::HandleOpenWrappedItemCallback(), misc_commandscript::HandlePInfoCommand(), quest_commandscript::HandleQuestComplete(), server_commandscript::HandleServerDebugCommand(), tele_commandscript::HandleTeleNameCommand(), tele_commandscript::HandleTeleNameNpcNameCommand(), misc_commandscript::HandleUnstuckCommand(), WorldSession::HandleWhoisOpcode(), wp_commandscript::HandleWpEventCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), GameEventMgr::Initialize(), Player::LeaveAllArenaTeams(), WaypointMgr::Load(), DBCDatabaseLoader::Load(), ObjectMgr::LoadAccessRequirements(), WorldSession::LoadAccountData(), AchievementGlobalMgr::LoadAchievementCriteriaData(), ObjectMgr::LoadAcoreStrings(), ObjectMgr::LoadAreaTriggers(), ObjectMgr::LoadAreaTriggerScripts(), ObjectMgr::LoadAreaTriggerTeleports(), ArenaTeam::LoadArenaTeamFromDB(), AuctionHouseMgr::LoadAuctionItems(), AutobroadcastMgr::LoadAutobroadcasts(), Guild::LoadBankEventLogFromDB(), Guild::LoadBankItemFromDB(), Guild::LoadBankTabFromDB(), BattlegroundMgr::LoadBattlegroundTemplates(), BattlegroundMgr::LoadBattleMastersEntry(), ObjectMgr::LoadBroadcastTextLocales(), ObjectMgr::LoadBroadcastTexts(), ChannelMgr::LoadChannelRights(), ChannelMgr::LoadChannels(), InstanceSaveMgr::LoadCharacterBinds(), Acore::Impl::ChatCommands::ChatCommandNode::LoadCommandMap(), AchievementGlobalMgr::LoadCompletedAchievements(), ConditionMgr::LoadConditions(), Map::LoadCorpseData(), Corpse::LoadCorpseFromDB(), ObjectMgr::LoadCreatureAddons(), ObjectMgr::LoadCreatureClassLevelStats(), FormationMgr::LoadCreatureFormations(), ObjectMgr::LoadCreatureLocales(), ObjectMgr::LoadCreatureModelInfo(), ObjectMgr::LoadCreatureMovementOverrides(), ObjectMgr::LoadCreatureQuestItems(), ObjectMgr::LoadCreatures(), ObjectMgr::LoadCreatureTemplate(), ObjectMgr::LoadCreatureTemplateAddons(), ObjectMgr::LoadCreatureTemplateModels(), ObjectMgr::LoadCreatureTemplateResistances(), ObjectMgr::LoadCreatureTemplateSpells(), CreatureTextMgr::LoadCreatureTextLocales(), CreatureTextMgr::LoadCreatureTexts(), World::LoadDBVersion(), DisableMgr::LoadDisables(), ObjectMgr::LoadEquipmentTemplates(), ObjectMgr::LoadExplorationBaseXP(), ObjectMgr::LoadFactionChangeAchievements(), ObjectMgr::LoadFactionChangeItems(), ObjectMgr::LoadFactionChangeQuests(), ObjectMgr::LoadFactionChangeReputations(), ObjectMgr::LoadFactionChangeSpells(), ObjectMgr::LoadFactionChangeTitles(), ObjectMgr::LoadFishingBaseSkillLevel(), AddonMgr::LoadFromDB(), SmartWaypointMgr::LoadFromDB(), CalendarMgr::LoadFromDB(), GameEventMgr::LoadFromDB(), PoolMgr::LoadFromDB(), AuctionEntry::LoadFromDB(), EmblemInfo::LoadFromDB(), Guild::Member::LoadFromDB(), Guild::RankInfo::LoadFromDB(), Guild::BankTab::LoadFromDB(), Guild::LoadFromDB(), GmTicket::LoadFromDB(), Player::LoadFromDB(), Item::LoadFromDB(), AchievementMgr::LoadFromDB(), ReputationMgr::LoadFromDB(), SocialMgr::LoadFromDB(), ObjectMgr::LoadGameObjectAddons(), ObjectMgr::LoadGameObjectLocales(), ObjectMgr::LoadGameObjectQuestItems(), ObjectMgr::LoadGameobjects(), ObjectMgr::LoadGameObjectTemplate(), ObjectMgr::LoadGameObjectTemplateAddons(), ObjectMgr::LoadGameTele(), ObjectMgr::LoadGossipMenu(), ObjectMgr::LoadGossipMenuItems(), ObjectMgr::LoadGossipMenuItemsLocales(), ObjectMgr::LoadGossipText(), Graveyard::LoadGraveyardFromDB(), Graveyard::LoadGraveyardZones(), Group::LoadGroupFromDB(), GuildMgr::LoadGuilds(), GameEventMgr::LoadHolidayDates(), ObjectMgr::LoadInstanceEncounters(), InstanceSaveMgr::LoadInstanceSaves(), ObjectMgr::LoadInstanceTemplate(), Guild::BankTab::LoadItemFromDB(), ObjectMgr::LoadItemLocales(), ObjectMgr::LoadItemSetNameLocales(), ObjectMgr::LoadItemSetNames(), ObjectMgr::LoadItemTemplates(), lfg::LFGMgr::LoadLFGDungeons(), ObjectMgr::LoadLinkedRespawn(), LootStore::LoadLootTable(), ObjectMgr::LoadMailLevelRewards(), ObjectMgr::LoadMailServerTemplates(), Guild::LoadMemberFromDB(), ArenaTeam::LoadMembersFromDB(), ObjectMgr::LoadModuleStrings(), ObjectMgr::LoadModuleStringsLocale(), MotdMgr::LoadMotd(), ObjectMgr::LoadNPCSpellClickSpells(), ObjectMgr::LoadNpcTextLocales(), ObjectMgr::LoadPageTextLocales(), ObjectMgr::LoadPageTexts(), Pet::LoadPetFromDB(), ObjectMgr::LoadPetLevelInfo(), ObjectMgr::LoadPetNames(), ObjectMgr::LoadPetNamesLocales(), ObjectMgr::LoadPetNumber(), ObjectMgr::LoadPlayerInfo(), ObjectMgr::LoadPointOfInterestLocales(), ObjectMgr::LoadPointsOfInterest(), Player::LoadPositionFromDB(), ObjectMgr::LoadProfanityNamesFromDB(), ObjectMgr::LoadQuestAreaTriggers(), ObjectMgr::LoadQuestGreetings(), ObjectMgr::LoadQuestGreetingsLocales(), ObjectMgr::LoadQuestLocales(), ObjectMgr::LoadQuestMoneyRewards(), Quest::LoadQuestOfferReward(), ObjectMgr::LoadQuestOfferRewardLocale(), ObjectMgr::LoadQuestPOI(), Quest::LoadQuestRequestItems(), ObjectMgr::LoadQuestRequestItemsLocale(), ObjectMgr::LoadQuests(), Quest::LoadQuestTemplateAddon(), LoadRandomEnchantmentsTable(), LoadRealmInfo(), ObjectMgr::LoadReferenceVendor(), ObjectMgr::LoadReputationOnKill(), ObjectMgr::LoadReputationRewardRate(), ObjectMgr::LoadReputationSpilloverTemplate(), ObjectMgr::LoadReservedPlayerNamesDB(), InstanceSaveMgr::LoadResetTimes(), Map::LoadRespawnTimes(), AccountInfo::LoadResult(), AchievementGlobalMgr::LoadRewardLocales(), AchievementGlobalMgr::LoadRewards(), lfg::LFGMgr::LoadRewards(), ObjectMgr::LoadScripts(), SystemMgr::LoadScriptWaypoints(), LoadSkillDiscoveryTable(), LoadSkillExtraItemTable(), LoadSkillPerfectItemTable(), SmartAIMgr::LoadSmartAIFromDB(), SpellMgr::LoadSpellAreas(), SpellMgr::LoadSpellBonuses(), SpellMgr::LoadSpellCooldownOverrides(), SpellMgr::LoadSpellEnchantProcData(), SpellMgr::LoadSpellGroups(), SpellMgr::LoadSpellGroupStackRules(), SpellMgr::LoadSpellInfoCustomAttributes(), SpellMgr::LoadSpellLinked(), SpellMgr::LoadSpellMixology(), SpellMgr::LoadSpellPetAuras(), SpellMgr::LoadSpellProcEvents(), SpellMgr::LoadSpellProcs(), SpellMgr::LoadSpellRanks(), SpellMgr::LoadSpellRequired(), ObjectMgr::LoadSpellScriptNames(), SpellMgr::LoadSpellTargetPositions(), SpellMgr::LoadSpellThreats(), ObjectMgr::LoadTavernAreaTriggers(), ObjectMgr::LoadTempSummons(), ObjectMgr::LoadTrainerSpell(), TransportMgr::LoadTransportTemplates(), ObjectMgr::LoadVehicleAccessories(), ObjectMgr::LoadVehicleTemplateAccessories(), ObjectMgr::LoadVendors(), WardenCheckMgr::LoadWardenChecks(), WardenCheckMgr::LoadWardenOverrides(), ObjectMgr::LoadWaypointScripts(), WeatherMgr::LoadWeatherData(), World::LoadWorldStates(), AuthSession::LogonChallengeCallback(), lookup_commandscript::LookupPlayerSearchCommand(), Quest::Quest(), AuthSession::RealmListCallback(), UpdateFetcher::ReceiveAppliedFiles(), UpdateFetcher::ReceiveIncludedDirectories(), AuthSession::ReconnectChallengeCallback(), WaypointMgr::ReloadPath(), ObjectMgr::ReturnOrDeleteOldMails(), TransportMgr::SpawnContinentTransports(), and GameEventMgr::StartArenaSeason().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
References QueryResultFieldMetadata::Alias, data, IsType(), LOG_DEBUG, LOG_FATAL, LOG_WARN, LogWrongType(), meta, QueryResultFieldMetadata::Name, StringEqualI(), QueryResultFieldMetadata::TableName, and QueryResultFieldMetadata::Type.
|
private |
References data, LogWrongType(), meta, and QueryResultFieldMetadata::Type.
|
private |
References data, IsNumeric(), and LogWrongType().
|
private |
References data, IsNumeric(), and LogWrongType().
|
inline |
|
inline |
|
protected |
References meta, and QueryResultFieldMetadata::Type.
Referenced by GetDataString(), and GetDataStringView().
|
protected |
References meta, and QueryResultFieldMetadata::Type.
Referenced by GetData().
|
private |
References QueryResultFieldMetadata::Alias, QueryResultFieldMetadata::Index, LOG_WARN, meta, QueryResultFieldMetadata::Name, QueryResultFieldMetadata::TableAlias, QueryResultFieldMetadata::TableName, and QueryResultFieldMetadata::TypeName.
Referenced by GetData(), GetDataBinary(), GetDataString(), and GetDataStringView().
|
protected |
|
private |
|
protected |
|
friend |
|
friend |
struct { ... } Field::data |
Referenced by Field(), GetBinarySizeChecked(), GetData(), GetDataBinary(), GetDataString(), GetDataStringView(), SetByteValue(), and SetStructuredValue().
uint32 Field::length |
Referenced by GetBinarySizeChecked(), SetByteValue(), and SetStructuredValue().
|
private |
Referenced by Field(), GetData(), GetDataBinary(), IsNumeric(), IsType(), LogWrongType(), and SetMetadata().
bool Field::raw |
char const* Field::value |