18
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef DRIZZLED_FIELD_UUID_H
22
#define DRIZZLED_FIELD_UUID_H
24
23
#include <drizzled/field.h>
27
#include "drizzled/field/uuid_st.h"
26
#include <drizzled/type/uuid.h>
45
44
enum_field_types type() const { return DRIZZLE_TYPE_UUID; }
46
45
enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
47
46
bool zero_pack() const { return 0; }
48
int reset(void) { memset(ptr, 0, uuid_st::LENGTH); return 0; }
49
uint32_t pack_length() const { return uuid_st::LENGTH; }
50
uint32_t key_length() const { return uuid_st::LENGTH; }
47
int reset(void) { memset(ptr, 0, type::Uuid::LENGTH); return 0; }
48
uint32_t pack_length() const { return type::Uuid::LENGTH; }
49
uint32_t key_length() const { return type::Uuid::LENGTH; }
52
int store(const char *to, uint32_t length, const CHARSET_INFO * const charset);
51
int store(const char *to, uint32_t length, const charset_info_st * const charset);
53
52
int store(int64_t nr, bool unsigned_val);
56
String *val_str(String*,String *);
57
void sql_type(drizzled::String&) const;
58
int store_decimal(const drizzled::my_decimal*);
53
double val_real() const;
54
int64_t val_int() const;
55
String *val_str(String*,String *) const;
56
int store_decimal(const drizzled::type::Decimal*);
60
58
Item_result result_type () const { return STRING_RESULT; }
61
59
int cmp(const unsigned char*, const unsigned char*);
62
60
void sort_string(unsigned char*, uint32_t);
63
uint32_t max_display_length() { return uuid_st::DISPLAY_LENGTH; }
61
uint32_t max_display_length() { return type::Uuid::DISPLAY_LENGTH; }
65
63
int store(double ) { return 0; }
66
64
inline String *val_str(String *str) { return val_str(str, str); }
67
65
uint32_t size_of() const { return sizeof(*this); }
69
bool get_date(DRIZZLE_TIME *ltime, uint32_t);
70
bool get_time(DRIZZLE_TIME *ltime);
67
bool get_date(type::Time <ime, uint32_t) const;
68
bool get_time(type::Time <ime) const;