]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/performance/boost.cpp
1 ///////////////////////////////////////////////////////////////
2 // Copyright 2015 John Maddock. Distributed under the Boost
3 // Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
7 #include "performance.hpp"
8 #include <boost/regex.hpp>
9 #include <boost/version.hpp>
10 #include <boost/lexical_cast.hpp>
12 struct boost_regex
: public abstract_regex
18 virtual bool set_expression(const char* pe
, bool isperl
)
20 e
.assign(pe
, isperl
? boost::regex::perl
: boost::regex::extended
);
21 return e
.status() == 0;
23 virtual bool match_test(const char* text
);
24 virtual unsigned find_all(const char* text
);
25 virtual std::string
name();
31 boost_regex::register_instance(boost::shared_ptr
<abstract_regex
>(new boost_regex
));
33 void do_nothing()const {}
35 static const initializer init
;
38 const boost_regex::initializer
boost_regex::init
;
41 bool boost_regex::match_test(const char * text
)
43 return regex_match(text
, what
, e
);
46 unsigned boost_regex::find_all(const char * text
)
48 boost::regex_iterator
<const char*> i(text
, text
+ std::strlen(text
), e
), j
;
58 std::string
boost_regex::name()