First cut at new v5 regex version, doesn't really work yet, but all the infrastructure is in place...

[SVN r22489]
This commit is contained in:
John Maddock committed 2004-03-12 13:22:44 +00:00
1 parent 99d5760d2b
commit 4d2d3a1450
65 files changed
+5155 -7075

No files matched your search

+14 -14
View File
@@ -30,14 +30,14 @@ namespace boost{
namespace re_detail{
template <class charT>
const reg_expression<charT>& get_default_expression(charT)
const basic_regex<charT>& get_default_expression(charT)
{
static const charT expression_text[4] = { '\\', 's', '+', '\00', };
static const reg_expression<charT> e(expression_text);
static const basic_regex<charT> e(expression_text);
return e;
}
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Alloc2>
template <class OutputIterator, class charT, class Traits1, class Alloc1>
class split_pred
{
typedef std::basic_string<charT, Traits1, Alloc1> string_type;
@@ -50,12 +50,12 @@ public:
split_pred(iterator_type* a, OutputIterator* b, std::size_t* c)
: p_last(a), p_out(b), p_max(c), initial_max(*c) {}
bool operator()(const match_results<iterator_type, Alloc2>& what);
bool operator()(const match_results<iterator_type>& what);
};
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Alloc2>
bool split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2>::operator()
(const match_results<iterator_type, Alloc2>& what)
template <class OutputIterator, class charT, class Traits1, class Alloc1>
bool split_pred<OutputIterator, charT, Traits1, Alloc1>::operator()
(const match_results<iterator_type>& what)
{
*p_last = what[0].second;
if(what.size() > 1)
@@ -87,18 +87,18 @@ bool split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2>::operator()
} // namespace re_detail
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2>
std::size_t regex_split(OutputIterator out,
std::basic_string<charT, Traits1, Alloc1>& s,
const reg_expression<charT, Traits2, Alloc2>& e,
const basic_regex<charT, Traits2>& e,
match_flag_type flags,
std::size_t max_split)
{
typedef typename std::basic_string<charT, Traits1, Alloc1>::const_iterator ci_t;
typedef typename detail::rebind_allocator<sub_match<ci_t>, Alloc2>::type match_allocator;
typedef typename std::basic_string<charT, Traits1, Alloc1>::const_iterator ci_t;
typedef typename match_results<ci_t>::allocator_type match_allocator;
ci_t last = s.begin();
std::size_t init_size = max_split;
re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1, match_allocator> pred(&last, &out, &max_split);
re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1> pred(&last, &out, &max_split);
ci_t i, j;
i = s.begin();
j = s.end();
@@ -122,10 +122,10 @@ std::size_t regex_split(OutputIterator out,
return init_size - max_split;
}
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2>
inline std::size_t regex_split(OutputIterator out,
std::basic_string<charT, Traits1, Alloc1>& s,
const reg_expression<charT, Traits2, Alloc2>& e,
const basic_regex<charT, Traits2>& e,
match_flag_type flags = match_default)
{
return regex_split(out, s, e, flags, UINT_MAX);