~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.h

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_FIELD_BLOB_H
22
 
#define DRIZZLED_FIELD_BLOB_H
 
21
#pragma once
23
22
 
24
23
#include <drizzled/field/str.h>
25
24
 
26
 
#include "drizzled/global_charset_info.h"
 
25
#include <drizzled/global_charset_info.h>
27
26
 
28
27
#include <string>
29
28
 
 
29
#include <drizzled/visibility.h>
 
30
 
30
31
namespace drizzled
31
32
{
32
33
 
33
34
/**
34
35
 * Class representing a BLOB data type column
35
36
 */
36
 
class Field_blob :public Field_str {
 
37
class DRIZZLED_API Field_blob :
 
38
  public Field_str
 
39
{
37
40
protected:
38
41
  String value;                         // For temporaries
39
42
public:
50
53
             unsigned char null_bit_arg,
51
54
             const char *field_name_arg,
52
55
             TableShare *share,
53
 
             const CHARSET_INFO * const cs);
 
56
             const charset_info_st * const cs);
54
57
  Field_blob(uint32_t len_arg,
55
58
             bool maybe_null_arg,
56
59
             const char *field_name_arg,
57
 
             const CHARSET_INFO * const cs)
 
60
             const charset_info_st * const cs)
58
61
    :Field_str((unsigned char*) NULL,
59
62
               len_arg,
60
63
               maybe_null_arg ? (unsigned char *) "": 0,
69
72
  enum ha_base_keytype key_type() const
70
73
    { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
71
74
  int  store(const char *to,uint32_t length,
72
 
             const CHARSET_INFO * const charset);
 
75
             const charset_info_st * const charset);
73
76
  int  store(double nr);
74
77
  int  store(int64_t nr, bool unsigned_val);
75
78
 
76
 
  double val_real(void);
77
 
  int64_t val_int(void);
78
 
  String *val_str(String*,String *);
79
 
  my_decimal *val_decimal(my_decimal *);
 
79
  double val_real(void) const;
 
80
  int64_t val_int(void) const;
 
81
  String *val_str(String*,String *) const;
 
82
  type::Decimal *val_decimal(type::Decimal *) const;
80
83
  int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length);
81
84
  int cmp(const unsigned char *a,const unsigned char *b)
82
85
    { return cmp_max(a, b, UINT32_MAX); }
128
131
  */
129
132
  uint32_t get_packed_size(const unsigned char *ptr_arg, bool low_byte_first);
130
133
 
131
 
  uint32_t get_length(uint32_t row_offset= 0);
132
 
  uint32_t get_length(const unsigned char *ptr, bool low_byte_first);
133
 
  uint32_t get_length(const unsigned char *ptr_arg);
 
134
  DRIZZLED_API uint32_t get_length(uint32_t row_offset= 0) const;
 
135
  DRIZZLED_API uint32_t get_length(const unsigned char *ptr, bool low_byte_first) const;
 
136
  DRIZZLED_API uint32_t get_length(const unsigned char *ptr_arg) const;
134
137
  void put_length(unsigned char *pos, uint32_t length);
135
138
  inline void get_ptr(unsigned char **str)
136
139
    {
189
192
 
190
193
} /* namespace drizzled */
191
194
 
192
 
#endif /* DRIZZLED_FIELD_BLOB_H */
193
195