port parse_hex
to use boost::spirit::x3
This commit is contained in:
parent
5eaf37404a
commit
c5174d2862
1 changed files with 4 additions and 5 deletions
|
@ -25,8 +25,7 @@
|
|||
|
||||
#pragma GCC diagnostic push
|
||||
#include <mapnik/warning_ignore.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/qi_char_.hpp>
|
||||
#include <boost/spirit/home/x3.hpp>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
namespace mapnik { namespace util {
|
||||
|
@ -34,11 +33,11 @@ namespace mapnik { namespace util {
|
|||
template <typename Out>
|
||||
bool parse_hex(std::string const& input, Out & output)
|
||||
{
|
||||
boost::spirit::qi::lit_type lit;
|
||||
using boost::spirit::x3::lit;
|
||||
auto itr = input.begin();
|
||||
auto end = input.end();
|
||||
using hex2 = boost::spirit::qi::uint_parser< unsigned, 16, 2, 2 >;
|
||||
return boost::spirit::qi::parse(itr, end, -(lit("\\x") | lit("0x")) > *hex2(), output);
|
||||
using hex2 = boost::spirit::x3::uint_parser< unsigned, 16, 2, 2 >;
|
||||
return boost::spirit::x3::parse(itr, end, -(lit("\\x") | lit("0x")) > *hex2(), output);
|
||||
}
|
||||
|
||||
}}
|
||||
|
|
Loading…
Add table
Reference in a new issue