~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.h

  • Committer: Mark Atwood
  • Date: 2008-10-16 11:33:16 UTC
  • mto: (520.1.13 drizzle)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: mark@fallenpegasus.com-20081016113316-ff6jdt31ck90sjdh
an implemention of the errmsg plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#define NOT_FIXED_DEC                   31
28
28
#endif
29
29
 
30
 
#include <drizzled/common.h>
 
30
#include <libdrizzle/drizzle_com.h>
31
31
#include <mysys/iocache.h>
32
32
 
33
33
class String;
34
 
 
35
 
#if defined(__cplusplus)
36
 
extern "C" {
37
 
#endif
38
 
 
39
 
  int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
40
 
  int stringcmp(const String *a,const String *b);
41
 
  String *copy_if_not_alloced(String *a,String *b,uint32_t arg_length);
42
 
  uint32_t copy_and_convert(char *to, uint32_t to_length,
43
 
                            const CHARSET_INFO * const to_cs,
44
 
                            const char *from, uint32_t from_length,
45
 
                            const CHARSET_INFO * const from_cs,
46
 
                            uint32_t *errors);
47
 
  uint32_t well_formed_copy_nchars(const CHARSET_INFO * const to_cs,
48
 
                                   char *to, uint32_t to_length,
49
 
                                   const CHARSET_INFO * const from_cs,
50
 
                                   const char *from, uint32_t from_length,
51
 
                                   uint32_t nchars,
52
 
                                   const char **well_formed_error_pos,
53
 
                                   const char **cannot_convert_error_pos,
54
 
                                   const char **from_end_pos);
55
 
  size_t my_copy_with_hex_escaping(const CHARSET_INFO * const cs,
56
 
                                   char *dst, size_t dstlen,
57
 
                                   const char *src, size_t srclen);
58
 
 
59
 
#if defined(__cplusplus)
60
 
}
61
 
#endif
 
34
int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
 
35
String *copy_if_not_alloced(String *a,String *b,uint32_t arg_length);
 
36
uint32_t copy_and_convert(char *to, uint32_t to_length, const CHARSET_INFO * const to_cs,
 
37
                        const char *from, uint32_t from_length,
 
38
                        const CHARSET_INFO * const from_cs, uint32_t *errors);
 
39
uint32_t well_formed_copy_nchars(const CHARSET_INFO * const to_cs,
 
40
                               char *to, uint32_t to_length,
 
41
                               const CHARSET_INFO * const from_cs,
 
42
                               const char *from, uint32_t from_length,
 
43
                               uint32_t nchars,
 
44
                               const char **well_formed_error_pos,
 
45
                               const char **cannot_convert_error_pos,
 
46
                               const char **from_end_pos);
 
47
size_t my_copy_with_hex_escaping(const CHARSET_INFO * const cs,
 
48
                                 char *dst, size_t dstlen,
 
49
                                 const char *src, size_t srclen);
62
50
 
63
51
class String
64
52
{
395
383
  return str+ cs->cset->scan(cs, str, end, MY_SEQ_SPACES) == end;
396
384
}
397
385
 
398
 
extern "C++" {
399
 
bool operator==(const String &s1, const String &s2);
400
 
bool operator!=(const String &s1, const String &s2);
 
386
inline
 
387
bool operator==(const String &s1, const String &s2)
 
388
{
 
389
  return stringcmp(&s1,&s2) == 0;
 
390
}
 
391
 
 
392
inline
 
393
bool operator!=(const String &s1, const String &s2)
 
394
{
 
395
  return !(s1 == s2);
401
396
}
402
397
 
403
398
#endif /* DRIZZLE_SERVER_SQL_STRING_H */