|
Boost Users : |
Subject: [Boost-users] [Regex] regex_search
From: Etienne Philip Pretorius (icewolfhunter_at_[hidden])
Date: 2009-07-16 14:26:37
Hello List,
I am having an issue compiling the my code - I get the following error:
xml.hpp:43: error: no matching function for call to
regex_search(boost::asio::buffers_iterator<boost::asio::const_buffers_1,
char>&, boost::asio::buffers_iterator<boost::asio::const_buffers_1,
char>&,
boost::match_results<boost::asio::buffers_iterator<boost::asio::const_buffers_1,
char>,
std::allocator<boost::sub_match<boost::asio::buffers_iterator<boost::asio::const_buffers_1,
char> > > >&, boost::_bi::bind_t<boost::regex&,
boost::_mfi::mf0<boost::regex&, xmpp::xml::parser>,
boost::_bi::list1<boost::_bi::value<const xmpp::xml::parser*> > >,
boost::regex_constants::match_flags)
Here is the related code snippet:
template <typename iterator>
std::pair<iterator, bool> operator()(
iterator begin,
iterator end
) const {
if(begin == end) {
return std::make_pair(end,false);
}
boost::match_results<iterator> match_results;
//Compiler Error Start
if(boost::regex_search(
begin,
end,
match_results,
boost::bind(
&parser::regex,
this
),
boost::match_default | boost::match_partial)) {
//Compiler Error End
if(match_results[0].matched) {
//test
return std::make_pair(match_results[0].second,true);
}else{
//test
return std::make_pair(match_results[0].first,false);
}
}
return std::make_pair(end,false);
};
private:
boost::regex regex(
){
return XMLDecl_;
};
static boost::regex S_, Eq_, EncName_, VersionInfo_,
EncodingDecl_, SDDecl_, XMLDecl_,
UTF8_, Char_, NameStartChar_,
NameChar_, Name_, Names_, Comment_,
PITarget_, PI_, Misc_, prolog_;
Could someone please shed some light on this problem for me. I want to
be able to change the regular expression based on a state variable so
that operator() can advance to the next xml type that it should/could
encounter.
Thank you.
Etienne
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net