~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/boolean.h

  • Committer: Mark Atwood
  • Date: 2011-06-22 05:48:25 UTC
  • mfrom: (2318.6.17 refactor12)
  • Revision ID: me@mark.atwood.name-20110622054825-mf8nxjs9dxcpvcfe
bzr merge lp:~olafvdspek/drizzle/refactor12

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <drizzled/field.h>
24
24
#include <string>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
namespace field
29
 
{
 
26
namespace drizzled {
 
27
namespace field {
30
28
 
31
 
class Boolean :public Field {
 
29
class Boolean : public Field 
 
30
{
32
31
  bool ansi_display;
33
32
 
34
33
public:
56
55
  int64_t val_int() const;
57
56
  type::Decimal *val_decimal(type::Decimal *) const;
58
57
 
59
 
  void sql_type(drizzled::String&) const;
60
 
 
61
58
  Item_result result_type () const { return STRING_RESULT; }
62
59
  int cmp(const unsigned char*, const unsigned char*);
63
60
  void sort_string(unsigned char*, uint32_t);
77
74
  }
78
75
 
79
76
private:
80
 
  void setTrue();
81
 
 
82
 
  void setFalse()
 
77
  void set(bool v)
83
78
  {
84
 
    ptr[0]= 0;
 
79
    ptr[0]= v;
85
80
  }
86
81
 
87
82
  bool isTrue() const
88
83
  {
89
 
    return ptr[0] ? true : false;
 
84
    return ptr[0];
90
85
  }
91
86
};
92
87