~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.h

  • Committer: Brian Aker
  • Date: 2010-12-30 04:59:36 UTC
  • mto: (2040.1.2 clean) (2041.2.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2041.
  • Revision ID: brian@tangent.org-20101230045936-r1i4sek9qotl8abq
result_type() to display the internal type.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
/* This file is originally from the mysql distribution. Coded by monty */
24
24
 
25
25
#include <drizzled/common.h>
26
 
 
27
26
#include <cassert>
28
27
#include <cstdlib>
29
28
#include <cstring>
30
29
#include <string>
31
30
 
32
 
#include "drizzled/visibility.h"
33
 
 
34
31
#ifndef NOT_FIXED_DEC
35
32
#define NOT_FIXED_DEC                   (uint8_t)31
36
33
#endif
40
37
 
41
38
class String;
42
39
 
43
 
extern DRIZZLED_API String my_empty_string;
 
40
extern String my_empty_string;
44
41
extern const String my_null_string;
45
42
namespace memory { class Root; }
46
43
typedef struct charset_info_st CHARSET_INFO;
47
44
 
48
 
DRIZZLED_API std::string String_to_std_string(String const& s);
49
 
DRIZZLED_API String* set_String_from_std_string(String* s, std::string const& cs);
 
45
std::string String_to_std_string(String const& s);
 
46
String* set_String_from_std_string(String* s, std::string const& cs);
50
47
 
51
48
int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
52
49
int stringcmp(const String *a,const String *b);
61
58
                                 const char **from_end_pos);
62
59
 
63
60
 
64
 
class DRIZZLED_API String
 
61
class String
65
62
{
66
63
  char *Ptr;
67
64
  size_t str_length,Alloced_length;
249
246
 
250
247
  bool copy();                                  // Alloc string if not alloced
251
248
  bool copy(const String &s);                   // Allocate new string
252
 
  bool copy(const std::string&, const CHARSET_INFO * const cs); // Allocate new string
253
249
  bool copy(const char *s,size_t arg_length, const CHARSET_INFO * const cs);    // Allocate new string
254
250
  static bool needs_conversion(size_t arg_length,
255
251
                               const CHARSET_INFO * const cs_from, const CHARSET_INFO * const cs_to,
256
252
                               size_t *offset);
257
253
  bool set_or_copy_aligned(const char *s, size_t arg_length, const CHARSET_INFO * const cs);
258
254
  bool copy(const char*s,size_t arg_length, const CHARSET_INFO * const csfrom,
259
 
            const CHARSET_INFO * const csto, size_t *errors);
 
255
            const CHARSET_INFO * const csto, size_t *errors);
260
256
  bool append(const String &s);
261
257
  bool append(const char *s);
262
258
  bool append(const char *s,size_t arg_length);