TrinityCore
FieldValueConverter.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITY_FIELD_VALUE_CONVERTER_H
19#define TRINITY_FIELD_VALUE_CONVERTER_H
20
21#include "Define.h"
22#include "Duration.h"
23
25
27{
28public:
35
36 virtual uint8 GetUInt8(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
37 virtual int8 GetInt8(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
38 virtual uint16 GetUInt16(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
39 virtual int16 GetInt16(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
40 virtual uint32 GetUInt32(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
41 virtual int32 GetInt32(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
42 virtual uint64 GetUInt64(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
43 virtual int64 GetInt64(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
44 virtual float GetFloat(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
45 virtual double GetDouble(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
46 virtual SystemTimePoint GetDate(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
47 virtual char const* GetCString(char const* data, uint32 size, QueryResultFieldMetadata const* meta) const = 0;
48
49 static void LogTruncation(char const* getter, QueryResultFieldMetadata const* meta);
50};
51
52#endif // TRINITY_FIELD_VALUE_CONVERTER_H
uint8_t uint8
Definition: Define.h:144
int64_t int64
Definition: Define.h:137
int16_t int16
Definition: Define.h:139
int8_t int8
Definition: Define.h:140
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
std::chrono::system_clock::time_point SystemTimePoint
Definition: Duration.h:42
BaseDatabaseResultValueConverter(BaseDatabaseResultValueConverter const &)=delete
BaseDatabaseResultValueConverter & operator=(BaseDatabaseResultValueConverter const &)=delete
virtual uint64 GetUInt64(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
BaseDatabaseResultValueConverter & operator=(BaseDatabaseResultValueConverter &&)=delete
virtual SystemTimePoint GetDate(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
BaseDatabaseResultValueConverter(BaseDatabaseResultValueConverter &&)=delete
virtual float GetFloat(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual double GetDouble(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual uint8 GetUInt8(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual int64 GetInt64(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual uint16 GetUInt16(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual int32 GetInt32(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual uint32 GetUInt32(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual int8 GetInt8(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
virtual int16 GetInt16(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
static void LogTruncation(char const *getter, QueryResultFieldMetadata const *meta)
virtual char const * GetCString(char const *data, uint32 size, QueryResultFieldMetadata const *meta) const =0
constexpr std::size_t size()
Definition: UpdateField.h:805