Update of /cvsroot/boost/boost/boost/xpressive/detail/core
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18713/detail/core
Modified Files:
optimize.hpp peeker.hpp sub_match_vector.hpp
Log Message:
more work in support of non-char data
Index: optimize.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/core/optimize.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- optimize.hpp 17 Apr 2006 19:36:52 -0000 1.2
+++ optimize.hpp 30 May 2007 07:58:22 -0000 1.3
@@ -64,19 +64,13 @@
typedef typename iterator_value<BidiIter>::type char_type;
// if we have a leading string literal, initialize a boyer-moore struct
with it
- std::pair<std::basic_string<char_type> const *, bool> str =
peeker.get_string();
- if(0 != str.first)
+ peeker_string<char_type> const &str = peeker.get_string();
+ if(str.begin_ != str.end_)
{
BOOST_ASSERT(1 == peeker.bitset().count());
return intrusive_ptr<finder<BidiIter> >
(
- new boyer_moore_finder<BidiIter, Traits>
- (
- str.first->data()
- , str.first->data() + str.first->size()
- , traits
- , str.second
- )
+ new boyer_moore_finder<BidiIter, Traits>(str.begin_, str.end_,
traits, str.icase_)
);
}
Index: peeker.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/core/peeker.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- peeker.hpp 21 Dec 2006 03:51:41 -0000 1.6
+++ peeker.hpp 30 May 2007 07:58:22 -0000 1.7
@@ -25,6 +25,7 @@
#include <boost/xpressive/detail/core/matchers.hpp>
#include <boost/xpressive/detail/utility/hash_peek_bitset.hpp>
#include <boost/xpressive/detail/utility/never_true.hpp>
+#include <boost/xpressive/detail/utility/algorithm.hpp>
namespace boost { namespace xpressive { namespace detail
{
@@ -54,13 +55,23 @@
// xpression_peeker
//
template<typename Char>
+struct peeker_string
+{
+ Char const *begin_;
+ Char const *end_;
+ bool icase_;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// xpression_peeker
+//
+template<typename Char>
struct xpression_peeker
{
template<typename Traits>
xpression_peeker(hash_peek_bitset<Char> &bset, Traits const &traits)
: bset_(bset)
- , str_(0)
- , str_icase_(false)
+ , str_()
, line_start_(false)
, traits_(0)
, traits_type_(0)
@@ -70,9 +81,9 @@
///////////////////////////////////////////////////////////////////////////////
// accessors
- std::pair<std::basic_string<Char> const *, bool> get_string() const
+ peeker_string<Char> const &get_string() const
{
- return std::make_pair(this->str_, this->str_icase_);
+ return this->str_;
}
bool line_start() const
@@ -120,8 +131,9 @@
mpl::false_ accept(string_matcher<Traits, ICase> const &xpr)
{
this->bset_.set_char(xpr.str_[0], ICase, this->get_traits_<Traits>());
- this->str_ = &xpr.str_;
- this->str_icase_ = ICase;
+ this->str_.begin_ = detail::data_begin(xpr.str_);
+ this->str_.end_ = detail::data_end(xpr.str_);
+ this->str_.icase_ = ICase;
return mpl::false_();
}
@@ -218,7 +230,7 @@
}
hash_peek_bitset<Char> &bset_;
- std::basic_string<Char> const *str_;
+ peeker_string<Char> str_;
bool str_icase_;
bool line_start_;
void const *traits_;
Index: sub_match_vector.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/xpressive/detail/core/sub_match_vector.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sub_match_vector.hpp 26 Nov 2005 17:12:25 -0000 1.2
+++ sub_match_vector.hpp 30 May 2007 07:58:22 -0000 1.3
@@ -70,7 +70,7 @@
typedef const_reference reference;
typedef typename iterator_difference<BidiIter>::type difference_type;
typedef typename iterator_value<BidiIter>::type char_type;
- typedef std::basic_string<char_type> string_type;
+ typedef typename sub_match<BidiIter>::string_type string_type;
#if BOOST_ITERATOR_ADAPTORS_VERSION >= 0x0200
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs