~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/uuid.h

  • Committer: Olaf van der Spek
  • Date: 2011-07-07 13:41:07 UTC
  • mto: This revision was merged to the branch mainline in revision 2385.
  • Revision ID: olafvdspek@gmail.com-20110707134107-6mi7pauiatxtf4oe
Rename strmake to strdup (standard name)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_FIELD_UUID_H
22
 
#define DRIZZLED_FIELD_UUID_H
 
21
#pragma once
23
22
 
24
23
#include <drizzled/field.h>
25
24
#include <string>
26
25
 
27
 
#include "drizzled/field/uuid_st.h"
 
26
#include <drizzled/type/uuid.h>
28
27
 
29
28
namespace drizzled
30
29
{
32
31
{
33
32
 
34
33
class Uuid :public Field {
35
 
  const CHARSET_INFO *field_charset;
 
34
  const charset_info_st *field_charset;
36
35
  bool is_set;
37
36
 
38
37
public:
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; }
51
50
 
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);
54
 
  double val_real();
55
 
  int64_t val_int();
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*);
59
57
 
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; }
64
62
 
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); }
68
66
 
69
 
  bool get_date(DRIZZLE_TIME *ltime, uint32_t);
70
 
  bool get_time(DRIZZLE_TIME *ltime);
 
67
  bool get_date(type::Time &ltime, uint32_t) const;
 
68
  bool get_time(type::Time &ltime) const;
71
69
 
72
70
#ifdef NOT_YET
73
71
  void generate();
76
74
 
77
75
  static size_t max_string_length()
78
76
  {
79
 
    return uuid_st::LENGTH;
 
77
    return type::Uuid::LENGTH;
80
78
  }
81
79
};
82
80
 
83
81
} /* namespace field */
84
82
} /* namespace drizzled */
85
83
 
86
 
#endif /* DRIZZLED_FIELD_UUID_H */
87
84