~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/decimal.h

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
merge lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_ITEM_DECIMAL_H
21
 
#define DRIZZLED_ITEM_DECIMAL_H
 
20
#pragma once
22
21
 
23
22
#include <drizzled/item/num.h>
24
23
 
25
 
namespace drizzled
26
 
{
 
24
namespace drizzled {
27
25
 
28
26
/* decimal (fixed point) constant */
29
 
class Item_decimal :public Item_num
 
27
class Item_decimal : public Item_num
30
28
{
31
29
protected:
32
30
  type::Decimal decimal_value;
33
31
public:
34
 
  Item_decimal(const char *str_arg, uint32_t length, const CHARSET_INFO * const charset);
35
 
  Item_decimal(const char *str, const type::Decimal *val_arg,
36
 
               uint32_t decimal_par, uint32_t length);
 
32
  Item_decimal(const char *str_arg, uint32_t length, const charset_info_st*);
 
33
  Item_decimal(const char *str, const type::Decimal *val_arg, uint32_t decimal_par, uint32_t length);
37
34
  Item_decimal(type::Decimal *value_par);
38
35
  Item_decimal(int64_t val, bool unsig);
39
36
  Item_decimal(double val, int precision, int scale);
48
45
  type::Decimal *val_decimal(type::Decimal *)
49
46
  { return &decimal_value; }
50
47
  int save_in_field(Field *field, bool no_conversions);
51
 
  bool basic_const_item() const { return 1; }
 
48
  bool basic_const_item() const { return true; }
52
49
  Item *clone_item()
53
50
  {
54
51
    return new Item_decimal(name, &decimal_value, decimals, max_length);
55
52
  }
56
 
  virtual void print(String *str, enum_query_type query_type);
 
53
  virtual void print(String *str);
57
54
  Item_num *neg()
58
55
  {
59
56
    class_decimal_neg(&decimal_value);
67
64
 
68
65
} /* namespace drizzled */
69
66
 
70
 
#endif /* DRIZZLED_ITEM_DECIMAL_H */