mirror of
https://github.com/boostorg/regex.git
synced 2025-08-01 05:24:38 +02:00
Merge branch 'develop'
This commit is contained in:
@@ -224,7 +224,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1200) && defined(_MSC_EXTENSIONS)
|
||||
#if defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS)
|
||||
#if defined(_DEBUG) || defined(__MSVC_RUNTIME_CHECKS) || defined(_MANAGED) || defined(BOOST_REGEX_NO_FASTCALL)
|
||||
# define BOOST_REGEX_CALL __cdecl
|
||||
#else
|
||||
|
@@ -887,9 +887,6 @@ inline OutputIterator u32regex_replace(OutputIterator out,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::extract_output_base
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
<OutputIterator>
|
||||
#endif
|
||||
(
|
||||
re_detail::do_regex_replace(
|
||||
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
@@ -909,9 +906,6 @@ inline OutputIterator u32regex_replace(OutputIterator out,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::extract_output_base
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
<OutputIterator>
|
||||
#endif
|
||||
(
|
||||
re_detail::do_regex_replace(
|
||||
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
@@ -931,9 +925,6 @@ inline OutputIterator u32regex_replace(OutputIterator out,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return re_detail::extract_output_base
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
<OutputIterator>
|
||||
#endif
|
||||
(
|
||||
re_detail::do_regex_replace(
|
||||
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
|
||||
|
@@ -31,20 +31,16 @@ typedef match_results<TCHAR const*> tmatch;
|
||||
typedef regex_iterator<TCHAR const*> tregex_iterator;
|
||||
typedef regex_token_iterator<TCHAR const*> tregex_token_iterator;
|
||||
|
||||
#if _MSC_VER >= 1310
|
||||
// Obsolete. Remove
|
||||
#define SIMPLE_STRING_PARAM class B, bool b
|
||||
#define SIMPLE_STRING_ARG_LIST B, b
|
||||
#else
|
||||
#define SIMPLE_STRING_PARAM class B
|
||||
#define SIMPLE_STRING_ARG_LIST B
|
||||
#endif
|
||||
|
||||
//
|
||||
// define regex creation functions:
|
||||
//
|
||||
template <SIMPLE_STRING_PARAM>
|
||||
template <class B, bool b>
|
||||
inline basic_regex<B>
|
||||
make_regex(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, ::boost::regex_constants::syntax_option_type f = boost::regex_constants::normal)
|
||||
make_regex(const ATL::CSimpleStringT<B, b>& s, ::boost::regex_constants::syntax_option_type f = boost::regex_constants::normal)
|
||||
{
|
||||
basic_regex<B> result(s.GetString(), s.GetString() + s.GetLength(), f);
|
||||
return result;
|
||||
@@ -52,8 +48,8 @@ make_regex(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, ::boost::regex_
|
||||
//
|
||||
// regex_match overloads:
|
||||
//
|
||||
template <SIMPLE_STRING_PARAM, class A, class T>
|
||||
inline bool regex_match(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
template <class B, bool b, class A, class T>
|
||||
inline bool regex_match(const ATL::CSimpleStringT<B, b>& s,
|
||||
match_results<const B*, A>& what,
|
||||
const basic_regex<B, T>& e,
|
||||
boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
@@ -65,8 +61,8 @@ inline bool regex_match(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
f);
|
||||
}
|
||||
|
||||
template <SIMPLE_STRING_PARAM, class T>
|
||||
inline bool regex_match(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
template <class B, bool b, class T>
|
||||
inline bool regex_match(const ATL::CSimpleStringT<B, b>& s,
|
||||
const basic_regex<B, T>& e,
|
||||
boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
{
|
||||
@@ -78,8 +74,8 @@ inline bool regex_match(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
//
|
||||
// regex_search overloads:
|
||||
//
|
||||
template <SIMPLE_STRING_PARAM, class A, class T>
|
||||
inline bool regex_search(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
template <class B, bool b, class A, class T>
|
||||
inline bool regex_search(const ATL::CSimpleStringT<B, b>& s,
|
||||
match_results<const B*, A>& what,
|
||||
const basic_regex<B, T>& e,
|
||||
boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
@@ -91,8 +87,8 @@ inline bool regex_search(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
f);
|
||||
}
|
||||
|
||||
template <SIMPLE_STRING_PARAM, class T>
|
||||
inline bool regex_search(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
template <class B, bool b, class T>
|
||||
inline bool regex_search(const ATL::CSimpleStringT<B, b>& s,
|
||||
const basic_regex<B, T>& e,
|
||||
boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
{
|
||||
@@ -104,45 +100,45 @@ inline bool regex_search(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
//
|
||||
// regex_iterator creation:
|
||||
//
|
||||
template <SIMPLE_STRING_PARAM>
|
||||
template <class B, bool b>
|
||||
inline regex_iterator<B const*>
|
||||
make_regex_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
make_regex_iterator(const ATL::CSimpleStringT<B, b>& s, const basic_regex<B>& e, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
{
|
||||
regex_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, f);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <SIMPLE_STRING_PARAM>
|
||||
template <class B, bool b>
|
||||
inline regex_token_iterator<B const*>
|
||||
make_regex_token_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, int sub = 0, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
make_regex_token_iterator(const ATL::CSimpleStringT<B, b>& s, const basic_regex<B>& e, int sub = 0, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
{
|
||||
regex_token_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, sub, f);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <SIMPLE_STRING_PARAM>
|
||||
template <class B, bool b>
|
||||
inline regex_token_iterator<B const*>
|
||||
make_regex_token_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, const std::vector<int>& subs, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
make_regex_token_iterator(const ATL::CSimpleStringT<B, b>& s, const basic_regex<B>& e, const std::vector<int>& subs, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
{
|
||||
regex_token_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, subs, f);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <SIMPLE_STRING_PARAM, std::size_t N>
|
||||
template <class B, bool b, std::size_t N>
|
||||
inline regex_token_iterator<B const*>
|
||||
make_regex_token_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, const int (& subs)[N], ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
make_regex_token_iterator(const ATL::CSimpleStringT<B, b>& s, const basic_regex<B>& e, const int (& subs)[N], ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
|
||||
{
|
||||
regex_token_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, subs, f);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class OutputIterator, class BidirectionalIterator, class traits,
|
||||
SIMPLE_STRING_PARAM>
|
||||
class B, bool b>
|
||||
OutputIterator regex_replace(OutputIterator out,
|
||||
BidirectionalIterator first,
|
||||
BidirectionalIterator last,
|
||||
const basic_regex<B, traits>& e,
|
||||
const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& fmt,
|
||||
const ATL::CSimpleStringT<B, b>& fmt,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return ::boost::regex_replace(out, first, last, e, fmt.GetString(), flags);
|
||||
@@ -150,12 +146,12 @@ OutputIterator regex_replace(OutputIterator out,
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
template <SIMPLE_STRING_PARAM>
|
||||
template <class B, bool b>
|
||||
class mfc_string_out_iterator
|
||||
{
|
||||
ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>* out;
|
||||
ATL::CSimpleStringT<B, b>* out;
|
||||
public:
|
||||
mfc_string_out_iterator(ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s) : out(&s) {}
|
||||
mfc_string_out_iterator(ATL::CSimpleStringT<B, b>& s) : out(&s) {}
|
||||
mfc_string_out_iterator& operator++() { return *this; }
|
||||
mfc_string_out_iterator& operator++(int) { return *this; }
|
||||
mfc_string_out_iterator& operator*() { return *this; }
|
||||
@@ -173,14 +169,14 @@ public:
|
||||
|
||||
}
|
||||
|
||||
template <class traits, SIMPLE_STRING_PARAM>
|
||||
ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST> regex_replace(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
|
||||
template <class traits, class B, bool b>
|
||||
ATL::CSimpleStringT<B, b> regex_replace(const ATL::CSimpleStringT<B, b>& s,
|
||||
const basic_regex<B, traits>& e,
|
||||
const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& fmt,
|
||||
const ATL::CSimpleStringT<B, b>& fmt,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST> result(s.GetManager());
|
||||
re_detail::mfc_string_out_iterator<SIMPLE_STRING_ARG_LIST> i(result);
|
||||
ATL::CSimpleStringT<B, b> result(s.GetManager());
|
||||
re_detail::mfc_string_out_iterator<B, b> i(result);
|
||||
regex_replace(i, s.GetString(), s.GetString() + s.GetLength(), e, fmt.GetString(), flags);
|
||||
return result;
|
||||
}
|
||||
|
@@ -141,7 +141,7 @@ class u32_to_u16_iterator
|
||||
{
|
||||
typedef boost::iterator_facade<u32_to_u16_iterator<BaseIterator, U16Type>, U16Type, std::bidirectional_iterator_tag, const U16Type> base_type;
|
||||
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
|
||||
|
||||
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 32);
|
||||
@@ -256,7 +256,7 @@ class u16_to_u32_iterator
|
||||
// special values for pending iterator reads:
|
||||
BOOST_STATIC_CONSTANT(U32Type, pending_read = 0xffffffffu);
|
||||
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
|
||||
|
||||
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 16);
|
||||
@@ -371,7 +371,7 @@ class u32_to_u8_iterator
|
||||
{
|
||||
typedef boost::iterator_facade<u32_to_u8_iterator<BaseIterator, U8Type>, U8Type, std::bidirectional_iterator_tag, const U8Type> base_type;
|
||||
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
|
||||
|
||||
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 32);
|
||||
@@ -499,7 +499,7 @@ class u8_to_u32_iterator
|
||||
// special values for pending iterator reads:
|
||||
BOOST_STATIC_CONSTANT(U32Type, pending_read = 0xffffffffu);
|
||||
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
|
||||
|
||||
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 8);
|
||||
|
@@ -47,9 +47,7 @@ struct digraph : public std::pair<charT, charT>
|
||||
digraph(charT c1) : std::pair<charT, charT>(c1, 0){}
|
||||
digraph(charT c1, charT c2) : std::pair<charT, charT>(c1, c2)
|
||||
{}
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
digraph(const digraph<charT>& d) : std::pair<charT, charT>(d.first, d.second){}
|
||||
#endif
|
||||
template <class Seq>
|
||||
digraph(const Seq& s) : std::pair<charT, charT>()
|
||||
{
|
||||
@@ -433,20 +431,10 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
||||
if(flags() & regex_constants::collate)
|
||||
{
|
||||
// we need to transform our range into sort keys:
|
||||
#if BOOST_WORKAROUND(__GNUC__, < 3)
|
||||
string_type in(3, charT(0));
|
||||
in[0] = c1.first;
|
||||
in[1] = c1.second;
|
||||
s1 = this->m_traits.transform(in.c_str(), (in[1] ? in.c_str()+2 : in.c_str()+1));
|
||||
in[0] = c2.first;
|
||||
in[1] = c2.second;
|
||||
s2 = this->m_traits.transform(in.c_str(), (in[1] ? in.c_str()+2 : in.c_str()+1));
|
||||
#else
|
||||
charT a1[3] = { c1.first, c1.second, charT(0), };
|
||||
charT a2[3] = { c2.first, c2.second, charT(0), };
|
||||
s1 = this->m_traits.transform(a1, (a1[1] ? a1+2 : a1+1));
|
||||
s2 = this->m_traits.transform(a2, (a2[1] ? a2+2 : a2+1));
|
||||
#endif
|
||||
if(s1.size() == 0)
|
||||
s1 = string_type(1, charT(0));
|
||||
if(s2.size() == 0)
|
||||
@@ -491,15 +479,8 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
||||
string_type s;
|
||||
if(first->second)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__GNUC__, < 3)
|
||||
string_type in(3, charT(0));
|
||||
in[0] = first->first;
|
||||
in[1] = first->second;
|
||||
s = m_traits.transform_primary(in.c_str(), in.c_str()+2);
|
||||
#else
|
||||
charT cs[3] = { first->first, first->second, charT(0), };
|
||||
s = m_traits.transform_primary(cs, cs+2);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
s = m_traits.transform_primary(&first->first, &first->first+1);
|
||||
|
@@ -624,7 +624,6 @@ typename cpp_regex_traits_implementation<charT>::string_type
|
||||
return pos->second;
|
||||
}
|
||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
|
||||
std::string name(p1, p2);
|
||||
#else
|
||||
@@ -635,7 +634,6 @@ typename cpp_regex_traits_implementation<charT>::string_type
|
||||
#endif
|
||||
name = lookup_default_collate_name(name);
|
||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
|
||||
if(name.size())
|
||||
return string_type(name.begin(), name.end());
|
||||
@@ -857,7 +855,7 @@ bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_t
|
||||
|
||||
|
||||
template <class charT>
|
||||
inline boost::shared_ptr<const cpp_regex_traits_implementation<charT> > create_cpp_regex_traits(const std::locale& l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT))
|
||||
inline boost::shared_ptr<const cpp_regex_traits_implementation<charT> > create_cpp_regex_traits(const std::locale& l)
|
||||
{
|
||||
cpp_regex_traits_base<charT> key(l);
|
||||
return ::boost::object_cache<cpp_regex_traits_base<charT>, cpp_regex_traits_implementation<charT> >::get(key, 5);
|
||||
|
@@ -92,9 +92,7 @@ template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHA
|
||||
|
||||
template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template class BOOST_REGEX_TEMPLATE_DECL match_results< const BOOST_REGEX_CHAR_T* >;
|
||||
#endif
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
|
||||
#endif
|
||||
@@ -102,9 +100,7 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_
|
||||
&& !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))\
|
||||
&& !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))\
|
||||
&& !defined(BOOST_REGEX_ICU_INSTANCES)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
|
||||
#endif
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
|
||||
#endif
|
||||
|
@@ -33,7 +33,7 @@
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
|
||||
template <class T>
|
||||
struct regex_iterator_traits
|
||||
|
@@ -71,7 +71,7 @@ typedef enum _match_flags
|
||||
|
||||
} match_flags;
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER < 1300)) || defined(__BORLANDC__)
|
||||
#if defined(__BORLANDC__)
|
||||
typedef unsigned long match_flag_type;
|
||||
#else
|
||||
typedef match_flags match_flag_type;
|
||||
|
@@ -86,7 +86,6 @@ inline bool can_start(unsigned int c, const unsigned char* map, unsigned char ma
|
||||
// which succeeds when it should not.
|
||||
//
|
||||
#ifndef _RWSTD_VER
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
|
||||
template <class C, class T, class A>
|
||||
inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
{
|
||||
@@ -97,9 +96,7 @@ inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
}
|
||||
return s.compare(p);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
|
||||
template <class C, class T, class A>
|
||||
inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
{
|
||||
@@ -110,7 +107,6 @@ inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
}
|
||||
return s.compare(p);
|
||||
}
|
||||
#endif
|
||||
inline int string_compare(const std::string& s, const char* p)
|
||||
{ return std::strcmp(s.c_str(), p); }
|
||||
# ifndef BOOST_NO_WREGEX
|
||||
|
@@ -458,11 +458,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_word_boundary()
|
||||
if(position != last)
|
||||
{
|
||||
// prev and this character must be opposites:
|
||||
#if defined(BOOST_REGEX_USE_C_LOCALE) && defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
|
||||
b = traits::isctype(*position, m_word_mask);
|
||||
#else
|
||||
b = traits_inst.isctype(*position, m_word_mask);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
|
||||
//
|
||||
// Borland C++ Builder 6, and Visual C++ 6,
|
||||
@@ -45,10 +44,8 @@ namespace boost{
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4700)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4700)
|
||||
#endif
|
||||
|
||||
template <class BidirectionalIterator,
|
||||
@@ -75,7 +72,6 @@ public:
|
||||
: end(last), re(*p), flags(f), subs(v){}
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|
||||
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
template <class T>
|
||||
@@ -209,7 +205,6 @@ public:
|
||||
}
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|
||||
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
template <class T>
|
||||
@@ -296,7 +291,6 @@ inline regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_ite
|
||||
{
|
||||
return regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m);
|
||||
}
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <class charT, class traits, std::size_t N>
|
||||
inline regex_token_iterator<const charT*, charT, traits> make_regex_token_iterator(const charT* p, const basic_regex<charT, traits>& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default)
|
||||
{
|
||||
@@ -307,7 +301,6 @@ inline regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_ite
|
||||
{
|
||||
return regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m);
|
||||
}
|
||||
#endif
|
||||
template <class charT, class traits>
|
||||
inline regex_token_iterator<const charT*, charT, traits> make_regex_token_iterator(const charT* p, const basic_regex<charT, traits>& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default)
|
||||
{
|
||||
@@ -319,10 +312,8 @@ inline regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_ite
|
||||
return regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m);
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
|
@@ -83,7 +83,7 @@ struct regex_traits : public implementationT
|
||||
// required "standard" ones:
|
||||
//
|
||||
namespace re_detail{
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, < 60000)
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60000)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(boost_extensions_tag)
|
||||
#else
|
||||
template<class T>
|
||||
@@ -136,7 +136,7 @@ struct compute_wrapper_base
|
||||
{
|
||||
typedef BaseT type;
|
||||
};
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, < 60000)
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60000)
|
||||
template <class BaseT>
|
||||
struct compute_wrapper_base<BaseT, false>
|
||||
{
|
||||
|
@@ -36,7 +36,7 @@ template <class BidiIterator>
|
||||
struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
{
|
||||
typedef typename re_detail::regex_iterator_traits<BidiIterator>::value_type value_type;
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
#else
|
||||
typedef typename re_detail::regex_iterator_traits<BidiIterator>::difference_type difference_type;
|
||||
@@ -50,7 +50,6 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
sub_match() : std::pair<BidiIterator, BidiIterator>(), matched(false) {}
|
||||
sub_match(BidiIterator i) : std::pair<BidiIterator, BidiIterator>(i, i), matched(false) {}
|
||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1310)\
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)\
|
||||
&& !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
|
||||
template <class T, class A>
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#define BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP
|
||||
|
||||
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
|
||||
//
|
||||
// Borland C++ Builder 6, and Visual C++ 6,
|
||||
@@ -37,7 +36,7 @@ namespace boost{
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4700)
|
||||
#endif
|
||||
@@ -62,10 +61,7 @@ public:
|
||||
: end(last), re(*p), flags(f){ subs.push_back(sub); }
|
||||
u32regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector<int>& v, match_flag_type f)
|
||||
: end(last), re(*p), flags(f), subs(v){}
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// can't reliably get this to work....
|
||||
#elif (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|
||||
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|
||||
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
template <class T>
|
||||
@@ -195,10 +191,7 @@ public:
|
||||
if(!pdata->init(a))
|
||||
pdata.reset();
|
||||
}
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// can't reliably get this to work....
|
||||
#elif (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|
||||
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|
||||
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
template <class T>
|
||||
@@ -299,7 +292,6 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
|
||||
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// construction from a reference to an array:
|
||||
template <std::size_t N>
|
||||
inline u32regex_token_iterator<const char*> make_u32regex_token_iterator(const char* p, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default)
|
||||
@@ -331,7 +323,6 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
|
||||
{
|
||||
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
|
||||
}
|
||||
#endif // BOOST_MSVC < 1300
|
||||
|
||||
// construction from a vector of sub_match state_id's:
|
||||
inline u32regex_token_iterator<const char*> make_u32regex_token_iterator(const char* p, const u32regex& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default)
|
||||
@@ -361,7 +352,7 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
|
||||
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
|
@@ -399,7 +399,6 @@ typename w32_regex_traits_implementation<charT>::string_type
|
||||
return pos->second;
|
||||
}
|
||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
|
||||
std::string name(p1, p2);
|
||||
#else
|
||||
@@ -410,7 +409,6 @@ typename w32_regex_traits_implementation<charT>::string_type
|
||||
#endif
|
||||
name = lookup_default_collate_name(name);
|
||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
|
||||
if(name.size())
|
||||
return string_type(name.begin(), name.end());
|
||||
@@ -552,7 +550,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
|
||||
|
||||
|
||||
template <class charT>
|
||||
boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::re_detail::lcid_type l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT))
|
||||
boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::re_detail::lcid_type l)
|
||||
{
|
||||
// TODO: create a cache for previously constructed objects.
|
||||
return boost::object_cache< ::boost::re_detail::lcid_type, w32_regex_traits_implementation<charT> >::get(l, 5);
|
||||
|
Reference in New Issue
Block a user