![]() |
TrinityCore
|
Class used to access individual fields of database query result. More...
#include <Field.h>
Public Member Functions | |
Field () | |
~Field () | |
bool | GetBool () const |
uint8 | GetUInt8 () const |
int8 | GetInt8 () const |
uint16 | GetUInt16 () const |
int16 | GetInt16 () const |
uint32 | GetUInt32 () const |
int32 | GetInt32 () const |
uint64 | GetUInt64 () const |
int64 | GetInt64 () const |
float | GetFloat () const |
double | GetDouble () const |
char const * | GetCString () const |
std::string | GetString () const |
std::string_view | GetStringView () const |
std::vector< uint8 > | GetBinary () const |
template<size_t S> | |
std::array< uint8, S > | GetBinary () const |
bool | IsNull () const |
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 | |
void | LogWrongType (char const *getter) const |
void | SetMetadata (QueryResultFieldMetadata const *fieldMeta) |
void | GetBinarySizeChecked (uint8 *buf, 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 | GetBool, GetInt8, GetUInt8 |
SMALLINT | GetInt16, GetUInt16 |
MEDIUMINT, INT | GetInt32, GetUInt32 |
BIGINT | GetInt64, GetUInt64 |
FLOAT | GetFloat |
DOUBLE, DECIMAL | GetDouble |
CHAR, VARCHAR, | GetCString, GetString |
TINYTEXT, MEDIUMTEXT, | GetCString, GetString |
TEXT, LONGTEXT | GetCString, GetString |
TINYBLOB, MEDIUMBLOB, | GetBinary, GetString |
BLOB, LONGBLOB | GetBinary, GetString |
BINARY, VARBINARY | GetBinary |
Return types of aggregate functions:
Function | Type |
---|---|
MIN, MAX | Same as the field |
SUM, AVG | DECIMAL |
COUNT | BIGINT |
Field::Field | ( | ) |
|
default |
std::vector< uint8 > Field::GetBinary | ( | ) | const |
|
inline |
|
private |
|
inline |
char const * Field::GetCString | ( | ) | const |
double Field::GetDouble | ( | ) | const |
float Field::GetFloat | ( | ) | const |
int16 Field::GetInt16 | ( | ) | const |
int32 Field::GetInt32 | ( | ) | const |
int64 Field::GetInt64 | ( | ) | const |
int8 Field::GetInt8 | ( | ) | const |
std::string Field::GetString | ( | ) | const |
std::string_view Field::GetStringView | ( | ) | const |
uint16 Field::GetUInt16 | ( | ) | const |
uint32 Field::GetUInt32 | ( | ) | const |
uint64 Field::GetUInt64 | ( | ) | const |
uint8 Field::GetUInt8 | ( | ) | const |
|
inline |
|
protected |
|
protected |
|
private |
|
protected |
|
private |
|
protected |
|
friend |
|
friend |
struct { ... } Field::data |
uint32 Field::length |
|
private |
bool Field::raw |
char const* Field::value |