mirror of
https://github.com/boostorg/regex.git
synced 2025-07-16 13:52:17 +02:00
Big workaround removal.
This commit is contained in:
@ -115,7 +115,7 @@ private:
|
||||
#if defined(BOOST_MSVC) && defined(_M_IX86)
|
||||
// This is an ugly warning suppression workaround (for warnings *inside* std::vector
|
||||
// that can not otherwise be suppressed)...
|
||||
BOOST_STATIC_ASSERT(sizeof(long) >= sizeof(void*));
|
||||
static_assert(sizeof(long) >= sizeof(void*), "Long isn't long enough!");
|
||||
std::vector<long> m_alt_jumps; // list of alternative in the current scope.
|
||||
#else
|
||||
std::vector<std::ptrdiff_t> m_alt_jumps; // list of alternative in the current scope.
|
||||
|
@ -632,7 +632,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
|
||||
// is to replace each character with 2, fortunately this code isn't used that
|
||||
// much as this is now slower than before :-(
|
||||
//
|
||||
typedef typename make_unsigned<charT>::type uchar_type;
|
||||
typedef typename std::make_unsigned<charT>::type uchar_type;
|
||||
result2.reserve(result.size() * 2 + 2);
|
||||
for(unsigned i = 0; i < result.size(); ++i)
|
||||
{
|
||||
|
@ -33,90 +33,9 @@
|
||||
namespace boost{
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
|
||||
template <class T>
|
||||
struct regex_iterator_traits
|
||||
{
|
||||
typedef typename T::iterator_category iterator_category;
|
||||
typedef typename T::value_type value_type;
|
||||
#if !defined(BOOST_NO_STD_ITERATOR)
|
||||
typedef typename T::difference_type difference_type;
|
||||
typedef typename T::pointer pointer;
|
||||
typedef typename T::reference reference;
|
||||
#else
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef value_type* pointer;
|
||||
typedef value_type& reference;
|
||||
#endif
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct pointer_iterator_traits
|
||||
{
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
};
|
||||
template <class T>
|
||||
struct const_pointer_iterator_traits
|
||||
{
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef const T* pointer;
|
||||
typedef const T& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct regex_iterator_traits<char*> : pointer_iterator_traits<char>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<const char*> : const_pointer_iterator_traits<char>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<wchar_t*> : pointer_iterator_traits<wchar_t>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<const wchar_t*> : const_pointer_iterator_traits<wchar_t>{};
|
||||
//
|
||||
// the follwoing are needed for ICU support:
|
||||
//
|
||||
template<>
|
||||
struct regex_iterator_traits<unsigned char*> : pointer_iterator_traits<char>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<const unsigned char*> : const_pointer_iterator_traits<char>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<int*> : pointer_iterator_traits<int>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<const int*> : const_pointer_iterator_traits<int>{};
|
||||
|
||||
#ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
|
||||
template<>
|
||||
struct regex_iterator_traits<unsigned short*> : pointer_iterator_traits<unsigned short>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<const unsigned short*> : const_pointer_iterator_traits<unsigned short>{};
|
||||
#endif
|
||||
|
||||
#if defined(__SGI_STL_PORT) && defined(__STL_DEBUG)
|
||||
template<>
|
||||
struct regex_iterator_traits<std::string::iterator> : pointer_iterator_traits<char>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<std::string::const_iterator> : const_pointer_iterator_traits<char>{};
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<>
|
||||
struct regex_iterator_traits<std::wstring::iterator> : pointer_iterator_traits<wchar_t>{};
|
||||
template<>
|
||||
struct regex_iterator_traits<std::wstring::const_iterator> : const_pointer_iterator_traits<wchar_t>{};
|
||||
#endif // BOOST_NO_WSTRING
|
||||
#endif // stport
|
||||
|
||||
#else
|
||||
|
||||
template <class T>
|
||||
struct regex_iterator_traits : public std::iterator_traits<T> {};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
|
@ -89,12 +89,8 @@ typedef enum _match_flags
|
||||
|
||||
} match_flags;
|
||||
|
||||
#if defined(BOOST_BORLANDC) || (defined(_MSC_VER) && (_MSC_VER <= 1310))
|
||||
typedef unsigned long match_flag_type;
|
||||
#else
|
||||
typedef match_flags match_flag_type;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
inline match_flags operator&(match_flags m1, match_flags m2)
|
||||
{ return static_cast<match_flags>(static_cast<std::int32_t>(m1) & static_cast<std::int32_t>(m2)); }
|
||||
@ -111,7 +107,6 @@ inline match_flags& operator|=(match_flags& m1, match_flags m2)
|
||||
inline match_flags& operator^=(match_flags& m1, match_flags m2)
|
||||
{ m1 = m1^m2; return m1; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* namespace regex_constants */
|
||||
|
@ -52,43 +52,25 @@ template <class BidiIterator, class Allocator>
|
||||
class match_results
|
||||
{
|
||||
private:
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
typedef std::vector<sub_match<BidiIterator>, Allocator> vector_type;
|
||||
#else
|
||||
typedef std::vector<sub_match<BidiIterator> > vector_type;
|
||||
#endif
|
||||
public:
|
||||
typedef sub_match<BidiIterator> value_type;
|
||||
#ifndef BOOST_NO_CXX11_ALLOCATOR
|
||||
typedef typename std::allocator_traits<Allocator>::value_type const & const_reference;
|
||||
#elif !defined(BOOST_NO_STD_ALLOCATOR) && !(defined(BOOST_MSVC) && defined(_STLPORT_VERSION))
|
||||
typedef typename Allocator::const_reference const_reference;
|
||||
#else
|
||||
typedef const value_type& const_reference;
|
||||
#endif
|
||||
typedef const_reference reference;
|
||||
typedef typename vector_type::const_iterator const_iterator;
|
||||
typedef const_iterator iterator;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<
|
||||
typedef typename std::iterator_traits<
|
||||
BidiIterator>::difference_type difference_type;
|
||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
||||
typedef typename Allocator::size_type size_type;
|
||||
#else
|
||||
typedef typename std::allocator_traits<Allocator>::size_type size_type;
|
||||
#endif
|
||||
typedef Allocator allocator_type;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<
|
||||
typedef typename std::iterator_traits<
|
||||
BidiIterator>::value_type char_type;
|
||||
typedef std::basic_string<char_type> string_type;
|
||||
typedef BOOST_REGEX_DETAIL_NS::named_subexpressions named_sub_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit match_results(const Allocator& a = Allocator())
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
: m_subs(a), m_base(), m_null(), m_last_closed_paren(0), m_is_singular(true) {}
|
||||
#else
|
||||
: m_subs(), m_base(), m_null(), m_last_closed_paren(0), m_is_singular(true) { (void)a; }
|
||||
#endif
|
||||
//
|
||||
// IMPORTANT: in the code below, the crazy looking checks around m_is_singular are
|
||||
// all required because it is illegal to copy a singular iterator.
|
||||
@ -254,7 +236,7 @@ public:
|
||||
template <class charT>
|
||||
const_reference named_subexpression(const charT* i, const charT* j) const
|
||||
{
|
||||
BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
|
||||
static_assert(sizeof(charT) <= sizeof(char_type), "Failed internal logic");
|
||||
if(i == j)
|
||||
return m_null;
|
||||
std::vector<char_type> s;
|
||||
@ -282,7 +264,7 @@ public:
|
||||
template <class charT>
|
||||
int named_subexpression_index(const charT* i, const charT* j) const
|
||||
{
|
||||
BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
|
||||
static_assert(sizeof(charT) <= sizeof(char_type), "Failed internal logic");
|
||||
if(i == j)
|
||||
return -20;
|
||||
std::vector<char_type> s;
|
||||
@ -305,7 +287,7 @@ public:
|
||||
template <class charT>
|
||||
const_reference operator[](const charT* p) const
|
||||
{
|
||||
BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
|
||||
static_assert(sizeof(charT) <= sizeof(char_type), "Failed internal logic");
|
||||
if(*p == 0)
|
||||
return m_null;
|
||||
std::vector<char_type> s;
|
||||
@ -316,7 +298,7 @@ public:
|
||||
template <class charT, class Traits, class A>
|
||||
const_reference operator[](const std::basic_string<charT, Traits, A>& ns) const
|
||||
{
|
||||
BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
|
||||
static_assert(sizeof(charT) <= sizeof(char_type), "Failed internal logic");
|
||||
if(ns.empty())
|
||||
return m_null;
|
||||
std::vector<char_type> s;
|
||||
@ -413,11 +395,7 @@ public:
|
||||
|
||||
allocator_type get_allocator() const
|
||||
{
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
return m_subs.get_allocator();
|
||||
#else
|
||||
return allocator_type();
|
||||
#endif
|
||||
}
|
||||
void swap(match_results& that)
|
||||
{
|
||||
@ -678,7 +656,6 @@ void swap(match_results<BidiIterator, Allocator>& a, match_results<BidiIterator,
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
template <class charT, class traits, class BidiIterator, class Allocator>
|
||||
std::basic_ostream<charT, traits>&
|
||||
operator << (std::basic_ostream<charT, traits>& os,
|
||||
@ -686,14 +663,6 @@ std::basic_ostream<charT, traits>&
|
||||
{
|
||||
return (os << s.str());
|
||||
}
|
||||
#else
|
||||
template <class BidiIterator, class Allocator>
|
||||
std::ostream& operator << (std::ostream& os,
|
||||
const match_results<BidiIterator, Allocator>& s)
|
||||
{
|
||||
return (os << s.str());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
|
@ -80,14 +80,12 @@ inline bool can_start(unsigned short c, const unsigned char* map, unsigned char
|
||||
{
|
||||
return ((c >= (1 << CHAR_BIT)) ? true : map[c] & mask);
|
||||
}
|
||||
#if !defined(__hpux) && !defined(__WINSCW__)// WCHAR_MIN not usable in pp-directives.
|
||||
#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
||||
inline bool can_start(wchar_t c, const unsigned char* map, unsigned char mask)
|
||||
{
|
||||
return ((c >= static_cast<wchar_t>(1u << CHAR_BIT)) ? true : map[c] & mask);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
||||
inline bool can_start(unsigned int c, const unsigned char* map, unsigned char mask)
|
||||
{
|
||||
@ -95,16 +93,6 @@ inline bool can_start(unsigned int c, const unsigned char* map, unsigned char ma
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Unfortunately Rogue Waves standard library appears to have a bug
|
||||
// in std::basic_string::compare that results in erroneous answers
|
||||
// in some cases (tested with Borland C++ 5.1, Rogue Wave lib version
|
||||
// 0x020101) the test case was:
|
||||
// {39135,0} < {0xff,0}
|
||||
// which succeeds when it should not.
|
||||
//
|
||||
#ifndef _RWSTD_VER
|
||||
template <class C, class T, class A>
|
||||
inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
{
|
||||
@ -115,24 +103,6 @@ inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
}
|
||||
return s.compare(p);
|
||||
}
|
||||
#else
|
||||
template <class C, class T, class A>
|
||||
inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
{
|
||||
if(0 == *p)
|
||||
{
|
||||
if(s.empty() || ((s.size() == 1) && (s[0] == 0)))
|
||||
return 0;
|
||||
}
|
||||
return s.compare(p);
|
||||
}
|
||||
inline int string_compare(const std::string& s, const char* p)
|
||||
{ return std::strcmp(s.c_str(), p); }
|
||||
# ifndef BOOST_NO_WREGEX
|
||||
inline int string_compare(const std::wstring& s, const wchar_t* p)
|
||||
{ return std::wcscmp(s.c_str(), p); }
|
||||
#endif
|
||||
#endif
|
||||
template <class Seq, class C>
|
||||
inline int string_compare(const Seq& s, const C* p)
|
||||
{
|
||||
@ -388,7 +358,7 @@ public:
|
||||
typedef bool (self_type::*matcher_proc_type)();
|
||||
typedef std::size_t traits_size_type;
|
||||
typedef typename is_byte<char_type>::width_type width_type;
|
||||
typedef typename regex_iterator_traits<BidiIterator>::difference_type difference_type;
|
||||
typedef typename std::iterator_traits<BidiIterator>::difference_type difference_type;
|
||||
typedef match_results<BidiIterator, Allocator> results_type;
|
||||
|
||||
perl_matcher(BidiIterator first, BidiIterator end,
|
||||
|
@ -54,7 +54,7 @@ namespace BOOST_REGEX_DETAIL_NS{
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_regex<char_type, traits>& e, match_flag_type f)
|
||||
{
|
||||
typedef typename regex_iterator_traits<BidiIterator>::iterator_category category;
|
||||
typedef typename std::iterator_traits<BidiIterator>::iterator_category category;
|
||||
typedef typename basic_regex<char_type, traits>::flag_type expression_flag_type;
|
||||
|
||||
if(e.empty())
|
||||
@ -913,12 +913,12 @@ template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit()
|
||||
{
|
||||
#if 0
|
||||
if(position == last)
|
||||
if (position == last)
|
||||
return false; // can't possibly match if we're at the end already
|
||||
|
||||
unsigned type = (m_match_flags & match_continuous) ?
|
||||
static_cast<unsigned int>(regbase::restart_continue)
|
||||
: static_cast<unsigned int>(re.get_restart_type());
|
||||
: static_cast<unsigned int>(re.get_restart_type());
|
||||
|
||||
const kmp_info<char_type>* info = access::get_kmp(re);
|
||||
int len = info->len;
|
||||
@ -926,13 +926,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit()
|
||||
int j = 0;
|
||||
while (position != last)
|
||||
{
|
||||
while((j > -1) && (x[j] != traits_inst.translate(*position, icase)))
|
||||
while ((j > -1) && (x[j] != traits_inst.translate(*position, icase)))
|
||||
j = info->kmp_next[j];
|
||||
++position;
|
||||
++j;
|
||||
if(j >= len)
|
||||
if (j >= len)
|
||||
{
|
||||
if(type == regbase::restart_fixed_lit)
|
||||
if (type == regbase::restart_fixed_lit)
|
||||
{
|
||||
std::advance(position, -j);
|
||||
restart = position;
|
||||
@ -946,13 +946,14 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit()
|
||||
{
|
||||
restart = position;
|
||||
std::advance(position, -j);
|
||||
if(match_prefix())
|
||||
if (match_prefix())
|
||||
return true;
|
||||
else
|
||||
{
|
||||
for(int k = 0; (restart != position) && (k < j); ++k, --restart)
|
||||
{} // dwa 10/20/2000 - warning suppression for MWCW
|
||||
if(restart != last)
|
||||
for (int k = 0; (restart != position) && (k < j); ++k, --restart)
|
||||
{
|
||||
} // dwa 10/20/2000 - warning suppression for MWCW
|
||||
if (restart != last)
|
||||
++restart;
|
||||
position = restart;
|
||||
j = 0; //we could do better than this...
|
||||
@ -960,7 +961,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit()
|
||||
}
|
||||
}
|
||||
}
|
||||
if((m_match_flags & match_partial) && (position == last) && j)
|
||||
if ((m_match_flags & match_partial) && (position == last) && j)
|
||||
{
|
||||
// we need to check for a partial match:
|
||||
restart = position;
|
||||
|
@ -1868,63 +1868,6 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_then(bool b)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_pop(bool r)
|
||||
{
|
||||
saved_state* pmp = static_cast<saved_state*>(m_backup_state);
|
||||
if(!r)
|
||||
{
|
||||
--parenthesis_stack_position;
|
||||
}
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
void perl_matcher<BidiIterator, Allocator, traits>::push_parenthesis_pop()
|
||||
{
|
||||
saved_state* pmp = static_cast<saved_state*>(m_backup_state);
|
||||
--pmp;
|
||||
if(pmp < m_stack_base)
|
||||
{
|
||||
extend_stack();
|
||||
pmp = static_cast<saved_state*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
(void) new (pmp)saved_state(16);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_push(bool r)
|
||||
{
|
||||
saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
|
||||
if(!r)
|
||||
{
|
||||
parenthesis_stack[parenthesis_stack_position++] = pmp->position;
|
||||
}
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
inline void perl_matcher<BidiIterator, Allocator, traits>::push_parenthesis_push(BidiIterator p)
|
||||
{
|
||||
saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
if(pmp < m_stack_base)
|
||||
{
|
||||
extend_stack();
|
||||
pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
(void) new (pmp)saved_position<BidiIterator>(0, p, 17);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
*/
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
} // namespace boost
|
||||
|
||||
|
@ -25,65 +25,24 @@
|
||||
|
||||
// what follows is all C++ don't include in C builds!!
|
||||
|
||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_WORKAROUND_HPP
|
||||
#include <boost/regex/v5/regex_workaround.hpp>
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_REGEX_FWD_HPP
|
||||
#include <boost/regex_fwd.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_TRAITS_HPP
|
||||
#include <boost/regex/regex_traits.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_RAW_BUFFER_HPP
|
||||
#include <boost/regex/v5/error_type.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_MATCH_FLAGS
|
||||
#include <boost/regex/v5/match_flags.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_RAW_BUFFER_HPP
|
||||
#include <boost/regex/v5/regex_raw_buffer.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_RE_PAT_EXCEPT_HPP
|
||||
#include <boost/regex/pattern_except.hpp>
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_REGEX_V5_CHAR_REGEX_TRAITS_HPP
|
||||
#include <boost/regex/v5/char_regex_traits.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_STATES_HPP
|
||||
#include <boost/regex/v5/states.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_REGBASE_HPP
|
||||
#include <boost/regex/v5/regbase.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_ITERATOR_TRAITS_HPP
|
||||
#include <boost/regex/v5/iterator_traits.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_BASIC_REGEX_HPP
|
||||
#include <boost/regex/v5/basic_regex.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_BASIC_REGEX_CREATOR_HPP
|
||||
#include <boost/regex/v5/basic_regex_creator.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_BASIC_REGEX_PARSER_HPP
|
||||
#include <boost/regex/v5/basic_regex_parser.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_SUB_MATCH_HPP
|
||||
#include <boost/regex/v5/sub_match.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_FORMAT_HPP
|
||||
#include <boost/regex/v5/regex_format.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_MATCH_RESULTS_HPP
|
||||
#include <boost/regex/v5/match_results.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_MATCHER_HPP
|
||||
#include <boost/regex/v5/perl_matcher.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
#ifdef BOOST_REGEX_NO_FWD
|
||||
@ -101,30 +60,15 @@ typedef match_results<std::wstring::const_iterator> wsmatch;
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
#ifndef BOOST_REGEX_MATCH_HPP
|
||||
|
||||
#include <boost/regex/v5/regex_match.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_REGEX_SEARCH_HPP
|
||||
#include <boost/regex/v5/regex_search.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_ITERATOR_HPP
|
||||
#include <boost/regex/v5/regex_iterator.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_TOKEN_ITERATOR_HPP
|
||||
#include <boost/regex/v5/regex_token_iterator.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_REGEX_GREP_HPP
|
||||
#include <boost/regex/v5/regex_grep.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_REGEX_REPLACE_HPP
|
||||
#include <boost/regex/v5/regex_replace.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_V5_REGEX_MERGE_HPP
|
||||
#include <boost/regex/v5/regex_merge.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_SPLIT_HPP
|
||||
#include <boost/regex/v5/regex_split.hpp>
|
||||
#endif
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace boost{
|
||||
//
|
||||
// Forward declaration:
|
||||
//
|
||||
template <class BidiIterator, class Allocator = BOOST_DEDUCED_TYPENAME std::vector<sub_match<BidiIterator> >::allocator_type >
|
||||
template <class BidiIterator, class Allocator = typename std::vector<sub_match<BidiIterator> >::allocator_type >
|
||||
class match_results;
|
||||
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
@ -932,7 +932,7 @@ private:
|
||||
//
|
||||
// F must be a pointer, a function, or a class with a function call operator:
|
||||
//
|
||||
BOOST_STATIC_ASSERT((::std::is_pointer<F>::value || ::std::is_function<F>::value || ::std::is_class<F>::value));
|
||||
static_assert((::std::is_pointer<F>::value || ::std::is_function<F>::value || ::std::is_class<F>::value), "The functor must be a pointer or a class with a function call operator");
|
||||
static formatter_wrapper<typename do_unwrap_reference<F>::type> f;
|
||||
static M m;
|
||||
static O out;
|
||||
@ -967,7 +967,7 @@ public:
|
||||
// This static assertion will fail if the functor passed does not accept
|
||||
// the same type of arguments passed.
|
||||
//
|
||||
BOOST_STATIC_ASSERT( std::is_class<F>::value && !has_const_iterator<F>::value ? (type::value > 1) : true);
|
||||
static_assert( std::is_class<F>::value && !has_const_iterator<F>::value ? (type::value > 1) : true, "Argument mismatch in Functor type");
|
||||
};
|
||||
|
||||
template <class Base, class Match>
|
||||
|
@ -86,11 +86,7 @@ inline unsigned int regex_grep(Predicate foo,
|
||||
|
||||
//
|
||||
// regex_grep convenience interfaces:
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
//
|
||||
// this isn't really a partial specialisation, but template function
|
||||
// overloading - if the compiler doesn't support partial specialisation
|
||||
// then it really won't support this either:
|
||||
template <class Predicate, class charT, class traits>
|
||||
inline unsigned int regex_grep(Predicate foo, const charT* str,
|
||||
const basic_regex<charT, traits>& e,
|
||||
@ -106,37 +102,6 @@ inline unsigned int regex_grep(Predicate foo, const std::basic_string<charT, ST,
|
||||
{
|
||||
return regex_grep(foo, s.begin(), s.end(), e, flags);
|
||||
}
|
||||
#else // partial specialisation
|
||||
inline unsigned int regex_grep(bool (*foo)(const cmatch&), const char* str,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, str, str + regex::traits_type::length(str), e, flags);
|
||||
}
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
inline unsigned int regex_grep(bool (*foo)(const wcmatch&), const wchar_t* str,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, str, str + wregex::traits_type::length(str), e, flags);
|
||||
}
|
||||
#endif
|
||||
inline unsigned int regex_grep(bool (*foo)(const match_results<std::string::const_iterator>&), const std::string& s,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, s.begin(), s.end(), e, flags);
|
||||
}
|
||||
#if !defined(BOOST_NO_WREGEX)
|
||||
inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string<wchar_t>::const_iterator>&),
|
||||
const std::basic_string<wchar_t>& s,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_grep(foo, s.begin(), s.end(), e, flags);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
|
@ -84,7 +84,7 @@ private:
|
||||
};
|
||||
|
||||
template <class BidirectionalIterator,
|
||||
class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::value_type,
|
||||
class charT = typename std::iterator_traits<BidirectionalIterator>::value_type,
|
||||
class traits = regex_traits<charT> >
|
||||
class regex_iterator
|
||||
{
|
||||
@ -94,7 +94,7 @@ private:
|
||||
public:
|
||||
typedef basic_regex<charT, traits> regex_type;
|
||||
typedef match_results<BidirectionalIterator> value_type;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename std::iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
|
@ -59,11 +59,7 @@ bool regex_match(iterator first, iterator last,
|
||||
}
|
||||
//
|
||||
// query_match convenience interfaces:
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
//
|
||||
// this isn't really a partial specialisation, but template function
|
||||
// overloading - if the compiler doesn't support partial specialisation
|
||||
// then it really won't support this either:
|
||||
template <class charT, class Allocator, class traits>
|
||||
inline bool regex_match(const charT* str,
|
||||
match_results<const charT*, Allocator>& m,
|
||||
@ -99,253 +95,6 @@ inline bool regex_match(const std::basic_string<charT, ST, SA>& s,
|
||||
match_results<iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#else // partial ordering
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#if !defined(BOOST_NO_WREGEX)
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
@ -58,11 +58,7 @@ bool regex_search(BidiIterator first, BidiIterator last,
|
||||
|
||||
//
|
||||
// regex_search convenience interfaces:
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
//
|
||||
// this isn't really a partial specialisation, but template function
|
||||
// overloading - if the compiler doesn't support partial specialisation
|
||||
// then it really won't support this either:
|
||||
template <class charT, class Allocator, class traits>
|
||||
inline bool regex_search(const charT* str,
|
||||
match_results<const charT*, Allocator>& m,
|
||||
@ -80,56 +76,6 @@ inline bool regex_search(const std::basic_string<charT, ST, SA>& s,
|
||||
{
|
||||
return regex_search(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
#else // partial overloads:
|
||||
inline bool regex_search(const char* str,
|
||||
cmatch& m,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_search(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_search(const char* first, const char* last,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
cmatch m;
|
||||
return regex_search(first, last, m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
inline bool regex_search(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_search(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_search(const wchar_t* first, const wchar_t* last,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
wcmatch m;
|
||||
return regex_search(first, last, m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_search(const std::string& s,
|
||||
smatch& m,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_search(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
#if !defined(BOOST_NO_WREGEX)
|
||||
inline bool regex_search(const std::basic_string<wchar_t>& s,
|
||||
wsmatch& m,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_search(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
template <class BidiIterator, class charT, class traits>
|
||||
bool regex_search(BidiIterator first, BidiIterator last,
|
||||
@ -145,8 +91,6 @@ bool regex_search(BidiIterator first, BidiIterator last,
|
||||
return matcher.find();
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
template <class charT, class traits>
|
||||
inline bool regex_search(const charT* str,
|
||||
const basic_regex<charT, traits>& e,
|
||||
@ -162,42 +106,6 @@ inline bool regex_search(const std::basic_string<charT, ST, SA>& s,
|
||||
{
|
||||
return regex_search(s.begin(), s.end(), e, flags);
|
||||
}
|
||||
#else // non-template function overloads
|
||||
inline bool regex_search(const char* str,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
cmatch m;
|
||||
return regex_search(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
inline bool regex_search(const wchar_t* str,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
wcmatch m;
|
||||
return regex_search(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_search(const std::string& s,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
smatch m;
|
||||
return regex_search(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if !defined(BOOST_NO_WREGEX)
|
||||
inline bool regex_search(const std::basic_string<wchar_t>& s,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
wsmatch m;
|
||||
return regex_search(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_WREGEX
|
||||
|
||||
#endif // partial overload
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
|
@ -58,23 +58,6 @@ public:
|
||||
: end(last), re(*p), flags(f), N(0){ subs.push_back(sub); }
|
||||
regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector<int>& v, match_flag_type f)
|
||||
: end(last), re(*p), flags(f), N(0), subs(v){}
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|
||||
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
template <class T>
|
||||
regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const T& submatches, match_flag_type f)
|
||||
: end(last), re(*p), flags(f), N(0)
|
||||
{
|
||||
// assert that T really is an array:
|
||||
BOOST_STATIC_ASSERT(::boost::is_array<T>::value);
|
||||
const std::size_t array_size = sizeof(T) / sizeof(submatches[0]);
|
||||
for(std::size_t i = 0; i < array_size; ++i)
|
||||
{
|
||||
subs.push_back(submatches[i]);
|
||||
}
|
||||
}
|
||||
#else
|
||||
template <std::size_t CN>
|
||||
regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const int (&submatches)[CN], match_flag_type f)
|
||||
: end(last), re(*p), flags(f), N(0)
|
||||
@ -84,8 +67,6 @@ public:
|
||||
subs.push_back(submatches[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
bool init(BidirectionalIterator first)
|
||||
{
|
||||
N = 0;
|
||||
@ -152,7 +133,7 @@ private:
|
||||
};
|
||||
|
||||
template <class BidirectionalIterator,
|
||||
class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::value_type,
|
||||
class charT = typename std::iterator_traits<BidirectionalIterator>::value_type,
|
||||
class traits = regex_traits<charT> >
|
||||
class regex_token_iterator
|
||||
{
|
||||
@ -162,7 +143,7 @@ private:
|
||||
public:
|
||||
typedef basic_regex<charT, traits> regex_type;
|
||||
typedef sub_match<BidirectionalIterator> value_type;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename std::iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
@ -183,19 +164,6 @@ public:
|
||||
if(!pdata->init(a))
|
||||
pdata.reset();
|
||||
}
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|
||||
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
template <class T>
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const T& submatches, match_flag_type m = match_default)
|
||||
: pdata(new impl(&re, b, submatches, m))
|
||||
{
|
||||
if(!pdata->init(a))
|
||||
pdata.reset();
|
||||
}
|
||||
#else
|
||||
template <std::size_t N>
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const int (&submatches)[N], match_flag_type m = match_default)
|
||||
@ -204,8 +172,6 @@ public:
|
||||
if(!pdata->init(a))
|
||||
pdata.reset();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
regex_token_iterator(const regex_token_iterator& that)
|
||||
: pdata(that.pdata) {}
|
||||
regex_token_iterator& operator=(const regex_token_iterator& that)
|
||||
|
@ -19,39 +19,17 @@
|
||||
#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
|
||||
#define BOOST_REGEX_TRAITS_HPP_INCLUDED
|
||||
|
||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_WORKAROUND_HPP
|
||||
#include <boost/regex/v5/regex_workaround.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
|
||||
#include <boost/regex/v5/syntax_type.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_ERROR_TYPE_HPP
|
||||
#include <boost/regex/v5/error_type.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED
|
||||
#include <boost/regex/v5/regex_traits_defaults.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
# ifndef BOOST_CPP_REGEX_TRAITS_HPP_INCLUDED
|
||||
# include <boost/regex/v5/cpp_regex_traits.hpp>
|
||||
# endif
|
||||
#endif
|
||||
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
|
||||
# ifndef BOOST_C_REGEX_TRAITS_HPP_INCLUDED
|
||||
# include <boost/regex/v5/c_regex_traits.hpp>
|
||||
# endif
|
||||
#endif
|
||||
#include <boost/regex/v5/cpp_regex_traits.hpp>
|
||||
#include <boost/regex/v5/c_regex_traits.hpp>
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
# ifndef BOOST_W32_REGEX_TRAITS_HPP_INCLUDED
|
||||
# include <boost/regex/v5/w32_regex_traits.hpp>
|
||||
# endif
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_FWD_HPP_INCLUDED
|
||||
#include <boost/regex_fwd.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
@ -136,26 +114,11 @@ struct compute_wrapper_base
|
||||
{
|
||||
typedef BaseT type;
|
||||
};
|
||||
#if !BOOST_WORKAROUND(__HP_aCC, < 60000)
|
||||
template <class BaseT>
|
||||
struct compute_wrapper_base<BaseT, false>
|
||||
{
|
||||
typedef default_wrapper<BaseT> type;
|
||||
};
|
||||
#else
|
||||
template <>
|
||||
struct compute_wrapper_base<c_regex_traits<char>, false>
|
||||
{
|
||||
typedef default_wrapper<c_regex_traits<char> > type;
|
||||
};
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
template <>
|
||||
struct compute_wrapper_base<c_regex_traits<wchar_t>, false>
|
||||
{
|
||||
typedef default_wrapper<c_regex_traits<wchar_t> > type;
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace BOOST_REGEX_DETAIL_NS
|
||||
|
||||
|
@ -32,14 +32,9 @@
|
||||
|
||||
#include <boost/regex/config.hpp>
|
||||
|
||||
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
|
||||
#include <boost/regex/v5/syntax_type.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_ERROR_TYPE_HPP
|
||||
#include <boost/regex/v5/error_type.hpp>
|
||||
#endif
|
||||
#include <boost/regex/v5/regex_workaround.hpp>
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <type_traits>
|
||||
#include <cstdint>
|
||||
#include <cctype>
|
||||
@ -59,7 +54,7 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
|
||||
template <class charT>
|
||||
inline bool is_extended(charT c)
|
||||
{
|
||||
typedef typename make_unsigned<charT>::type unsigned_type;
|
||||
typedef typename std::make_unsigned<charT>::type unsigned_type;
|
||||
return (sizeof(charT) > 1) && (static_cast<unsigned_type>(c) >= 256u);
|
||||
}
|
||||
inline bool is_extended(char)
|
||||
@ -628,7 +623,6 @@ inline bool is_combining<unsigned char>(unsigned char)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#if !defined(__hpux) && !defined(__WINSCW__) // can't use WCHAR_MAX/MIN in pp-directives
|
||||
#ifdef _MSC_VER
|
||||
template<>
|
||||
inline bool is_combining<wchar_t>(wchar_t c)
|
||||
@ -650,7 +644,6 @@ inline bool is_combining<wchar_t>(wchar_t c)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// is a charT c a line separator?
|
||||
|
@ -35,12 +35,8 @@ namespace boost{
|
||||
template <class BidiIterator>
|
||||
struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
{
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidiIterator>::value_type value_type;
|
||||
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
#else
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidiIterator>::difference_type difference_type;
|
||||
#endif
|
||||
typedef typename std::iterator_traits<BidiIterator>::value_type value_type;
|
||||
typedef typename std::iterator_traits<BidiIterator>::difference_type difference_type;
|
||||
typedef BidiIterator iterator_type;
|
||||
typedef BidiIterator iterator;
|
||||
typedef BidiIterator const_iterator;
|
||||
@ -49,20 +45,11 @@ 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_BORLANDC, <= 0x0551)\
|
||||
&& !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
|
||||
template <class T, class A>
|
||||
operator std::basic_string<value_type, T, A> ()const
|
||||
{
|
||||
return matched ? std::basic_string<value_type, T, A>(this->first, this->second) : std::basic_string<value_type, T, A>();
|
||||
}
|
||||
#else
|
||||
operator std::basic_string<value_type> ()const
|
||||
{
|
||||
return str();
|
||||
}
|
||||
#endif
|
||||
difference_type BOOST_REGEX_CALL length()const
|
||||
{
|
||||
difference_type n = matched ? std::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0;
|
||||
@ -167,23 +154,6 @@ public:
|
||||
//
|
||||
BidiIterator begin()const { return this->first; }
|
||||
BidiIterator end()const { return this->second; }
|
||||
|
||||
|
||||
#ifdef BOOST_OLD_REGEX_H
|
||||
//
|
||||
// the following are deprecated, do not use!!
|
||||
//
|
||||
operator int()const;
|
||||
operator unsigned int()const;
|
||||
operator short()const
|
||||
{
|
||||
return (short)(int)(*this);
|
||||
}
|
||||
operator unsigned short()const
|
||||
{
|
||||
return (unsigned short)(unsigned int)(*this);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef sub_match<const char*> csub_match;
|
||||
@ -195,239 +165,220 @@ typedef sub_match<std::wstring::const_iterator> wssub_match;
|
||||
|
||||
// comparison to std::basic_string<> part 1:
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator == (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator == (const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) == 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator != (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator != (const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) != 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator < (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator < (const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) < 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator <= (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator <= (const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) <= 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator >= (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator >= (const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) >= 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator > (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline bool operator > (const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return s.compare(m.str()) > 0; }
|
||||
// comparison to std::basic_string<> part 2:
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator == (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) == 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator != (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) != 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator < (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) < 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator > (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) > 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) <= 0; }
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{ return m.str().compare(s) >= 0; }
|
||||
// comparison to const charT* part 1:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const* s)
|
||||
{ return m.str().compare(s) <= 0; }
|
||||
// comparison to const charT* part 2:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator == (typename std::iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator != (typename std::iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator < (typename std::iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator > (typename std::iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator <= (typename std::iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline bool operator >= (typename std::iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(s) <= 0; }
|
||||
|
||||
// comparison to const charT& part 1:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
|
||||
// comparison to const charT* part 2:
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator == (typename std::iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) == 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator != (typename std::iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) != 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator < (typename std::iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) > 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator > (typename std::iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) < 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator <= (typename std::iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
|
||||
template <class RandomAccessIterator>
|
||||
inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
inline bool operator >= (typename std::iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
|
||||
|
||||
// addition operators:
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
inline std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
result.reserve(s.size() + m.length() + 1);
|
||||
return result.append(s).append(m.first, m.second);
|
||||
}
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
inline std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
const std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
|
||||
{
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
|
||||
result.reserve(s.size() + m.length() + 1);
|
||||
return result.append(m.first, m.second).append(s);
|
||||
}
|
||||
#if !(defined(__GNUC__) && defined(BOOST_NO_STD_LOCALE))
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename std::iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
return result.append(s).append(m.first, m.second);
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
inline std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
{
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(std::char_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
return result.append(m.first, m.second).append(s);
|
||||
}
|
||||
#else
|
||||
// worwaround versions:
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
inline std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename std::iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
return s + m.str();
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
{
|
||||
return m.str() + s;
|
||||
}
|
||||
#endif
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(m.length() + 2);
|
||||
return result.append(1, s).append(m.first, m.second);
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
inline std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type const& s)
|
||||
{
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(m.length() + 2);
|
||||
return result.append(m.first, m.second).append(1, s);
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
inline std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m1,
|
||||
const sub_match<RandomAccessIterator>& m2)
|
||||
{
|
||||
std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
std::basic_string<typename std::iterator_traits<RandomAccessIterator>::value_type> result;
|
||||
result.reserve(m1.length() + m2.length() + 1);
|
||||
return result.append(m1.first, m1.second).append(m2.first, m2.second);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
template <class charT, class traits, class RandomAccessIterator>
|
||||
std::basic_ostream<charT, traits>&
|
||||
operator << (std::basic_ostream<charT, traits>& os,
|
||||
@ -435,69 +386,6 @@ std::basic_ostream<charT, traits>&
|
||||
{
|
||||
return (os << s.str());
|
||||
}
|
||||
#else
|
||||
template <class RandomAccessIterator>
|
||||
std::ostream& operator << (std::ostream& os,
|
||||
const sub_match<RandomAccessIterator>& s)
|
||||
{
|
||||
return (os << s.str());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_OLD_REGEX_H
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template <class BidiIterator, class charT>
|
||||
int do_toi(BidiIterator i, BidiIterator j, char c, int radix)
|
||||
{
|
||||
std::string s(i, j);
|
||||
char* p;
|
||||
int result = std::strtol(s.c_str(), &p, radix);
|
||||
if(*p)raise_regex_exception("Bad sub-expression");
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// helper:
|
||||
template <class I, class charT>
|
||||
int do_toi(I& i, I j, charT c)
|
||||
{
|
||||
int result = 0;
|
||||
while((i != j) && (isdigit(*i)))
|
||||
{
|
||||
result = result*10 + (*i - '0');
|
||||
++i;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <class BidiIterator>
|
||||
sub_match<BidiIterator>::operator int()const
|
||||
{
|
||||
BidiIterator i = first;
|
||||
BidiIterator j = second;
|
||||
if(i == j)raise_regex_exception("Bad sub-expression");
|
||||
int neg = 1;
|
||||
if((i != j) && (*i == '-'))
|
||||
{
|
||||
neg = -1;
|
||||
++i;
|
||||
}
|
||||
neg *= BOOST_REGEX_DETAIL_NS::do_toi(i, j, *i);
|
||||
if(i != j)raise_regex_exception("Bad sub-expression");
|
||||
return neg;
|
||||
}
|
||||
template <class BidiIterator>
|
||||
sub_match<BidiIterator>::operator unsigned int()const
|
||||
{
|
||||
BidiIterator i = first;
|
||||
BidiIterator j = second;
|
||||
if(i == j)
|
||||
raise_regex_exception("Bad sub-expression");
|
||||
return BOOST_REGEX_DETAIL_NS::do_toi(i, j, *first);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
@ -79,7 +79,7 @@ private:
|
||||
public:
|
||||
typedef u32regex regex_type;
|
||||
typedef match_results<BidirectionalIterator> value_type;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename std::iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
|
@ -49,22 +49,6 @@ 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(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|
||||
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
|
||||
template <class T>
|
||||
u32regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const T& submatches, match_flag_type f)
|
||||
: end(last), re(*p), flags(f)
|
||||
{
|
||||
// assert that T really is an array:
|
||||
BOOST_STATIC_ASSERT(::boost::is_array<T>::value);
|
||||
const std::size_t array_size = sizeof(T) / sizeof(submatches[0]);
|
||||
for(std::size_t i = 0; i < array_size; ++i)
|
||||
{
|
||||
subs.push_back(submatches[i]);
|
||||
}
|
||||
}
|
||||
#else
|
||||
template <std::size_t CN>
|
||||
u32regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const int (&submatches)[CN], match_flag_type f)
|
||||
: end(last), re(*p), flags(f)
|
||||
@ -74,7 +58,6 @@ public:
|
||||
subs.push_back(submatches[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool init(BidirectionalIterator first)
|
||||
{
|
||||
@ -150,7 +133,7 @@ private:
|
||||
public:
|
||||
typedef u32regex regex_type;
|
||||
typedef sub_match<BidirectionalIterator> value_type;
|
||||
typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
|
||||
typedef typename std::iterator_traits<BidirectionalIterator>::difference_type
|
||||
difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
@ -171,18 +154,6 @@ public:
|
||||
if(!pdata->init(a))
|
||||
pdata.reset();
|
||||
}
|
||||
#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>
|
||||
u32regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const T& submatches, match_flag_type m = match_default)
|
||||
: pdata(new impl(&re, b, submatches, m))
|
||||
{
|
||||
if(!pdata->init(a))
|
||||
pdata.reset();
|
||||
}
|
||||
#else
|
||||
template <std::size_t N>
|
||||
u32regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const int (&submatches)[N], match_flag_type m = match_default)
|
||||
@ -191,7 +162,6 @@ public:
|
||||
if(!pdata->init(a))
|
||||
pdata.reset();
|
||||
}
|
||||
#endif
|
||||
u32regex_token_iterator(const u32regex_token_iterator& that)
|
||||
: pdata(that.pdata) {}
|
||||
u32regex_token_iterator& operator=(const u32regex_token_iterator& that)
|
||||
|
@ -21,21 +21,13 @@
|
||||
|
||||
#ifndef BOOST_REGEX_NO_WIN32_LOCALE
|
||||
|
||||
#ifndef BOOST_RE_PAT_EXCEPT_HPP
|
||||
#include <boost/regex/pattern_except.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED
|
||||
#include <boost/regex/v5/regex_traits_defaults.hpp>
|
||||
#endif
|
||||
#ifdef BOOST_HAS_THREADS
|
||||
#include <mutex>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_PRIMARY_TRANSFORM
|
||||
#include <boost/regex/v5/primary_transform.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_OBJECT_CACHE_HPP
|
||||
#include <boost/regex/v5/object_cache.hpp>
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@ -391,32 +383,10 @@ typename w32_regex_traits_implementation<charT>::string_type
|
||||
if(pos != m_custom_collate_names.end())
|
||||
return pos->second;
|
||||
}
|
||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
|
||||
std::string name(p1, p2);
|
||||
#else
|
||||
std::string name;
|
||||
const charT* p0 = p1;
|
||||
while(p0 != p2)
|
||||
name.append(1, char(*p0++));
|
||||
#endif
|
||||
name = lookup_default_collate_name(name);
|
||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
|
||||
if(name.size())
|
||||
return string_type(name.begin(), name.end());
|
||||
#else
|
||||
if(name.size())
|
||||
{
|
||||
string_type result;
|
||||
typedef std::string::const_iterator iter;
|
||||
iter b = name.begin();
|
||||
iter e = name.end();
|
||||
while(b != e)
|
||||
result.append(1, charT(*b++));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
if(p2 - p1 == 1)
|
||||
return string_type(1, *p1);
|
||||
return string_type();
|
||||
|
Reference in New Issue
Block a user