~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.h

  • Committer: Monty Taylor
  • Date: 2008-10-27 23:19:48 UTC
  • mto: (520.4.12 merge-innodb-plugin)
  • mto: This revision was merged to the branch mainline in revision 563.
  • Revision ID: monty@inaugust.com-20081027231948-3kl6ss04plbakqcr
Split some more things out of common_includes.h.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLE_SERVER_FIELD_VARSTRING
22
22
#define DRIZZLE_SERVER_FIELD_VARSTRING
23
23
 
24
 
#include <drizzled/field/longstr.h>
25
 
#include <string>
26
 
 
27
24
class Field_varstring :public Field_longstr {
28
25
public:
29
26
  /*
36
33
  Field_varstring(unsigned char *ptr_arg,
37
34
                  uint32_t len_arg, uint32_t length_bytes_arg,
38
35
                  unsigned char *null_ptr_arg, unsigned char null_bit_arg,
39
 
                  enum utype unireg_check_arg, const char *field_name_arg,
40
 
                  TABLE_SHARE *share, const CHARSET_INFO * const cs);
 
36
                  enum utype unireg_check_arg, const char *field_name_arg,
 
37
                  TABLE_SHARE *share, const CHARSET_INFO * const cs)
 
38
    :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
 
39
                   unireg_check_arg, field_name_arg, cs),
 
40
     length_bytes(length_bytes_arg)
 
41
  {
 
42
    share->varchar_fields++;
 
43
  }
41
44
  Field_varstring(uint32_t len_arg,bool maybe_null_arg,
42
45
                  const char *field_name_arg,
43
 
                  TABLE_SHARE *share, const CHARSET_INFO * const cs);
 
46
                  TABLE_SHARE *share, const CHARSET_INFO * const cs)
 
47
    :Field_longstr((unsigned char*) 0,len_arg, maybe_null_arg ? (unsigned char*) "": 0, 0,
 
48
                   NONE, field_name_arg, cs),
 
49
     length_bytes(len_arg < 256 ? 1 :2)
 
50
  {
 
51
    share->varchar_fields++;
 
52
  }
44
53
 
45
54
  enum_field_types type() const { return DRIZZLE_TYPE_VARCHAR; }
46
55
  enum ha_base_keytype key_type() const;
68
77
  }
69
78
  void sort_string(unsigned char *buff,uint32_t length);
70
79
  uint32_t get_key_image(unsigned char *buff,uint32_t length, imagetype type);
71
 
  uint32_t get_key_image(std::basic_string <unsigned char> &buff,
72
 
                         uint32_t length, imagetype type);
73
80
  void set_key_image(const unsigned char *buff,uint32_t length);
74
81
  void sql_type(String &str) const;
75
82
  virtual unsigned char *pack(unsigned char *to, const unsigned char *from,