~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/charset.h

  • Committer: Olaf van der Spek
  • Date: 2011-11-09 20:20:23 UTC
  • mto: This revision was merged to the branch mainline in revision 2457.
  • Revision ID: olafvdspek@gmail.com-20111109202023-df2axkpkey9qouze
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
260
260
 
261
261
  bool isalpha(unsigned char c) const
262
262
  {
263
 
    return (ctype + 1)[c] & (_MY_U | _MY_L);
 
263
    return ctype[c + 1] & (_MY_U | _MY_L);
264
264
  }
265
265
 
266
266
  bool isupper(unsigned char c) const
267
267
  {
268
 
    return (ctype + 1)[c] & _MY_U;
 
268
    return ctype[c + 1] & _MY_U;
269
269
  }
270
270
 
271
271
  bool islower(unsigned char c) const
272
272
  {
273
 
    return (ctype + 1)[c] & _MY_L;
 
273
    return ctype[c + 1] & _MY_L;
274
274
  }
275
275
 
276
276
  bool isdigit(unsigned char c) const
277
277
  {
278
 
    return (ctype + 1)[c] & _MY_NMR;
 
278
    return ctype[c + 1] & _MY_NMR;
279
279
  }
280
280
 
281
281
  bool isxdigit(unsigned char c) const
282
282
  {
283
 
    return (ctype + 1)[c] & _MY_X;
 
283
    return ctype[c + 1] & _MY_X;
284
284
  }
285
285
 
286
286
  bool isalnum(unsigned char c) const
287
287
  {
288
 
    return (ctype + 1)[c] & (_MY_U | _MY_L | _MY_NMR);
 
288
    return ctype[c + 1] & (_MY_U | _MY_L | _MY_NMR);
289
289
  }
290
290
 
291
291
  bool isspace(unsigned char c) const
292
292
  {
293
 
    return (ctype + 1)[c] & _MY_SPC;
 
293
    return ctype[c + 1] & _MY_SPC;
294
294
  }
295
295
 
296
296
  bool ispunct(unsigned char c) const  
297
297
  {
298
 
    return (ctype + 1)[c] & _MY_PNT;
 
298
    return ctype[c + 1] & _MY_PNT;
299
299
  }
300
300
 
301
301
  bool isprint(unsigned char c) const
302
302
  {
303
 
    return (ctype + 1)[c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B);
 
303
    return ctype[c + 1] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B);
304
304
  }
305
305
 
306
306
  bool isgraph(unsigned char c) const
307
307
  {
308
 
    return (ctype + 1)[c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR);
 
308
    return ctype[c + 1] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR);
309
309
  }
310
310
 
311
311
  bool iscntrl(unsigned char c) const
312
312
  {
313
 
    return (ctype + 1)[c] & _MY_CTR;
 
313
    return ctype[c + 1] & _MY_CTR;
314
314
  }
315
315
 
316
316
  bool isvar(char c) const
342
342
  {
343
343
    return coll->strnxfrm(this, dst, dstlen, dstlen, src, srclen, MY_STRXFRM_PAD_WITH_SPACE);
344
344
  }
 
345
 
 
346
  int strcasecmp(const char *s, const char *t) const
 
347
  {
 
348
    return coll->strcasecmp(this, s, t);
 
349
  }
 
350
 
 
351
  size_t caseup_str(char* src) const
 
352
  {
 
353
    return cset->caseup_str(this, src);
 
354
  }
 
355
 
 
356
  size_t casedn_str(char* src) const
 
357
  {
 
358
    return cset->casedn_str(this, src);
 
359
  }
345
360
};
346
361
 
347
362
extern DRIZZLED_API charset_info_st *all_charsets[256];
574
589
  return (cs->coll->wildcmp(cs, str, strend, w_str, w_strend, escape, w_one, w_many));
575
590
}
576
591
 
577
 
inline static int my_strcasecmp(const charset_info_st *cs, const char *s, const char *t)
578
 
{
579
 
  return (cs->coll->strcasecmp(cs, s, t));
580
 
}
581
 
 
582
592
template <typename CHAR_T>
583
593
inline static size_t my_charpos(const charset_info_st *cs, 
584
594
                                const CHAR_T *b, const CHAR_T* e, size_t num)
602
612
}
603
613
 
604
614
 
605
 
inline static size_t my_caseup_str(const charset_info_st *cs, char *src)
606
 
{
607
 
  return cs->cset->caseup_str(cs, src);
608
 
}
609
 
 
610
 
inline static size_t my_casedn_str(const charset_info_st *cs, char *src)
611
 
{
612
 
  return cs->cset->casedn_str(cs, src);
613
 
}
614
 
 
615
615
inline static long my_strntol(const charset_info_st *cs, 
616
616
                              const char* s, const size_t l, const int base, char **e, int *err)
617
617
{