~drizzle-trunk/drizzle/development

466 by Monty Taylor
Fixed modelines... these files are c++.
1
/* - mode: c++ c-basic-offset: 2; indent-tabs-mode: nil; -*-
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 MySQL
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
21
#ifndef DRIZZLE_SERVER_FIELD_LONG
22
#define DRIZZLE_SERVER_FIELD_LONG
23
584.5.1 by Monty Taylor
Removed field includes from field.h.
24
#include <drizzled/field/num.h>
25
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
26
class Field_long :public Field_num {
27
public:
892.1.2 by Monty Taylor
Fixed solaris warnings.
28
29
  using Field::val_int;
30
  using Field::val_str;
31
  using Field::cmp;
32
  using Field::pack;
33
  using Field::store;
34
  using Field::unpack;
35
481 by Brian Aker
Remove all of uchar.
36
  Field_long(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
37
	     unsigned char null_bit_arg,
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
38
	     enum utype unireg_check_arg, const char *field_name_arg,
39
	     bool zero_arg, bool unsigned_arg)
40
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
41
	       unireg_check_arg, field_name_arg,
42
	       0, zero_arg,unsigned_arg)
43
    {}
205 by Brian Aker
uint32 -> uin32_t
44
  Field_long(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
45
	     bool unsigned_arg)
481 by Brian Aker
Remove all of uchar.
46
    :Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
47
	       NONE, field_name_arg,0,0,unsigned_arg)
48
    {}
49
  enum Item_result result_type () const { return INT_RESULT; }
212.2.2 by Patrick Galbraith
Renamed FIELD_TYPE to DRIZZLE_TYPE
50
  enum_field_types type() const { return DRIZZLE_TYPE_LONG;}
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
51
  enum ha_base_keytype key_type() const
52
    { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
482 by Brian Aker
Remove uint.
53
  int store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
54
  int store(double nr);
55
  int store(int64_t nr, bool unsigned_val);
56
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
57
  double val_real(void);
58
  int64_t val_int(void);
59
  String *val_str(String*,String *);
481 by Brian Aker
Remove all of uchar.
60
  int cmp(const unsigned char *,const unsigned char *);
482 by Brian Aker
Remove uint.
61
  void sort_string(unsigned char *buff,uint32_t length);
205 by Brian Aker
uint32 -> uin32_t
62
  uint32_t pack_length() const { return 4; }
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
63
  void sql_type(String &str) const;
205 by Brian Aker
uint32 -> uin32_t
64
  uint32_t max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; }
481 by Brian Aker
Remove all of uchar.
65
  virtual unsigned char *pack(unsigned char* to, const unsigned char *from,
590.3.1 by Lee Bieber
changes to get build working on Solaris
66
                      uint32_t max_length,
67
                      bool low_byte_first);
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
68
481 by Brian Aker
Remove all of uchar.
69
  virtual const unsigned char *unpack(unsigned char* to, const unsigned char *from,
590.3.1 by Lee Bieber
changes to get build working on Solaris
70
                              uint32_t param_data,
71
                              bool low_byte_first);
173.1.12 by Toru Maesaka
Moved out SHORT, LONG and INT64_T to field/
72
};
73
74
#endif
75