3
* Copyright (c) 1998-2002
6
* Permission to use, copy, modify, distribute and sell this software
7
* and its documentation for any purpose is hereby granted without fee,
8
* provided that the above copyright notice appear in all copies and
9
* that both that copyright notice and this permission notice appear
10
* in supporting documentation. Dr John Maddock makes no representations
11
* about the suitability of this software for any purpose.
12
* It is provided "as is" without express or implied warranty.
17
* LOCATION: see http://www.boost.org for most recent version.
18
* FILE regex_traits.hpp
19
* VERSION see <boost/version.hpp>
20
* DESCRIPTION: Declares regular expression traits classes.
23
#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
24
#define BOOST_REGEX_TRAITS_HPP_INCLUDED
26
#ifndef BOOST_RE_CREGEX_HPP
27
#include <boost/cregex.hpp>
29
#ifndef BOOST_REGEX_CSTRING_HPP
30
#include <boost/regex/v3/regex_cstring.hpp>
36
#pragma option push -a8 -b -Vx -Ve -pc
39
template <class charT>
50
BOOST_REGEX_DECL bool BOOST_REGEX_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
51
BOOST_REGEX_DECL std::size_t BOOST_REGEX_CALL re_get_default_message(char* buf, std::size_t len, std::size_t id);
52
extern BOOST_REGEX_DECL const char *re_default_error_messages[];
54
#ifndef BOOST_NO_WREGEX
55
extern BOOST_REGEX_DECL wchar_t wide_lower_case_map[];
56
extern BOOST_REGEX_DECL unsigned short wide_unicode_classes[];
57
BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(wchar_t c);
61
struct BOOST_REGEX_DECL regex_traits_base
66
syntax_open_bracket = 1, // (
67
syntax_close_bracket = 2, // )
68
syntax_dollar = 3, // $
69
syntax_caret = 4, // ^
73
syntax_question = 8, // ?
74
syntax_open_set = 9, // [
75
syntax_close_set = 10, // ]
78
syntax_hash = 13, // #
79
syntax_dash = 14, // -
80
syntax_open_brace = 15, // {
81
syntax_close_brace = 16, // }
82
syntax_digit = 17, // 0-9
83
syntax_b = 18, // for \b
84
syntax_B = 19, // for \B
85
syntax_left_word = 20, // for \<
86
syntax_right_word = 21, // for \>
87
syntax_w = 22, // for \w
88
syntax_W = 23, // for \W
89
syntax_start_buffer = 24, // for \`
90
syntax_end_buffer = 25, // for \'
91
syntax_newline = 26, // for newline alt
92
syntax_comma = 27, // for {x,y}
94
syntax_a = 28, // for \a
95
syntax_f = 29, // for \f
96
syntax_n = 30, // for \n
97
syntax_r = 31, // for \r
98
syntax_t = 32, // for \t
99
syntax_v = 33, // for \v
100
syntax_x = 34, // for \xdd
101
syntax_c = 35, // for \cx
102
syntax_colon = 36, // for [:...:]
103
syntax_equal = 37, // for [=...=]
106
syntax_e = 38, // for \e
107
syntax_l = 39, // for \l
108
syntax_L = 40, // for \L
109
syntax_u = 41, // for \u
110
syntax_U = 42, // for \U
111
syntax_s = 43, // for \s
112
syntax_S = 44, // for \S
113
syntax_d = 45, // for \d
114
syntax_D = 46, // for \D
115
syntax_E = 47, // for \Q\E
116
syntax_Q = 48, // for \Q\E
117
syntax_X = 49, // for \X
118
syntax_C = 50, // for \C
119
syntax_Z = 51, // for \Z
120
syntax_G = 52, // for \G
123
syntax_not = 53, // for (?!...)
133
struct BOOST_REGEX_DECL c_traits_base : public regex_traits_base
138
char_class_alpha = 0x0001,
139
char_class_cntrl = 0x0002,
140
char_class_digit = 0x0004,
141
char_class_lower = 0x0008,
142
char_class_punct = 0x0010,
143
char_class_space = 0x0020,
144
char_class_upper = 0x0040,
145
char_class_xdigit = 0x0080,
146
char_class_blank = 0x0100,
147
char_class_underscore = 0x4000,
148
char_class_unicode = 0x8000,
150
char_class_alnum = char_class_alpha | char_class_digit,
151
char_class_graph = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore,
152
char_class_print = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore | char_class_blank,
153
char_class_word = char_class_alpha | char_class_digit | char_class_underscore
155
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
157
#if defined(__MWERKS__) && __MWERKS__ <= 0x6000
158
friend class c_regex_traits<char>;
159
friend class c_regex_traits<wchar_t>;
162
static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
165
map_size = UCHAR_MAX + 1
168
static unsigned char syntax_map[map_size];
169
static unsigned short class_map[map_size];
170
static char lower_case_map[map_size];
172
static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
173
static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
174
static void BOOST_REGEX_CALL do_update_ctype();
175
static void BOOST_REGEX_CALL do_update_collate();
177
static std::string BOOST_REGEX_CALL error_string(unsigned id);
178
static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
181
} // namespace re_detail
185
class BOOST_REGEX_DECL c_regex_traits<char> : public re_detail::c_traits_base
187
typedef re_detail::c_traits_base base_type;
189
typedef char char_type;
190
typedef unsigned char uchar_type;
191
typedef unsigned int size_type;
192
typedef std::string string_type;
193
typedef int locale_type;
195
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
197
return std::strlen(p);
199
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
201
return syntax_map[c];
203
static char BOOST_REGEX_CALL translate(char c, bool icase)
205
return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
207
static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
209
static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
211
static bool BOOST_REGEX_CALL is_separator(char c)
213
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
216
static bool BOOST_REGEX_CALL is_combining(char)
221
static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
223
return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
226
static int BOOST_REGEX_CALL toi(char c);
227
static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
229
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
231
std::string s(first, last);
232
return do_lookup_class(s.c_str());
235
static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
237
std::string s(first, last);
238
return do_lookup_collate(buf, s.c_str());
241
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
242
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
254
sentry(const c_regex_traits<char>&)
255
{ c_regex_traits<char>::update(); }
256
operator void*() { return this; }
258
static void BOOST_REGEX_CALL update();
260
static void BOOST_REGEX_CALL init();
261
static void BOOST_REGEX_CALL m_free();
262
static c_regex_traits<char> i;
264
static unsigned sort_type;
265
static char sort_delim;
268
#ifndef BOOST_NO_WREGEX
270
class BOOST_REGEX_DECL c_regex_traits<wchar_t> : public re_detail::c_traits_base
272
typedef re_detail::c_traits_base base_type;
274
typedef wchar_t char_type;
275
typedef unsigned short uchar_type;
276
typedef unsigned int size_type;
277
typedef std::basic_string<wchar_t> string_type;
278
typedef int locale_type;
279
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
281
return std::wcslen(p);
283
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
284
static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
286
return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : std::towlower(c)) : c;
289
static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
291
static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
293
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
295
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
298
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
299
{ return re_detail::is_combining(c); }
301
static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
303
return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (re_detail::wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
306
static int BOOST_REGEX_CALL toi(wchar_t c);
307
static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
309
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
311
static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
313
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
314
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
315
c_regex_traits<wchar_t>()
317
~c_regex_traits<wchar_t>()
321
sentry(const c_regex_traits<wchar_t>&)
322
{ c_regex_traits<wchar_t>::update(); }
323
operator void*() { return this; }
325
static void BOOST_REGEX_CALL update();
326
static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
327
static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
329
static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
330
static void BOOST_REGEX_CALL m_free();
331
static void BOOST_REGEX_CALL init();
332
static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
333
static c_regex_traits<wchar_t> init_;
335
static unsigned sort_type;
336
static wchar_t sort_delim;
340
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
344
struct BOOST_REGEX_DECL w32_traits_base : public regex_traits_base
348
char_class_alnum = C1_ALPHA | C1_DIGIT,
349
char_class_alpha = C1_ALPHA,
350
char_class_cntrl = C1_CNTRL,
351
char_class_digit = C1_DIGIT,
352
char_class_graph = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA,
353
char_class_lower = C1_LOWER,
354
char_class_print = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_ALPHA,
355
char_class_punct = C1_PUNCT,
356
char_class_space = C1_SPACE,
357
char_class_upper = C1_UPPER,
358
char_class_xdigit = C1_XDIGIT,
359
char_class_blank = C1_BLANK,
360
char_class_underscore = 0x4000,
361
char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
362
char_class_unicode = 0x8000,
363
char_class_win = 0x01FF
368
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
370
static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
373
map_size = UCHAR_MAX + 1
376
static unsigned char syntax_map[map_size];
377
static unsigned short class_map[map_size];
378
static char lower_case_map[map_size];
380
static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
381
static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
382
static void BOOST_REGEX_CALL do_free();
383
static void BOOST_REGEX_CALL do_init();
385
static std::string BOOST_REGEX_CALL error_string(unsigned id);
386
static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
390
} // namespace re_detail
392
template<class charT>
393
class w32_regex_traits;
396
class BOOST_REGEX_DECL w32_regex_traits<char> : public re_detail::w32_traits_base
398
typedef re_detail::w32_traits_base base_type;
400
typedef char char_type;
401
typedef unsigned char uchar_type;
402
typedef unsigned int size_type;
403
typedef std::string string_type;
404
typedef int locale_type;
406
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
408
return std::strlen(p);
410
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
412
return syntax_map[c];
414
static char BOOST_REGEX_CALL translate(char c, bool icase)
416
return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
418
static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
420
static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
422
static bool BOOST_REGEX_CALL is_separator(char c)
424
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
427
static bool BOOST_REGEX_CALL is_combining(char)
432
static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
434
return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
437
static int BOOST_REGEX_CALL toi(char c);
438
static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
440
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
442
std::string s(first, last);
443
return do_lookup_class(s.c_str());
446
static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
448
std::string s(first, last);
449
return do_lookup_collate(buf, s.c_str());
452
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
453
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
457
sentry(const w32_regex_traits<char>&)
458
{ w32_regex_traits<char>::update(); }
460
operator void*() { return this; }
462
static void BOOST_REGEX_CALL update();
466
static w32_regex_traits<char> i;
469
#ifndef BOOST_NO_WREGEX
471
class BOOST_REGEX_DECL w32_regex_traits<wchar_t> : public re_detail::w32_traits_base
473
typedef re_detail::w32_traits_base base_type;
475
typedef wchar_t char_type;
476
typedef unsigned short uchar_type;
477
typedef unsigned int size_type;
478
typedef std::basic_string<wchar_t> string_type;
479
typedef int locale_type;
480
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
482
return std::wcslen(p);
484
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
485
static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
487
return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : wtolower(c)) : c;
490
static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
492
static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
494
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
496
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
499
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
500
{ return re_detail::is_combining(c); }
502
static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
504
return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
507
static int BOOST_REGEX_CALL toi(wchar_t c);
508
static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
510
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
512
static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
514
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
515
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
519
sentry(const w32_regex_traits<wchar_t>&)
520
{ w32_regex_traits<wchar_t>::update(); }
522
operator void*() { return this; }
524
static void BOOST_REGEX_CALL update();
527
static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
528
static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
531
static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
532
static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
533
static w32_regex_traits<wchar_t> init_;
534
static wchar_t BOOST_REGEX_CALL wtolower(wchar_t c);
535
static unsigned short wide_unicode_classes[];
537
#endif // Wide strings
540
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
549
#pragma option push -a4 -b -Ve -pc
557
template <class charT>
561
struct message_data<char>;
564
struct message_data<wchar_t>;
566
struct BOOST_REGEX_DECL cpp_regex_traits_base : public regex_traits_base
571
char_class_alnum = std::ctype_base::alnum,
572
char_class_alpha = std::ctype_base::alpha,
573
char_class_cntrl = std::ctype_base::cntrl,
574
char_class_digit = std::ctype_base::digit,
575
char_class_graph = std::ctype_base::graph,
576
char_class_lower = std::ctype_base::lower,
577
char_class_print = std::ctype_base::print,
578
char_class_punct = std::ctype_base::punct,
579
char_class_space = std::ctype_base::space,
580
char_class_upper = std::ctype_base::upper,
581
char_class_xdigit = std::ctype_base::xdigit,
582
char_class_blank = 1<<12,
583
char_class_underscore = 1<<13,
584
char_class_word = std::ctype_base::alnum | char_class_underscore,
585
char_class_unicode = 1<<14,
586
char_class_all_base = char_class_alnum | char_class_alpha | char_class_cntrl
587
| char_class_digit | char_class_graph | char_class_lower
588
| char_class_print | char_class_punct | char_class_space
589
| char_class_upper | char_class_xdigit
592
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
594
static char regex_message_cat[BOOST_REGEX_MAX_PATH];
597
} // namespace re_detail
599
template <class charT>
600
class cpp_regex_traits;
603
class BOOST_REGEX_DECL cpp_regex_traits<char> : public re_detail::cpp_regex_traits_base
605
typedef re_detail::cpp_regex_traits_base base_type;
607
re_detail::message_data<char>* pmd;
608
const unsigned char* psyntax;
610
const std::ctype<char>* pctype;
611
const std::collate<char>* pcollate;
612
std::locale locale_inst;
616
cpp_regex_traits(const cpp_regex_traits&);
617
cpp_regex_traits& operator=(const cpp_regex_traits&);
620
typedef char char_type;
621
typedef unsigned char uchar_type;
622
typedef unsigned int size_type;
623
typedef std::string string_type;
624
typedef std::locale locale_type;
629
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
631
return std::strlen(p);
633
unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
637
char BOOST_REGEX_CALL translate(char c, bool icase)const
639
return icase ? lower_map[(size_type)(uchar_type)c] : c;
641
void BOOST_REGEX_CALL transform(std::string& out, const std::string& in)const
643
out = pcollate->transform(in.c_str(), in.c_str() + in.size()).c_str();
646
void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in)const;
648
static bool BOOST_REGEX_CALL is_separator(char c)
650
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
653
static bool BOOST_REGEX_CALL is_combining(char)
658
bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)const
660
if(pctype->is((std::ctype<char>::mask)(f & char_class_all_base), c))
662
if((f & char_class_underscore) && (c == '_'))
664
if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
669
int BOOST_REGEX_CALL toi(char c)const;
670
int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix)const;
672
boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)const;
673
bool BOOST_REGEX_CALL lookup_collatename(std::string& s, const char* first, const char* last)const;
675
std::string BOOST_REGEX_CALL error_string(unsigned id)const;
676
locale_type BOOST_REGEX_CALL imbue(locale_type l);
677
locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
681
sentry(const cpp_regex_traits<char>&){}
682
operator void*() { return this; }
686
#ifndef BOOST_NO_WREGEX
688
class BOOST_REGEX_DECL cpp_regex_traits<wchar_t> : public re_detail::cpp_regex_traits_base
690
typedef re_detail::cpp_regex_traits_base base_type;
692
typedef wchar_t char_type;
693
typedef unsigned short uchar_type;
694
typedef unsigned int size_type;
695
typedef std::basic_string<wchar_t> string_type;
696
typedef std::locale locale_type;
699
re_detail::message_data<wchar_t>* pmd;
700
const unsigned char* psyntax;
702
const std::ctype<wchar_t>* pctype;
703
const std::collate<wchar_t>* pcollate;
704
const std::codecvt<wchar_t, char, std::mbstate_t>* pcdv;
705
std::locale locale_inst;
706
unsigned int BOOST_REGEX_CALL do_syntax_type(size_type c)const;
710
cpp_regex_traits(const cpp_regex_traits&);
711
cpp_regex_traits& operator=(const cpp_regex_traits&);
715
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
717
return std::wcslen(p);
719
unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
721
return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c);
723
wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)const
725
return icase ? (((uchar_type)c) <= UCHAR_MAX) ? lower_map[c] : pctype->tolower(c) : c;
727
void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const
729
out = pcollate->transform(in.c_str(), in.c_str() + in.size());
732
void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const;
734
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
736
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
739
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
740
{ return re_detail::is_combining(c); }
742
bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)const
744
if(pctype->is((std::ctype<wchar_t>::mask)(f & char_class_all_base), c))
746
if((f & char_class_underscore) && (c == '_'))
748
if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
750
if((f & char_class_unicode) && ((uchar_type)c > (uchar_type)255))
755
int BOOST_REGEX_CALL toi(wchar_t c)const;
756
int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix)const;
758
boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const;
759
bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last)const;
761
std::string BOOST_REGEX_CALL error_string(unsigned id)const;
764
locale_type BOOST_REGEX_CALL imbue(locale_type l);
765
locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
766
std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2)const;
770
sentry(const cpp_regex_traits<wchar_t>&){}
771
operator void*() { return this; }
774
#endif // BOOST_NO_WREGEX
776
#endif // BOOST_NO_STD_LOCALE
778
#ifdef BOOST_REGEX_USE_WIN32_LOCALE
780
template <class charT>
781
class regex_traits : public w32_regex_traits<charT>
785
#elif defined(BOOST_REGEX_USE_C_LOCALE)
787
template <class charT>
788
class regex_traits : public c_regex_traits<charT>
792
#elif defined(BOOST_REGEX_USE_CPP_LOCALE)
794
template <class charT>
795
class regex_traits : public cpp_regex_traits<charT>
800
#error No default localisation model defined