~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/double.h

  • Committer: Monty Taylor
  • Date: 2008-08-01 22:33:44 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080801223344-vzhlflfmtijp1imv
First pass at gettexizing the error messages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* - mode: c++ c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008 MySQL
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_FIELD_DOUBLE_H
22
 
#define DRIZZLED_FIELD_DOUBLE_H
 
21
#ifndef DRIZZLE_SERVER_FIELD_DOUBLE
 
22
#define DRIZZLE_SERVER_FIELD_DOUBLE
23
23
 
24
 
#include <drizzled/field/real.h>
 
24
#include <drizzled/mysql_priv.h>
25
25
 
26
26
class Field_double :public Field_real {
27
27
public:
28
 
 
29
 
  using Field::store;
30
 
  using Field::val_int;
31
 
  using Field::val_str;
32
 
  using Field::cmp;
33
 
 
34
 
  Field_double(unsigned char *ptr_arg, uint32_t len_arg,
35
 
               unsigned char *null_ptr_arg,
36
 
               unsigned char null_bit_arg,
37
 
               enum utype unireg_check_arg, const char *field_name_arg,
38
 
               uint8_t dec_arg,bool zero_arg,bool unsigned_arg)
 
28
  Field_double(uchar *ptr_arg, uint32_t len_arg, uchar *null_ptr_arg,
 
29
               uchar null_bit_arg,
 
30
               enum utype unireg_check_arg, const char *field_name_arg,
 
31
               uint8_t dec_arg,bool zero_arg,bool unsigned_arg)
39
32
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
40
33
                unireg_check_arg, field_name_arg,
41
34
                dec_arg, zero_arg, unsigned_arg)
42
35
    {}
43
36
  Field_double(uint32_t len_arg, bool maybe_null_arg, const char *field_name_arg,
44
37
               uint8_t dec_arg)
45
 
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint32_t) 0,
 
38
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
46
39
                NONE, field_name_arg, dec_arg, 0, 0)
47
40
    {}
48
41
  Field_double(uint32_t len_arg, bool maybe_null_arg, const char *field_name_arg,
49
 
               uint8_t dec_arg, bool not_fixed_arg)
50
 
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint32_t) 0,
 
42
               uint8_t dec_arg, my_bool not_fixed_arg)
 
43
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
51
44
                NONE, field_name_arg, dec_arg, 0, 0)
52
45
    {not_fixed= not_fixed_arg; }
53
46
  enum_field_types type() const { return DRIZZLE_TYPE_DOUBLE;}
54
47
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
55
 
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
 
48
  int  store(const char *to,uint length,CHARSET_INFO *charset);
56
49
  int  store(double nr);
57
50
  int  store(int64_t nr, bool unsigned_val);
58
51
  int reset(void) { memset(ptr, 0, sizeof(double)); return 0; }
59
52
  double val_real(void);
60
53
  int64_t val_int(void);
61
54
  String *val_str(String*,String *);
62
 
  int cmp(const unsigned char *,const unsigned char *);
63
 
  void sort_string(unsigned char *buff,uint32_t length);
 
55
  bool send_binary(Protocol *protocol);
 
56
  int cmp(const uchar *,const uchar *);
 
57
  void sort_string(uchar *buff,uint length);
64
58
  uint32_t pack_length() const { return sizeof(double); }
65
 
  uint32_t row_pack_length() { return pack_length(); }
 
59
  uint row_pack_length() { return pack_length(); }
66
60
  void sql_type(String &str) const;
 
61
private:
 
62
  int do_save_field_metadata(uchar *first_byte);
67
63
};
68
64
 
69
 
#endif /* DRIZZLED_FIELD_DOUBLE_H */
 
65
#endif
70
66