~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.h

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
  const CHARSET_INFO *str_charset;
69
69
public:
70
70
  String()
71
 
  { 
72
 
    Ptr=0; str_length=Alloced_length=0; alloced=0; 
73
 
    str_charset= &my_charset_bin; 
 
71
  {
 
72
    Ptr=0; str_length=Alloced_length=0; alloced=0;
 
73
    str_charset= &my_charset_bin;
74
74
  }
75
75
  String(uint32_t length_arg)
76
 
  { 
77
 
    alloced=0; Alloced_length=0; (void) real_alloc(length_arg); 
 
76
  {
 
77
    alloced=0; Alloced_length=0; (void) real_alloc(length_arg);
78
78
    str_charset= &my_charset_bin;
79
79
  }
80
80
  String(const char *str, const CHARSET_INFO * const cs)
81
 
  { 
 
81
  {
82
82
    Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0;
83
83
    str_charset=cs;
84
84
  }
85
85
  String(const char *str,uint32_t len, const CHARSET_INFO * const cs)
86
 
  { 
 
86
  {
87
87
    Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0;
88
88
    str_charset=cs;
89
89
  }
90
90
  String(char *str,uint32_t len, const CHARSET_INFO * const cs)
91
 
  { 
 
91
  {
92
92
    Ptr=(char*) str; Alloced_length=str_length=len; alloced=0;
93
93
    str_charset=cs;
94
94
  }
95
95
  String(const String &str)
96
 
  { 
 
96
  {
97
97
    Ptr=str.Ptr ; str_length=str.str_length ;
98
 
    Alloced_length=str.Alloced_length; alloced=0; 
 
98
    Alloced_length=str.Alloced_length; alloced=0;
99
99
    str_charset=str.str_charset;
100
100
  }
101
101
  static void *operator new(size_t size, MEM_ROOT *mem_root)
186
186
    statement to be run on the remote server, and have a comma after each.
187
187
    When the list is complete, I "chop" off the trailing comma
188
188
 
189
 
    ex. 
190
 
      String stringobj; 
 
189
    ex.
 
190
      String stringobj;
191
191
      stringobj.append("VALUES ('foo', 'fi', 'fo',");
192
192
      stringobj.chop();
193
193
      stringobj.append(")");
197
197
    VALUES ('foo', 'fi', 'fo',
198
198
    VALUES ('foo', 'fi', 'fo'
199
199
    VALUES ('foo', 'fi', 'fo')
200
 
      
 
200
 
201
201
  */
202
202
  inline void chop()
203
203
  {
204
 
    Ptr[str_length--]= '\0'; 
 
204
    Ptr[str_length--]= '\0';
205
205
  }
206
206
 
207
207
  inline void free()
246
246
    if (&s != this)
247
247
    {
248
248
      /*
249
 
        It is forbidden to do assignments like 
 
249
        It is forbidden to do assignments like
250
250
        some_string = substring_of_that_string
251
251
       */
252
252
      assert(!s.uses_buffer_owned_by(this));
273
273
  bool append(const char *s,uint32_t arg_length);
274
274
  bool append(const char *s,uint32_t arg_length, const CHARSET_INFO * const cs);
275
275
  bool append(IO_CACHE* file, uint32_t arg_length);
276
 
  bool append_with_prefill(const char *s, uint32_t arg_length, 
 
276
  bool append_with_prefill(const char *s, uint32_t arg_length,
277
277
                           uint32_t full_length, char fill_char);
278
278
  int strstr(const String &search,uint32_t offset=0); // Returns offset to substring or -1
279
279
  int strrstr(const String &search,uint32_t offset=0); // Returns offset to substring or -1
387
387
  }
388
388
};
389
389
 
390
 
static inline bool check_if_only_end_space(const CHARSET_INFO * const cs, char *str, 
 
390
static inline bool check_if_only_end_space(const CHARSET_INFO * const cs, char *str,
391
391
                                           char *end)
392
392
{
393
393
  return str+ cs->cset->scan(cs, str, end, MY_SEQ_SPACES) == end;