mirror of
https://github.com/boostorg/regex.git
synced 2025-06-25 20:01:37 +02:00
Compare commits
110 Commits
svn-branch
...
boost-1.48
Author | SHA1 | Date | |
---|---|---|---|
957c390ead | |||
115a8fe837 | |||
fe16f3f039 | |||
5a0f62f00c | |||
490b3a6547 | |||
bad2122f48 | |||
713264371b | |||
afbb54c73b | |||
b267c55bc5 | |||
813e5f77e3 | |||
c499c62caa | |||
ec3dbbf5d6 | |||
7170423870 | |||
cfedb49110 | |||
09c9e93572 | |||
ac2017ebc7 | |||
4741ee7d94 | |||
5fe36e6e56 | |||
9529cb8bc0 | |||
61f4b3360f | |||
fc6408426d | |||
e41acbc33f | |||
ae79f29895 | |||
95ddff1f01 | |||
d8c6fe7ce8 | |||
438dcae4e4 | |||
7f89732479 | |||
a3b2f4031d | |||
513a205564 | |||
01eadc4ab6 | |||
be62e08702 | |||
3b8aca5d8b | |||
8f15600081 | |||
3e903e9c8e | |||
083ea3a6c7 | |||
2d43c1b305 | |||
e81f710567 | |||
3b3a3ce6d1 | |||
5e4ccdf0cf | |||
371ad14a3f | |||
9219aa0b5b | |||
5471176846 | |||
756a875620 | |||
b7d906dff5 | |||
a08e8b5c85 | |||
9546df1f23 | |||
b39edff796 | |||
788c8a8470 | |||
c527b20062 | |||
a65bccab1c | |||
8fffb1250e | |||
069e845239 | |||
79d7e84f26 | |||
45891854d9 | |||
a159bacf3f | |||
97daf0f81f | |||
dc01b7833e | |||
ff95eb8d98 | |||
c48d7bb478 | |||
3cd2b52030 | |||
f5af9ba18d | |||
3e68fcb703 | |||
1fe19b815a | |||
d44bf8c41d | |||
5b9e134fc4 | |||
2643fcb245 | |||
7ac90de75a | |||
2ebe6d4ec7 | |||
b93dc9c301 | |||
1b0ab17df9 | |||
07016623eb | |||
4c56f3c14e | |||
95e3612e72 | |||
fdf8aa83ec | |||
c1722ff3de | |||
77e43136d1 | |||
f5449c38a6 | |||
5654efcf98 | |||
8d5985ce42 | |||
bb8f057d6c | |||
9002d01f75 | |||
b057d0f943 | |||
67128fa65f | |||
9fc486658f | |||
f4d849ec8f | |||
db4120e46d | |||
c4d064add8 | |||
65347f0f7f | |||
d3b885e20b | |||
60b6dbf275 | |||
443a498845 | |||
7a3a6dc7c6 | |||
37b39f6635 | |||
b473011375 | |||
0a998e8bc8 | |||
eb93be73eb | |||
eb791cd1c3 | |||
5928770c46 | |||
2d6fea3308 | |||
b58521163b | |||
921b0d758e | |||
dae6cbfead | |||
17a038b672 | |||
ccc52a8a63 | |||
01cc2aaa50 | |||
4370fe4607 | |||
171749f440 | |||
c1c2058d3d | |||
1a732d8c6a | |||
f0ae398ada |
@ -15,6 +15,13 @@ Currently open issues can be viewed [@https://svn.boost.org/trac/boost/query?sta
|
||||
|
||||
All issues including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
|
||||
|
||||
[h4 Boost-1.48]
|
||||
|
||||
Fixed issues:
|
||||
[@https://svn.boost.org/trac/boost/ticket/688 #698], [@https://svn.boost.org/trac/boost/ticket/5835 #5835],
|
||||
[@https://svn.boost.org/trac/boost/ticket/5958 #5958], [@https://svn.boost.org/trac/boost/ticket/5736 #5736].
|
||||
|
||||
|
||||
[h4 Boost 1.47]
|
||||
|
||||
Fixed issues:
|
||||
|
@ -35,6 +35,16 @@
|
||||
<p>
|
||||
All issues including closed ones can be viewed <a href="https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component" target="_top">here</a>.
|
||||
</p>
|
||||
<a name="boost_regex.background_information.history.boost_1_48"></a><h5>
|
||||
<a name="boost_regex.background_information.history.boost_1_48-heading"></a>
|
||||
<a class="link" href="history.html#boost_regex.background_information.history.boost_1_48">Boost-1.48</a>
|
||||
</h5>
|
||||
<p>
|
||||
Fixed issues: <a href="https://svn.boost.org/trac/boost/ticket/688" target="_top">#698</a>,
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/5835" target="_top">#5835</a>,
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/5958" target="_top">#5958</a>,
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/5736" target="_top">#5736</a>.
|
||||
</p>
|
||||
<a name="boost_regex.background_information.history.boost_1_47"></a><h5>
|
||||
<a name="boost_regex.background_information.history.boost_1_47-heading"></a>
|
||||
<a class="link" href="history.html#boost_regex.background_information.history.boost_1_47">Boost
|
||||
|
@ -325,7 +325,7 @@
|
||||
<code class="computeroutput"><span class="identifier">basic_regex</span></code>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="id1071160"></a><p class="title"><b>Table 1. basic_regex default construction postconditions</b></p>
|
||||
<a name="id1070109"></a><p class="title"><b>Table 1. basic_regex default construction postconditions</b></p>
|
||||
<div class="table-contents"><table class="table" summary="basic_regex default construction postconditions">
|
||||
<colgroup>
|
||||
<col>
|
||||
@ -403,7 +403,7 @@
|
||||
flags</a> specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="id1071458"></a><p class="title"><b>Table 2. Postconditions for basic_regex construction</b></p>
|
||||
<a name="id1070408"></a><p class="title"><b>Table 2. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@ -506,7 +506,7 @@
|
||||
specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="id1071875"></a><p class="title"><b>Table 3. Postconditions for basic_regex construction</b></p>
|
||||
<a name="id1070825"></a><p class="title"><b>Table 3. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@ -608,7 +608,7 @@
|
||||
according the option flags specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="id1072283"></a><p class="title"><b>Table 4. Postconditions for basic_regex construction</b></p>
|
||||
<a name="id1071233"></a><p class="title"><b>Table 4. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@ -716,7 +716,7 @@
|
||||
flags</a> specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="id1072760"></a><p class="title"><b>Table 5. Postconditions for basic_regex construction</b></p>
|
||||
<a name="id1071710"></a><p class="title"><b>Table 5. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@ -816,7 +816,7 @@
|
||||
flags</a> specified in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="id1073122"></a><p class="title"><b>Table 6. Postconditions for basic_regex construction</b></p>
|
||||
<a name="id1072072"></a><p class="title"><b>Table 6. Postconditions for basic_regex construction</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex construction">
|
||||
<colgroup>
|
||||
<col>
|
||||
@ -1002,7 +1002,7 @@
|
||||
in <span class="emphasis"><em>f</em></span>.
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="id1075141"></a><p class="title"><b>Table 7. Postconditions for basic_regex::assign</b></p>
|
||||
<a name="id1074091"></a><p class="title"><b>Table 7. Postconditions for basic_regex::assign</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Postconditions for basic_regex::assign">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -28,7 +28,7 @@
|
||||
</h3></div></div></div>
|
||||
<div><p class="copyright">Copyright © 1998-2010 John Maddock</p></div>
|
||||
<div><div class="legalnotice">
|
||||
<a name="id1028452"></a><p>
|
||||
<a name="id1026993"></a><p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
@ -198,7 +198,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"><p><small>Last revised: July 21, 2011 at 09:38:30 GMT</small></p></td>
|
||||
<td align="left"><p><small>Last revised: October 16, 2011 at 12:24:31 GMT</small></p></td>
|
||||
<td align="right"><div class="copyright-footer"></div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
@ -251,7 +251,7 @@ inline u32regex do_make_u32regex(InputIterator i,
|
||||
const boost::mpl::int_<1>*)
|
||||
{
|
||||
typedef boost::u8_to_u32_iterator<InputIterator, UChar32> conv_type;
|
||||
return u32regex(conv_type(i), conv_type(j), opt);
|
||||
return u32regex(conv_type(i, i, j), conv_type(j, i, j), opt);
|
||||
}
|
||||
|
||||
template <class InputIterator>
|
||||
@ -261,7 +261,7 @@ inline u32regex do_make_u32regex(InputIterator i,
|
||||
const boost::mpl::int_<2>*)
|
||||
{
|
||||
typedef boost::u16_to_u32_iterator<InputIterator, UChar32> conv_type;
|
||||
return u32regex(conv_type(i), conv_type(j), opt);
|
||||
return u32regex(conv_type(i, i, j), conv_type(j, i, j), opt);
|
||||
}
|
||||
|
||||
template <class InputIterator>
|
||||
@ -282,7 +282,7 @@ inline u32regex do_make_u32regex(InputIterator i,
|
||||
typedef boost::u8_to_u32_iterator<InputIterator, UChar32> conv_type;
|
||||
typedef std::vector<UChar32> vector_type;
|
||||
vector_type v;
|
||||
conv_type a(i), b(j);
|
||||
conv_type a(i, i, j), b(j, i, j);
|
||||
while(a != b)
|
||||
{
|
||||
v.push_back(*a);
|
||||
@ -302,7 +302,7 @@ inline u32regex do_make_u32regex(InputIterator i,
|
||||
typedef boost::u16_to_u32_iterator<InputIterator, UChar32> conv_type;
|
||||
typedef std::vector<UChar32> vector_type;
|
||||
vector_type v;
|
||||
conv_type a(i), b(j);
|
||||
conv_type a(i, i, j), b(j, i, j);
|
||||
while(a != b)
|
||||
{
|
||||
v.push_back(*a);
|
||||
@ -425,7 +425,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last,
|
||||
typedef match_results<conv_type> match_type;
|
||||
typedef typename match_type::allocator_type alloc_type;
|
||||
match_type what;
|
||||
bool result = ::boost::regex_match(conv_type(first), conv_type(last), what, e, flags);
|
||||
bool result = ::boost::regex_match(conv_type(first, first, last), conv_type(last, first, last), what, e, flags);
|
||||
// copy results across to m:
|
||||
if(result) copy_results(m, what);
|
||||
return result;
|
||||
@ -441,7 +441,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last,
|
||||
typedef match_results<conv_type> match_type;
|
||||
typedef typename match_type::allocator_type alloc_type;
|
||||
match_type what;
|
||||
bool result = ::boost::regex_match(conv_type(first), conv_type(last), what, e, flags);
|
||||
bool result = ::boost::regex_match(conv_type(first, first, last), conv_type(last, first, last), what, e, flags);
|
||||
// copy results across to m:
|
||||
if(result) copy_results(m, what);
|
||||
return result;
|
||||
@ -600,7 +600,7 @@ bool do_regex_search(BidiIterator first, BidiIterator last,
|
||||
typedef match_results<conv_type> match_type;
|
||||
typedef typename match_type::allocator_type alloc_type;
|
||||
match_type what;
|
||||
bool result = ::boost::regex_search(conv_type(first), conv_type(last), what, e, flags, conv_type(base));
|
||||
bool result = ::boost::regex_search(conv_type(first, first, last), conv_type(last, first, last), what, e, flags, conv_type(base));
|
||||
// copy results across to m:
|
||||
if(result) copy_results(m, what);
|
||||
return result;
|
||||
@ -617,7 +617,7 @@ bool do_regex_search(BidiIterator first, BidiIterator last,
|
||||
typedef match_results<conv_type> match_type;
|
||||
typedef typename match_type::allocator_type alloc_type;
|
||||
match_type what;
|
||||
bool result = ::boost::regex_search(conv_type(first), conv_type(last), what, e, flags, conv_type(base));
|
||||
bool result = ::boost::regex_search(conv_type(first, first, last), conv_type(last, first, last), what, e, flags, conv_type(base));
|
||||
// copy results across to m:
|
||||
if(result) copy_results(m, what);
|
||||
return result;
|
||||
|
@ -1226,7 +1226,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
|
||||
for(unsigned int i = 0; i < (1u << CHAR_BIT); ++i)
|
||||
{
|
||||
charT c = static_cast<charT>(i);
|
||||
if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<mask_type>*>(state), *m_pdata, m_icase))
|
||||
if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<mask_type>*>(state), *m_pdata, l_icase))
|
||||
l_map[i] |= mask;
|
||||
}
|
||||
}
|
||||
|
@ -842,7 +842,15 @@ OutputIterator regex_format_imp(OutputIterator out,
|
||||
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator)
|
||||
|
||||
struct any_type { any_type(...); };
|
||||
struct any_type
|
||||
{
|
||||
template <class T>
|
||||
any_type(const T&);
|
||||
template <class T, class U>
|
||||
any_type(const T&, const U&);
|
||||
template <class T, class U, class V>
|
||||
any_type(const T&, const U&, const V&);
|
||||
};
|
||||
typedef char no_type;
|
||||
typedef char (&unary_type)[2];
|
||||
typedef char (&binary_type)[3];
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include "internals.hpp"
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)
|
||||
|
||||
@ -107,26 +108,6 @@ c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::transfo
|
||||
return result;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
char_class_space=1<<0,
|
||||
char_class_print=1<<1,
|
||||
char_class_cntrl=1<<2,
|
||||
char_class_upper=1<<3,
|
||||
char_class_lower=1<<4,
|
||||
char_class_alpha=1<<5,
|
||||
char_class_digit=1<<6,
|
||||
char_class_punct=1<<7,
|
||||
char_class_xdigit=1<<8,
|
||||
char_class_alnum=char_class_alpha|char_class_digit,
|
||||
char_class_graph=char_class_alnum|char_class_punct,
|
||||
char_class_blank=1<<9,
|
||||
char_class_word=1<<10,
|
||||
char_class_unicode=1<<11,
|
||||
char_class_horizontal=1<<12,
|
||||
char_class_vertical=1<<13
|
||||
};
|
||||
|
||||
c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::lookup_classname(const char* p1, const char* p2)
|
||||
{
|
||||
static const char_class_type masks[] =
|
||||
|
@ -361,11 +361,24 @@ void BuildFileList(std::list<std::string>* pl, const char* files, bool recurse)
|
||||
|
||||
while(dstart != dend)
|
||||
{
|
||||
// Verify that sprintf will not overflow:
|
||||
if(std::strlen(dstart.path()) + std::strlen(directory_iterator::separator()) + std::strlen(ptr) >= MAX_PATH)
|
||||
{
|
||||
// Oops overflow, skip this item:
|
||||
++dstart;
|
||||
continue;
|
||||
}
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||
(::sprintf_s)(buf, sizeof(buf), "%s%s%s", dstart.path(), directory_iterator::separator(), ptr);
|
||||
int r = (::sprintf_s)(buf, sizeof(buf), "%s%s%s", dstart.path(), directory_iterator::separator(), ptr);
|
||||
#else
|
||||
(std::sprintf)(buf, "%s%s%s", dstart.path(), directory_iterator::separator(), ptr);
|
||||
int r = (std::sprintf)(buf, "%s%s%s", dstart.path(), directory_iterator::separator(), ptr);
|
||||
#endif
|
||||
if(r < 0)
|
||||
{
|
||||
// sprintf failed, skip this item:
|
||||
++dstart;
|
||||
continue;
|
||||
}
|
||||
BuildFileList(pl, buf, recurse);
|
||||
++dstart;
|
||||
}
|
||||
|
@ -847,10 +847,16 @@ bool iswild(const char* mask, const char* name)
|
||||
unsigned _fi_attributes(const char* root, const char* name)
|
||||
{
|
||||
char buf[MAX_PATH];
|
||||
// verify that we can not overflow:
|
||||
if(std::strlen(root) + std::strlen(_fi_sep) + std::strlen(name) >= MAX_PATH)
|
||||
return 0;
|
||||
int r;
|
||||
if( ( (root[0] == *_fi_sep) || (root[0] == *_fi_sep_alt) ) && (root[1] == '\0') )
|
||||
(std::sprintf)(buf, "%s%s", root, name);
|
||||
r = (std::sprintf)(buf, "%s%s", root, name);
|
||||
else
|
||||
(std::sprintf)(buf, "%s%s%s", root, _fi_sep, name);
|
||||
r = (std::sprintf)(buf, "%s%s%s", root, _fi_sep, name);
|
||||
if(r < 0)
|
||||
return 0; // sprintf failed
|
||||
DIR* d = opendir(buf);
|
||||
if(d)
|
||||
{
|
||||
|
35
src/internals.hpp
Normal file
35
src/internals.hpp
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2011
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BOOST_REGEX_SRC_INTERNALS_HPP
|
||||
#define BOOST_REGEX_SRC_INTERNALS_HPP
|
||||
|
||||
enum
|
||||
{
|
||||
char_class_space=1<<0,
|
||||
char_class_print=1<<1,
|
||||
char_class_cntrl=1<<2,
|
||||
char_class_upper=1<<3,
|
||||
char_class_lower=1<<4,
|
||||
char_class_alpha=1<<5,
|
||||
char_class_digit=1<<6,
|
||||
char_class_punct=1<<7,
|
||||
char_class_xdigit=1<<8,
|
||||
char_class_alnum=char_class_alpha|char_class_digit,
|
||||
char_class_graph=char_class_alnum|char_class_punct,
|
||||
char_class_blank=1<<9,
|
||||
char_class_word=1<<10,
|
||||
char_class_unicode=1<<11,
|
||||
char_class_horizontal=1<<12,
|
||||
char_class_vertical=1<<13
|
||||
};
|
||||
|
||||
#endif // BOOST_REGEX_SRC_INTERNALS_HPP
|
@ -167,11 +167,17 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
|
||||
{
|
||||
if(std::strcmp(e->re_endp, names[i]) == 0)
|
||||
{
|
||||
//
|
||||
// We're converting an integer i to a string, and since i <= REG_E_UNKNOWN
|
||||
// a five character string is *always* large enough:
|
||||
//
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||
(::sprintf_s)(localbuf, 5, "%d", i);
|
||||
int r = (::sprintf_s)(localbuf, 5, "%d", i);
|
||||
#else
|
||||
(std::sprintf)(localbuf, "%d", i);
|
||||
int r = (std::sprintf)(localbuf, "%d", i);
|
||||
#endif
|
||||
if(r < 0)
|
||||
return 0; // sprintf failed
|
||||
if(std::strlen(localbuf) < buf_size)
|
||||
re_detail::strcpy_s(buf, buf_size, localbuf);
|
||||
return std::strlen(localbuf) + 1;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "internals.hpp"
|
||||
|
||||
#if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) && defined(_NATIVE_WCHAR_T_DEFINED) \
|
||||
&& !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))\
|
||||
@ -147,26 +148,6 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::t
|
||||
return result;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
char_class_space=1<<0,
|
||||
char_class_print=1<<1,
|
||||
char_class_cntrl=1<<2,
|
||||
char_class_upper=1<<3,
|
||||
char_class_lower=1<<4,
|
||||
char_class_alpha=1<<5,
|
||||
char_class_digit=1<<6,
|
||||
char_class_punct=1<<7,
|
||||
char_class_xdigit=1<<8,
|
||||
char_class_alnum=char_class_alpha|char_class_digit,
|
||||
char_class_graph=char_class_alnum|char_class_punct,
|
||||
char_class_blank=1<<9,
|
||||
char_class_word=1<<10,
|
||||
char_class_unicode=1<<11,
|
||||
char_class_horizontal=1<<12,
|
||||
char_class_vertical=1<<13
|
||||
};
|
||||
|
||||
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)
|
||||
{
|
||||
static const char_class_type masks[] =
|
||||
|
@ -74,7 +74,7 @@ const wchar_t* wnames[] = {
|
||||
};
|
||||
}
|
||||
|
||||
typedef boost::basic_regex<wchar_t, c_regex_traits<wchar_t> > c_regex_type;
|
||||
typedef boost::basic_regex<wchar_t, c_regex_traits<wchar_t> > wc_regex_type;
|
||||
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f)
|
||||
{
|
||||
@ -84,7 +84,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
try{
|
||||
#endif
|
||||
expression->guts = new c_regex_type();
|
||||
expression->guts = new wc_regex_type();
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
} catch(...)
|
||||
{
|
||||
@ -134,9 +134,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha
|
||||
try{
|
||||
#endif
|
||||
expression->re_magic = wmagic_value;
|
||||
static_cast<c_regex_type*>(expression->guts)->set_expression(ptr, p2, flags);
|
||||
expression->re_nsub = static_cast<c_regex_type*>(expression->guts)->mark_count() - 1;
|
||||
result = static_cast<c_regex_type*>(expression->guts)->error_code();
|
||||
static_cast<wc_regex_type*>(expression->guts)->set_expression(ptr, p2, flags);
|
||||
expression->re_nsub = static_cast<wc_regex_type*>(expression->guts)->mark_count() - 1;
|
||||
result = static_cast<wc_regex_type*>(expression->guts)->error_code();
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
}
|
||||
catch(const boost::regex_error& be)
|
||||
@ -215,7 +215,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
||||
{
|
||||
std::string p;
|
||||
if((e) && (e->re_magic == wmagic_value))
|
||||
p = static_cast<c_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
|
||||
p = static_cast<wc_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
|
||||
else
|
||||
{
|
||||
p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
|
||||
@ -264,7 +264,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, cons
|
||||
#endif
|
||||
if(expression->re_magic == wmagic_value)
|
||||
{
|
||||
result = regex_search(start, end, m, *static_cast<c_regex_type*>(expression->guts), flags);
|
||||
result = regex_search(start, end, m, *static_cast<wc_regex_type*>(expression->guts), flags);
|
||||
}
|
||||
else
|
||||
return result;
|
||||
@ -301,7 +301,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW* expression)
|
||||
{
|
||||
if(expression->re_magic == wmagic_value)
|
||||
{
|
||||
delete static_cast<c_regex_type*>(expression->guts);
|
||||
delete static_cast<wc_regex_type*>(expression->guts);
|
||||
}
|
||||
expression->re_magic = 0;
|
||||
}
|
||||
|
@ -189,6 +189,8 @@ test-suite regex
|
||||
|
||||
;
|
||||
|
||||
compile test_consolidated.cpp ;
|
||||
|
||||
build-project ../example ;
|
||||
|
||||
|
||||
|
@ -216,6 +216,10 @@ void test_options2()
|
||||
TEST_REGEX_SEARCH("(a(?i)b)c", perl, "ABc", match_default, make_array(-2, -2));
|
||||
TEST_REGEX_SEARCH("(a(?i)b)c", perl, "ABC", match_default, make_array(-2, -2));
|
||||
TEST_REGEX_SEARCH("(a(?i)b)c", perl, "AbC", match_default, make_array(-2, -2));
|
||||
TEST_REGEX_SEARCH("(?i)[dh]og", perl, "hog", match_default, make_array(0, 3, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?i)[dh]og", perl, "dog", match_default, make_array(0, 3, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?i)[dh]og", perl, "Hog", match_default, make_array(0, 3, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?i)[dh]og", perl, "Dog", match_default, make_array(0, 3, -2, -2));
|
||||
|
||||
TEST_REGEX_SEARCH("(a(?i)B)c", perl, "abc", match_default, make_array(0, 3, 0, 2, -2, -2));
|
||||
TEST_REGEX_SEARCH("(a(?i)B)c", perl, "aBc", match_default, make_array(0, 3, 0, 2, -2, -2));
|
||||
|
29
test/test_consolidated.cpp
Normal file
29
test/test_consolidated.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2011
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <libs/regex/src/c_regex_traits.cpp>
|
||||
#include <libs/regex/src/cpp_regex_traits.cpp>
|
||||
#include <libs/regex/src/cregex.cpp>
|
||||
#include <libs/regex/src/fileiter.cpp>
|
||||
#include <libs/regex/src/icu.cpp>
|
||||
#include <libs/regex/src/instances.cpp>
|
||||
#include <libs/regex/src/posix_api.cpp>
|
||||
#include <libs/regex/src/regex.cpp>
|
||||
#include <libs/regex/src/regex_debug.cpp>
|
||||
#include <libs/regex/src/regex_raw_buffer.cpp>
|
||||
#include <libs/regex/src/regex_traits_defaults.cpp>
|
||||
#include <libs/regex/src/static_mutex.cpp>
|
||||
#include <libs/regex/src/usinstances.cpp>
|
||||
#include <libs/regex/src/wc_regex_traits.cpp>
|
||||
#include <libs/regex/src/w32_regex_traits.cpp>
|
||||
#include <libs/regex/src/wide_posix_api.cpp>
|
||||
#include <libs/regex/src/winstances.cpp>
|
@ -30,7 +30,7 @@
|
||||
template <class I>
|
||||
typename I::value_type iterate_over(I a, I b)
|
||||
{
|
||||
typedef I::value_type value_type;
|
||||
typedef typename I::value_type value_type;
|
||||
value_type v = 0;
|
||||
while(a != b)
|
||||
{
|
||||
|
Reference in New Issue
Block a user