20
20
#define BOOST_REGEX_SOURCE
22
#include <boost/config.hpp>
22
#include <boost/detail/workaround.hpp>
26
#if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) && defined(_NATIVE_WCHAR_T_DEFINED) \
27
&& !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))\
28
&& BOOST_WORKAROUND(BOOST_MSVC, <1600)
30
// This is a horrible workaround, but without declaring these symbols extern we get
31
// duplicate symbol errors when linking if the application is built without
35
# define BOOST_REGEX_STDLIB_DECL _CRTIMP2_PURE
37
# define BOOST_REGEX_STDLIB_DECL _CRTIMP2
42
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
43
template class BOOST_REGEX_STDLIB_DECL allocator<unsigned short>;
44
template class BOOST_REGEX_STDLIB_DECL _String_val<unsigned short, allocator<unsigned short> >;
45
template class BOOST_REGEX_STDLIB_DECL basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >;
48
#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) && BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))
49
template<> BOOST_REGEX_STDLIB_DECL std::size_t __cdecl char_traits<unsigned short>::length(unsigned short const*);
52
template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(
53
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
54
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
55
template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(
56
const unsigned short *,
57
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
58
template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(
59
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
60
const unsigned short *);
61
template BOOST_REGEX_STDLIB_DECL bool __cdecl operator<(
62
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
63
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
64
template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>(
65
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
66
const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
70
#include <boost/regex/config.hpp>
23
71
#include <boost/detail/workaround.hpp>
25
73
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)
114
162
char_class_graph=char_class_alnum|char_class_punct,
115
163
char_class_blank=1<<9,
116
164
char_class_word=1<<10,
117
char_class_unicode=1<<11
165
char_class_unicode=1<<11,
166
char_class_horizontal=1<<12,
167
char_class_vertical=1<<13
120
170
c_regex_traits<wchar_t>::char_class_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_classname(const wchar_t* p1, const wchar_t* p2)
138
189
char_class_upper,
139
190
char_class_unicode,
140
191
char_class_upper,
141
193
char_class_alnum | char_class_word,
142
194
char_class_alnum | char_class_word,
143
195
char_class_xdigit,
146
int id = ::boost::re_detail::get_default_class_id(p1, p2);
198
int idx = ::boost::re_detail::get_default_class_id(p1, p2);
149
201
std::wstring s(p1, p2);
150
202
for(std::wstring::size_type i = 0; i < s.size(); ++i)
151
203
s[i] = (std::towlower)(s[i]);
152
id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
204
idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
154
BOOST_ASSERT(id+1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
206
BOOST_ASSERT(idx+1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
158
210
bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::isctype(wchar_t c, char_class_type mask)
169
221
|| ((mask & char_class_xdigit) && (std::iswxdigit)(c))
170
222
|| ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c))
171
223
|| ((mask & char_class_word) && (c == '_'))
172
|| ((mask & char_class_unicode) && (c & ~static_cast<wchar_t>(0xff)));
224
|| ((mask & char_class_unicode) && (c & ~static_cast<wchar_t>(0xff)))
225
|| ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == L'\v')))
226
|| ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c) && (c != L'\v'));
175
229
c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_collatename(const wchar_t* p1, const wchar_t* p2)