3 * Copyright (c) 1998-2000
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.
20 * DESCRIPTION: Declares regular expression traits classes.
23 #ifndef BOOST_REGEX_TRAITS_HPP
24 #define BOOST_REGEX_TRAITS_HPP
27 #include <boost/config.h>
29 #include <boost/cregex.hpp>
30 #include <boost/re_detail/regex_cstring.hpp>
35 #if __BORLANDC__ == 0x530
36 #pragma option push -a4 -b -Ve
37 #elif __BORLANDC__ > 0x530
38 #pragma option push -a8 -b -Ve
42 template <class charT>
53 BOOST_RE_IX_DECL bool BOOST_RE_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
54 BOOST_RE_IX_DECL unsigned int BOOST_RE_CALL re_get_default_message(char* buf, unsigned int len, unsigned int id);
55 extern BOOST_RE_IX_DECL const char *re_default_error_messages[];
56 BOOST_RE_IX_DECL bool BOOST_RE_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
57 BOOST_RE_IX_DECL bool BOOST_RE_CALL is_combining(wchar_t c);
58 //extern BOOST_RE_IX_DECL const wchar_t combining_ranges[];
60 #ifndef BOOST_RE_NO_WCSTRING
61 extern BOOST_RE_IX_DECL wchar_t wide_lower_case_map[];
62 extern BOOST_RE_IX_DECL unsigned short wide_unicode_classes[];
66 struct BOOST_RE_IX_DECL regex_traits_base
71 syntax_open_bracket = 1, // (
72 syntax_close_bracket = 2, // )
73 syntax_dollar = 3, // $
74 syntax_caret = 4, // ^
78 syntax_question = 8, // ?
79 syntax_open_set = 9, // [
80 syntax_close_set = 10, // ]
83 syntax_hash = 13, // #
84 syntax_dash = 14, // -
85 syntax_open_brace = 15, // {
86 syntax_close_brace = 16, // }
87 syntax_digit = 17, // 0-9
88 syntax_b = 18, // for \b
89 syntax_B = 19, // for \B
90 syntax_left_word = 20, // for \<
91 syntax_right_word = 21, // for \>
92 syntax_w = 22, // for \w
93 syntax_W = 23, // for \W
94 syntax_start_buffer = 24, // for \`
95 syntax_end_buffer = 25, // for \'
96 syntax_newline = 26, // for newline alt
97 syntax_comma = 27, // for {x,y}
99 syntax_a = 28, // for \a
100 syntax_f = 29, // for \f
101 syntax_n = 30, // for \n
102 syntax_r = 31, // for \r
103 syntax_t = 32, // for \t
104 syntax_v = 33, // for \v
105 syntax_x = 34, // for \xdd
106 syntax_c = 35, // for \cx
107 syntax_colon = 36, // for [:...:]
108 syntax_equal = 37, // for [=...=]
111 syntax_e = 38, // for \e
112 syntax_l = 39, // for \l
113 syntax_L = 40, // for \L
114 syntax_u = 41, // for \u
115 syntax_U = 42, // for \U
116 syntax_s = 43, // for \s
117 syntax_S = 44, // for \S
118 syntax_d = 45, // for \d
119 syntax_D = 46, // for \D
120 syntax_E = 47, // for \Q\E
121 syntax_Q = 48, // for \Q\E
122 syntax_X = 49, // for \X
123 syntax_C = 50, // for \C
124 syntax_Z = 51, // for \Z
125 syntax_G = 52, // for \G
131 struct BOOST_RE_IX_DECL c_traits_base : public regex_traits_base
136 char_class_alpha = 1,
137 char_class_cntrl = char_class_alpha << 1,
138 char_class_digit = char_class_cntrl << 1,
139 char_class_lower = char_class_digit << 1,
140 char_class_punct = char_class_lower << 1,
141 char_class_space = char_class_punct << 1,
142 char_class_upper = char_class_space << 1,
143 char_class_xdigit = char_class_upper << 1,
144 char_class_blank = char_class_xdigit << 1,
145 char_class_unicode = char_class_blank << 1,
146 char_class_underscore = char_class_unicode << 1,
148 char_class_alnum = char_class_alpha | char_class_digit,
149 char_class_graph = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore,
150 char_class_print = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore | char_class_blank,
151 char_class_word = char_class_alpha | char_class_digit | char_class_underscore
153 static std::string set_message_catalogue(const std::string& s);
155 #if defined(__MWERKS__) && __MWERKS__ <= 0x6000
156 friend class c_regex_traits<char>;
157 friend class c_regex_traits<wchar_t>;
160 static char regex_message_catalogue[200];
163 map_size = UCHAR_MAX + 1
166 static unsigned char syntax_map[map_size];
167 static unsigned short class_map[map_size];
168 static char lower_case_map[map_size];
170 static jm_uintfast32_t BOOST_RE_CALL do_lookup_class(const char* p);
171 static bool BOOST_RE_CALL do_lookup_collate(std::string& buf, const char* p);
172 static void BOOST_RE_CALL do_update_ctype();
173 static void BOOST_RE_CALL do_update_collate();
175 static std::string error_string(unsigned id);
176 static char* get_catalogue() { return regex_message_catalogue; }
179 } // namespace re_detail
183 class BOOST_RE_IX_DECL c_regex_traits<char> : public re_detail::c_traits_base
185 typedef re_detail::c_traits_base base_type;
187 typedef char char_type;
188 typedef unsigned char uchar_type;
189 typedef unsigned int size_type;
190 typedef std::string string_type;
191 typedef int locale_type;
193 static size_t BOOST_RE_CALL length(const char_type* p)
195 return std::strlen(p);
197 static unsigned int BOOST_RE_CALL syntax_type(size_type c)
199 return syntax_map[c];
201 static char BOOST_RE_CALL translate(char c, bool icase)
203 return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
205 static void BOOST_RE_CALL transform(std::string& out, const std::string& in);
207 static void BOOST_RE_CALL transform_primary(std::string& out, const std::string& in);
209 static bool BOOST_RE_CALL is_separator(char c)
211 return BOOST_RE_MAKE_BOOL((c == '\n') || (c == '\r'));
214 static bool BOOST_RE_CALL is_combining(char)
219 static bool BOOST_RE_CALL is_class(char c, jm_uintfast32_t f)
221 return BOOST_RE_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
224 static int BOOST_RE_CALL toi(char c);
225 static int BOOST_RE_CALL toi(const char*& first, const char* last, int radix);
227 static jm_uintfast32_t BOOST_RE_CALL lookup_classname(const char* first, const char* last)
229 std::string s(first, last);
230 return do_lookup_class(s.c_str());
233 static bool BOOST_RE_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
235 std::string s(first, last);
236 return do_lookup_collate(buf, s.c_str());
239 static locale_type imbue(locale_type l){ return l; }
240 locale_type BOOST_RE_CALL getloc()const{ return locale_type(); }
252 sentry(const c_regex_traits<char>&)
253 { c_regex_traits<char>::update(); }
254 operator void*() { return this; }
256 static void update();
260 static c_regex_traits<char> i;
262 static unsigned sort_type;
263 static char sort_delim;
266 #ifndef BOOST_RE_NO_WCSTRING
268 class BOOST_RE_IX_DECL c_regex_traits<wchar_t> : public re_detail::c_traits_base
270 typedef re_detail::c_traits_base base_type;
272 typedef wchar_t char_type;
273 typedef unsigned short uchar_type;
274 typedef unsigned int size_type;
275 typedef std::basic_string<wchar_t> string_type;
276 typedef int locale_type;
277 static size_t BOOST_RE_CALL length(const char_type* p)
279 return std::wcslen(p);
281 static unsigned int BOOST_RE_CALL syntax_type(size_type c);
282 static wchar_t BOOST_RE_CALL translate(wchar_t c, bool icase)
284 return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : std::towlower(c)) : c;
287 static void BOOST_RE_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
289 static void BOOST_RE_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
291 static bool BOOST_RE_CALL is_separator(wchar_t c)
293 return BOOST_RE_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
296 static bool BOOST_RE_CALL is_combining(wchar_t c)
297 { return re_detail::is_combining(c); }
299 static bool BOOST_RE_CALL is_class(wchar_t c, jm_uintfast32_t f)
301 return BOOST_RE_MAKE_BOOL(((uchar_type)c < 256) ? (re_detail::wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
304 static int BOOST_RE_CALL toi(wchar_t c);
305 static int BOOST_RE_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
307 static jm_uintfast32_t BOOST_RE_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
309 static bool BOOST_RE_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
311 static locale_type imbue(locale_type l){ return l; }
312 locale_type BOOST_RE_CALL getloc()const{ return locale_type(); }
313 c_regex_traits<wchar_t>()
315 ~c_regex_traits<wchar_t>()
319 sentry(const c_regex_traits<wchar_t>&)
320 { c_regex_traits<wchar_t>::update(); }
321 operator void*() { return this; }
323 static void BOOST_RE_CALL update();
324 static unsigned int BOOST_RE_CALL strnarrow(char *s1, unsigned int len, const wchar_t *s2);
325 static unsigned int BOOST_RE_CALL strwiden(wchar_t *s1, unsigned int len, const char *s2);
327 static bool BOOST_RE_CALL do_iswclass(wchar_t c, jm_uintfast32_t f);
328 static void BOOST_RE_CALL free();
329 static void BOOST_RE_CALL init();
330 static bool BOOST_RE_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
331 static c_regex_traits<wchar_t> init_;
333 static unsigned sort_type;
334 static wchar_t sort_delim;
338 #if defined(_WIN32) && !defined(BOOST_RE_NO_W32)
342 struct BOOST_RE_IX_DECL w32_traits_base : public regex_traits_base
346 char_class_alnum = C1_ALPHA | C1_DIGIT,
347 char_class_alpha = C1_ALPHA,
348 char_class_cntrl = C1_CNTRL,
349 char_class_digit = C1_DIGIT,
350 char_class_graph = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA,
351 char_class_lower = C1_LOWER,
352 char_class_print = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_ALPHA,
353 char_class_punct = C1_PUNCT,
354 char_class_space = C1_SPACE,
355 char_class_upper = C1_UPPER,
356 char_class_xdigit = C1_XDIGIT,
357 char_class_blank = C1_BLANK,
358 char_class_underscore = 0x0200,
359 char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
360 char_class_unicode = 0x0400
363 static std::string set_message_catalogue(const std::string& s);
365 static char regex_message_catalogue[200];
368 map_size = UCHAR_MAX + 1
371 static unsigned char syntax_map[map_size];
372 static unsigned short class_map[map_size];
373 static char lower_case_map[map_size];
375 static jm_uintfast32_t BOOST_RE_CALL do_lookup_class(const char* p);
376 static bool BOOST_RE_CALL do_lookup_collate(std::string& buf, const char* p);
377 static void BOOST_RE_CALL do_free();
378 static void BOOST_RE_CALL do_init();
380 static std::string error_string(unsigned id);
381 static char* get_catalogue() { return regex_message_catalogue; }
384 } // namespace re_detail
386 template<class charT>
387 class w32_regex_traits;
390 class BOOST_RE_IX_DECL w32_regex_traits<char> : public re_detail::w32_traits_base
392 typedef re_detail::w32_traits_base base_type;
394 typedef char char_type;
395 typedef unsigned char uchar_type;
396 typedef unsigned int size_type;
397 typedef std::string string_type;
398 typedef int locale_type;
400 static size_t BOOST_RE_CALL length(const char_type* p)
402 return std::strlen(p);
404 static unsigned int BOOST_RE_CALL syntax_type(size_type c)
406 return syntax_map[c];
408 static char BOOST_RE_CALL translate(char c, bool icase)
410 return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
412 static void BOOST_RE_CALL transform(std::string& out, const std::string& in);
414 static void BOOST_RE_CALL transform_primary(std::string& out, const std::string& in);
416 static bool BOOST_RE_CALL is_separator(char c)
418 return BOOST_RE_MAKE_BOOL((c == '\n') || (c == '\r'));
421 static bool BOOST_RE_CALL is_combining(char)
426 static bool BOOST_RE_CALL is_class(char c, jm_uintfast32_t f)
428 return BOOST_RE_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
431 static int BOOST_RE_CALL toi(char c);
432 static int BOOST_RE_CALL toi(const char*& first, const char* last, int radix);
434 static jm_uintfast32_t BOOST_RE_CALL lookup_classname(const char* first, const char* last)
436 std::string s(first, last);
437 return do_lookup_class(s.c_str());
440 static bool BOOST_RE_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
442 std::string s(first, last);
443 return do_lookup_collate(buf, s.c_str());
446 static locale_type imbue(locale_type l){ return l; }
447 locale_type BOOST_RE_CALL getloc()const{ return locale_type(); }
451 sentry(const w32_regex_traits<char>&)
452 { w32_regex_traits<char>::update(); }
454 operator void*() { return this; }
456 static void update();
460 static w32_regex_traits<char> i;
463 #ifndef BOOST_RE_NO_WCSTRING
465 class BOOST_RE_IX_DECL w32_regex_traits<wchar_t> : public re_detail::w32_traits_base
467 typedef re_detail::w32_traits_base base_type;
469 typedef wchar_t char_type;
470 typedef unsigned short uchar_type;
471 typedef unsigned int size_type;
472 typedef std::basic_string<wchar_t> string_type;
473 typedef int locale_type;
474 static size_t BOOST_RE_CALL length(const char_type* p)
476 return std::wcslen(p);
478 static unsigned int BOOST_RE_CALL syntax_type(size_type c);
479 static wchar_t BOOST_RE_CALL translate(wchar_t c, bool icase)
481 return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : wtolower(c)) : c;
484 static void BOOST_RE_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
486 static void BOOST_RE_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
488 static bool BOOST_RE_CALL is_separator(wchar_t c)
490 return BOOST_RE_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
493 static bool BOOST_RE_CALL is_combining(wchar_t c)
494 { return re_detail::is_combining(c); }
496 static bool BOOST_RE_CALL is_class(wchar_t c, jm_uintfast32_t f)
498 return BOOST_RE_MAKE_BOOL(((uchar_type)c < 256) ? (wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
501 static int BOOST_RE_CALL toi(wchar_t c);
502 static int BOOST_RE_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
504 static jm_uintfast32_t BOOST_RE_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
506 static bool BOOST_RE_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
508 static locale_type imbue(locale_type l){ return l; }
509 locale_type BOOST_RE_CALL getloc()const{ return locale_type(); }
513 sentry(const w32_regex_traits<wchar_t>&)
514 { w32_regex_traits<wchar_t>::update(); }
516 operator void*() { return this; }
518 static void BOOST_RE_CALL update();
521 static unsigned int BOOST_RE_CALL strnarrow(char *s1, unsigned int len, const wchar_t *s2);
522 static unsigned int BOOST_RE_CALL strwiden(wchar_t *s1, unsigned int len, const char *s2);
525 static bool BOOST_RE_CALL do_iswclass(wchar_t c, jm_uintfast32_t f);
526 static bool BOOST_RE_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
527 static w32_regex_traits<wchar_t> init_;
528 static wchar_t BOOST_RE_CALL wtolower(wchar_t c);
529 static unsigned short wide_unicode_classes[];
531 #endif // Wide strings
534 #ifndef BOOST_RE_NO_LOCALE_H
545 template <class charT>
549 struct message_data<char>;
552 struct message_data<wchar_t>;
554 struct BOOST_RE_IX_DECL cpp_regex_traits_base : public regex_traits_base
559 char_class_alnum = std::ctype_base::alnum,
560 char_class_alpha = std::ctype_base::alpha,
561 char_class_cntrl = std::ctype_base::cntrl,
562 char_class_digit = std::ctype_base::digit,
563 char_class_graph = std::ctype_base::graph,
564 char_class_lower = std::ctype_base::lower,
565 char_class_print = std::ctype_base::print,
566 char_class_punct = std::ctype_base::punct,
567 char_class_space = std::ctype_base::space,
568 char_class_upper = std::ctype_base::upper,
569 char_class_xdigit = std::ctype_base::xdigit,
570 char_class_blank = 1<<12,
571 char_class_underscore = 1<<13,
572 char_class_word = std::ctype_base::alnum | char_class_underscore,
573 char_class_unicode = 1<<14,
574 char_class_all_base = char_class_alnum | char_class_alpha | char_class_cntrl
575 | char_class_digit | char_class_graph | char_class_lower
576 | char_class_print | char_class_punct | char_class_space
577 | char_class_upper | char_class_xdigit
580 static std::string set_message_catalogue(const std::string& s);
582 static char regex_message_cat[200];
585 } // namespace re_detail
587 template <class charT>
588 class cpp_regex_traits;
591 class BOOST_RE_IX_DECL cpp_regex_traits<char> : public re_detail::cpp_regex_traits_base
593 typedef re_detail::cpp_regex_traits_base base_type;
595 re_detail::message_data<char>* pmd;
596 const unsigned char* psyntax;
598 const std::ctype<char>* pctype;
599 const std::collate<char>* pcollate;
600 std::locale locale_inst;
604 cpp_regex_traits(const cpp_regex_traits&);
605 cpp_regex_traits& operator=(const cpp_regex_traits&);
608 typedef char char_type;
609 typedef unsigned char uchar_type;
610 typedef unsigned int size_type;
611 typedef std::string string_type;
612 typedef std::locale locale_type;
617 static size_t BOOST_RE_CALL length(const char_type* p)
619 return std::strlen(p);
621 unsigned int BOOST_RE_CALL syntax_type(size_type c)const
625 char BOOST_RE_CALL translate(char c, bool icase)const
627 return icase ? lower_map[(size_type)(uchar_type)c] : c;
629 void BOOST_RE_CALL transform(std::string& out, const std::string& in)const
631 out = pcollate->transform(in.c_str(), in.c_str() + in.size()).c_str();
634 void BOOST_RE_CALL transform_primary(std::string& out, const std::string& in)const;
636 static bool BOOST_RE_CALL is_separator(char c)
638 return BOOST_RE_MAKE_BOOL((c == '\n') || (c == '\r'));
641 static bool BOOST_RE_CALL is_combining(char)
646 bool BOOST_RE_CALL is_class(char c, jm_uintfast32_t f)const
648 if(pctype->is((std::ctype<char>::mask)(f & char_class_all_base), c))
650 if((f & char_class_underscore) && (c == '_'))
652 if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
657 int BOOST_RE_CALL toi(char c)const;
658 int BOOST_RE_CALL toi(const char*& first, const char* last, int radix)const;
660 jm_uintfast32_t BOOST_RE_CALL lookup_classname(const char* first, const char* last)const;
661 bool BOOST_RE_CALL lookup_collatename(std::string& s, const char* first, const char* last)const;
663 std::string BOOST_RE_CALL error_string(unsigned id)const;
664 locale_type BOOST_RE_CALL imbue(locale_type l);
665 locale_type BOOST_RE_CALL BOOST_RE_CALL getloc()const{ return locale_inst; }
669 sentry(const cpp_regex_traits<char>&){}
670 operator void*() { return this; }
674 #ifndef BOOST_RE_NO_WCSTRING
676 class BOOST_RE_IX_DECL cpp_regex_traits<wchar_t> : public re_detail::cpp_regex_traits_base
678 typedef re_detail::cpp_regex_traits_base base_type;
680 typedef wchar_t char_type;
681 typedef unsigned short uchar_type;
682 typedef unsigned int size_type;
683 typedef std::basic_string<wchar_t> string_type;
684 typedef std::locale locale_type;
687 re_detail::message_data<wchar_t>* pmd;
688 const unsigned char* psyntax;
690 const std::ctype<wchar_t>* pctype;
691 const std::collate<wchar_t>* pcollate;
692 const std::codecvt<wchar_t, char, std::mbstate_t>* pcdv;
693 std::locale locale_inst;
694 unsigned int BOOST_RE_CALL do_syntax_type(size_type c)const;
698 cpp_regex_traits(const cpp_regex_traits&);
699 cpp_regex_traits& operator=(const cpp_regex_traits&);
703 static size_t BOOST_RE_CALL length(const char_type* p)
705 return std::wcslen(p);
707 unsigned int BOOST_RE_CALL syntax_type(size_type c)const
709 return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c);
711 wchar_t BOOST_RE_CALL translate(wchar_t c, bool icase)const
713 return icase ? (((uchar_type)c) <= UCHAR_MAX) ? lower_map[c] : pctype->tolower(c) : c;
715 void BOOST_RE_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const
717 out = pcollate->transform(in.c_str(), in.c_str() + in.size());
720 void BOOST_RE_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const;
722 static bool BOOST_RE_CALL is_separator(wchar_t c)
724 return BOOST_RE_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
727 static bool BOOST_RE_CALL is_combining(wchar_t c)
728 { return re_detail::is_combining(c); }
730 bool BOOST_RE_CALL is_class(wchar_t c, jm_uintfast32_t f)const
732 if(pctype->is((std::ctype<wchar_t>::mask)(f & char_class_all_base), c))
734 if((f & char_class_underscore) && (c == '_'))
736 if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
738 if((f & char_class_unicode) && (c > (size_type)(uchar_type)255))
743 int BOOST_RE_CALL toi(wchar_t c)const;
744 int BOOST_RE_CALL toi(const wchar_t*& first, const wchar_t* last, int radix)const;
746 jm_uintfast32_t BOOST_RE_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const;
747 bool BOOST_RE_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last)const;
749 std::string BOOST_RE_CALL error_string(unsigned id)const;
752 locale_type BOOST_RE_CALL imbue(locale_type l);
753 locale_type BOOST_RE_CALL BOOST_RE_CALL getloc()const{ return locale_inst; }
754 unsigned int BOOST_RE_CALL strwiden(wchar_t *s1, unsigned int len, const char *s2)const;
758 sentry(const cpp_regex_traits<wchar_t>&){}
759 operator void*() { return this; }
762 #endif // BOOST_RE_NO_WCSTRING
764 #endif // BOOST_RE_NO_LOCALE_H
766 #ifdef BOOST_RE_LOCALE_W32
768 template <class charT>
769 class regex_traits : public w32_regex_traits<charT>
773 #elif defined(BOOST_RE_LOCALE_C)
775 template <class charT>
776 class regex_traits : public c_regex_traits<charT>
780 #elif defined(BOOST_RE_LOCALE_CPP)
782 template <class charT>
783 class regex_traits : public cpp_regex_traits<charT>
788 #error No default localisation model defined
792 #if __BORLANDC__ > 0x520