further no terminal port

This commit is contained in:
Dane Springmeyer 2014-01-26 14:49:03 -08:00
parent 87e0ae8124
commit 63ea37b4c2
24 changed files with 186 additions and 150 deletions

View file

@ -1717,7 +1717,8 @@ if not preconfigured:
# faster compile # faster compile
# http://www.boost.org/doc/libs/1_47_0/libs/spirit/doc/html/spirit/what_s_new/spirit_2_5.html#spirit.what_s_new.spirit_2_5.breaking_changes # http://www.boost.org/doc/libs/1_47_0/libs/spirit/doc/html/spirit/what_s_new/spirit_2_5.html#spirit.what_s_new.spirit_2_5.breaking_changes
env.Append(CPPDEFINES = '-DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1') env.Append(CPPDEFINES = '-DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1')
env.Append(CPPDEFINES = '-DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1')
# c++11 support / https://github.com/mapnik/mapnik/issues/1683 # c++11 support / https://github.com/mapnik/mapnik/issues/1683
# - upgrade to PHOENIX_V3 since that is needed for c++11 compile # - upgrade to PHOENIX_V3 since that is needed for c++11 compile
env.Append(CPPDEFINES = '-DBOOST_SPIRIT_USE_PHOENIX_V3=1') env.Append(CPPDEFINES = '-DBOOST_SPIRIT_USE_PHOENIX_V3=1')

View file

@ -440,13 +440,13 @@ struct css_color_grammar : qi::grammar<Iterator, css(), ascii_space_type>
: css_color_grammar::base_type(css_color) : css_color_grammar::base_type(css_color)
{ {
using qi::lit; qi::lit_type lit;
using qi::_val; qi::_val_type _val;
using qi::double_; qi::double_type double_;
using qi::_1; qi::_1_type _1;
using qi::_a; qi::_a_type _a;
using qi::_b; qi::_b_type _b;
using qi::_c; qi::_c_type _c;
using ascii::no_case; using ascii::no_case;
using phoenix::at_c; using phoenix::at_c;

View file

@ -38,14 +38,14 @@ css_color_grammar<Iterator>::css_color_grammar()
: css_color_grammar::base_type(css_color) : css_color_grammar::base_type(css_color)
{ {
using qi::lit; qi::lit_type lit;
using qi::_val; qi::_val_type _val;
using qi::double_; qi::double_type double_;
using qi::_1; qi::_1_type _1;
using qi::_a; qi::_a_type _a;
using qi::_b; qi::_b_type _b;
using qi::_c; qi::_c_type _c;
using ascii::no_case; ascii::no_case_type no_case;
using phoenix::at_c; using phoenix::at_c;
css_color %= rgba_color css_color %= rgba_color

View file

@ -72,21 +72,20 @@ expression_grammar<Iterator>::expression_grammar(mapnik::transcoder const& tr)
regex_replace_(regex_replace_impl(tr)) regex_replace_(regex_replace_impl(tr))
{ {
using boost::phoenix::construct; using boost::phoenix::construct;
using qi::_1; qi::_1_type _1;
using qi::_a; qi::_a_type _a;
using qi::_b; qi::_b_type _b;
using qi::_r1; qi::_r1_type _r1;
#if BOOST_VERSION > 104200 #if BOOST_VERSION > 104200
using qi::no_skip; qi::no_skip_type no_skip;
#endif #endif
using qi::lexeme; qi::_val_type _val;
using qi::_val; qi::lit_type lit;
using qi::lit; qi::double_type double_;
using qi::double_; qi::hex_type hex;
using qi::hex; qi::omit_type omit;
using qi::omit; standard_wide::char_type char_;
using standard_wide::char_; standard_wide::no_case_type no_case;
using standard_wide::no_case;
expr = logical_expr.alias(); expr = logical_expr.alias();

View file

@ -65,12 +65,14 @@ struct feature_collection_grammar :
ctx_(ctx), ctx_(ctx),
generate_id_(1) generate_id_(1)
{ {
using qi::lit; qi::lit_type lit;
using qi::eps; qi::eps_type eps;
using qi::_a; qi::_4_type _4;
using qi::_b; qi::_3_type _2;
using qi::_val; qi::_2_type _3;
using qi::_r1; qi::_a_type _a;
qi::_val_type _val;
qi::_r1_type _r1;
using phoenix::push_back; using phoenix::push_back;
using phoenix::construct; using phoenix::construct;
using phoenix::new_; using phoenix::new_;
@ -114,9 +116,9 @@ struct feature_collection_grammar :
feature_collection feature_collection
, std::clog , std::clog
<< phoenix::val("Error parsing GeoJSON ") << phoenix::val("Error parsing GeoJSON ")
<< qi::_4 << _4
<< phoenix::val(" here: \"") << phoenix::val(" here: \"")
<< construct<std::string>(qi::_3, qi::_2) << construct<std::string>(_3, _2)
<< phoenix::val('\"') << phoenix::val('\"')
<< std::endl << std::endl
); );

View file

@ -147,8 +147,11 @@ struct escaped_string
escaped_string() escaped_string()
: escaped_string::base_type(esc_str) : escaped_string::base_type(esc_str)
{ {
using boost::spirit::karma::maxwidth; karma::lit_type lit;
using boost::spirit::karma::right_align; karma::_r1_type _r1;
karma::hex_type hex;
karma::right_align_type right_align;
karma::print_type kprint;
esc_char.add esc_char.add
('"', "\\\"") ('"', "\\\"")
@ -160,11 +163,11 @@ struct escaped_string
('\t', "\\t") ('\t', "\\t")
; ;
esc_str = karma::lit(karma::_r1) esc_str = lit(_r1)
<< *(esc_char << *(esc_char
| karma::print | kprint
| "\\u" << right_align(4,karma::lit('0'))[karma::hex]) | "\\u" << right_align(4,lit('0'))[hex])
<< karma::lit(karma::_r1) << lit(_r1)
; ;
} }
@ -185,15 +188,15 @@ struct feature_generator_grammar:
, quote_("\"") , quote_("\"")
{ {
using boost::spirit::karma::lit; boost::spirit::karma::lit_type lit;
using boost::spirit::karma::uint_; boost::spirit::karma::uint_type uint_;
using boost::spirit::karma::bool_; boost::spirit::karma::bool_type bool_;
using boost::spirit::karma::double_; boost::spirit::karma::double_type double_;
using boost::spirit::karma::_val; boost::spirit::karma::_val_type _val;
using boost::spirit::karma::_1; boost::spirit::karma::_1_type _1;
using boost::spirit::karma::_r1; boost::spirit::karma::_r1_type _r1;
using boost::spirit::karma::string; boost::spirit::karma::string_type kstring;
using boost::spirit::karma::eps; boost::spirit::karma::eps_type eps;
feature = lit("{\"type\":\"Feature\",\"id\":") feature = lit("{\"type\":\"Feature\",\"id\":")
<< uint_[_1 = id_(_val)] << uint_[_1 = id_(_val)]
@ -208,7 +211,7 @@ struct feature_generator_grammar:
; ;
pair = lit('"') pair = lit('"')
<< string[_1 = phoenix::at_c<0>(_val)] << lit('"') << kstring[_1 = phoenix::at_c<0>(_val)] << lit('"')
<< lit(':') << lit(':')
<< value(phoenix::at_c<1>(_val)) << value(phoenix::at_c<1>(_val))
; ;
@ -216,7 +219,7 @@ struct feature_generator_grammar:
value = (value_null_| bool_ | int__ | double_ | ustring)[_1 = value_base_(_r1)] value = (value_null_| bool_ | int__ | double_ | ustring)[_1 = value_base_(_r1)]
; ;
value_null_ = string[_1 = "null"] value_null_ = kstring[_1 = "null"]
; ;
ustring = escaped_string_(quote_.c_str())[_1 = utf8_(_val)] ustring = escaped_string_(quote_.c_str())[_1 = utf8_(_val)]

View file

@ -231,14 +231,15 @@ struct geometry_generator_grammar :
geometry_generator_grammar() geometry_generator_grammar()
: geometry_generator_grammar::base_type(coordinates) : geometry_generator_grammar::base_type(coordinates)
{ {
using boost::spirit::karma::uint_; boost::spirit::karma::uint_type uint_;
using boost::spirit::bool_; boost::spirit::bool_type bool_;
using boost::spirit::karma::_val; boost::spirit::karma::_val_type _val;
using boost::spirit::karma::_1; boost::spirit::karma::_1_type _1;
using boost::spirit::karma::lit; boost::spirit::karma::lit_type lit;
using boost::spirit::karma::_a; boost::spirit::karma::_a_type _a;
using boost::spirit::karma::_r1; boost::spirit::karma::_r1_type _r1;
using boost::spirit::karma::eps; boost::spirit::karma::eps_type eps;
boost::spirit::karma::string_type kstring;
coordinates = point | linestring | polygon coordinates = point | linestring | polygon
; ;
@ -266,7 +267,7 @@ struct geometry_generator_grammar :
; ;
polygon_coord %= ( &uint_(mapnik::SEG_MOVETO) << eps[_r1 += 1] polygon_coord %= ( &uint_(mapnik::SEG_MOVETO) << eps[_r1 += 1]
<< karma::string[ if_ (_r1 > 1) [_1 = "],["] << kstring[ if_ (_r1 > 1) [_1 = "],["]
.else_[_1 = '[' ]] .else_[_1 = '[' ]]
| |
&uint_(mapnik::SEG_LINETO) &uint_(mapnik::SEG_LINETO)
@ -308,13 +309,14 @@ struct multi_geometry_generator_grammar :
multi_geometry_generator_grammar() multi_geometry_generator_grammar()
: multi_geometry_generator_grammar::base_type(start) : multi_geometry_generator_grammar::base_type(start)
{ {
using boost::spirit::karma::lit; boost::spirit::karma::uint_type uint_;
using boost::spirit::karma::eps; boost::spirit::bool_type bool_;
using boost::spirit::karma::_val; boost::spirit::karma::_val_type _val;
using boost::spirit::karma::_1; boost::spirit::karma::_1_type _1;
using boost::spirit::karma::_a; boost::spirit::karma::lit_type lit;
using boost::spirit::karma::_r1; boost::spirit::karma::_a_type _a;
using boost::spirit::bool_; boost::spirit::karma::eps_type eps;
boost::spirit::karma::string_type kstring;
geometry_types.add geometry_types.add
(mapnik::geometry_type::types::Point,"\"Point\"") (mapnik::geometry_type::types::Point,"\"Point\"")
@ -338,9 +340,9 @@ struct multi_geometry_generator_grammar :
geometry = ( &bool_(true)[_1 = not_empty_(_val)] << lit("{\"type\":") geometry = ( &bool_(true)[_1 = not_empty_(_val)] << lit("{\"type\":")
<< geometry_types[_1 = phoenix::at_c<0>(_a)][_a = multi_type_(_val)] << geometry_types[_1 = phoenix::at_c<0>(_a)][_a = multi_type_(_val)]
<< lit(",\"coordinates\":") << lit(",\"coordinates\":")
<< karma::string[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = '['].else_[_1 = ""]] << kstring[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = '['].else_[_1 = ""]]
<< coordinates << coordinates
<< karma::string[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = ']'].else_[_1 = ""]] << kstring[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = ']'].else_[_1 = ""]]
<< lit('}')) | lit("null") << lit('}')) | lit("null")
; ;

View file

@ -34,18 +34,18 @@ template <typename Iterator>
topojson_grammar<Iterator>::topojson_grammar() topojson_grammar<Iterator>::topojson_grammar()
: topojson_grammar::base_type(topology, "topojson") : topojson_grammar::base_type(topology, "topojson")
{ {
using qi::lit; qi::lit_type lit;
using qi::double_; qi::double_type double_;
using qi::int_; qi::int__type int_;
using qi::no_skip; qi::no_skip_type no_skip;
using qi::omit; qi::omit_type omit;
using qi::_val; qi::_val_type _val;
using qi::_1; qi::_1_type _1;
using qi::_2; qi::_2_type _2;
using qi::_3; qi::_3_type _3;
using qi::_4; qi::_4_type _4;
using qi::fail; qi::fail_type fail;
using qi::on_error; qi::on_error_type on_error;
using standard_wide::char_; using standard_wide::char_;
using phoenix::construct; using phoenix::construct;

View file

@ -64,6 +64,7 @@ namespace mapnik { namespace svg {
template <typename PathType> template <typename PathType>
void generate_path(PathType const& path, path_output_attributes const& path_attributes) void generate_path(PathType const& path, path_output_attributes const& path_attributes)
{ {
karma::lit_type lit;
util::svg_generator<OutputIterator,PathType> svg_path_grammer; util::svg_generator<OutputIterator,PathType> svg_path_grammer;
karma::generate(output_iterator_, lit("<path ") << svg_path_grammer, path); karma::generate(output_iterator_, lit("<path ") << svg_path_grammer, path);
path_attributes_grammar attributes_grammar; path_attributes_grammar attributes_grammar;

View file

@ -100,18 +100,19 @@ struct svg_path_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg:
explicit svg_path_attributes_grammar() explicit svg_path_attributes_grammar()
: svg_path_attributes_grammar::base_type(svg_path_attributes) : svg_path_attributes_grammar::base_type(svg_path_attributes)
{ {
using karma::double_; karma::lit_type lit;
using karma::string; karma::double_type double_;
using repository::confix; karma::string_type kstring;
repository::confix_type confix;
svg_path_attributes = svg_path_attributes =
lit("fill=") << confix('"', '"')[string] lit("fill=") << confix('"', '"')[kstring]
<< lit(" fill-opacity=") << confix('"', '"')[double_] << lit(" fill-opacity=") << confix('"', '"')[double_]
<< lit(" stroke=") << confix('"', '"')[string] << lit(" stroke=") << confix('"', '"')[kstring]
<< lit(" stroke-opacity=") << confix('"', '"')[double_] << lit(" stroke-opacity=") << confix('"', '"')[double_]
<< lit(" stroke-width=") << confix('"', '"')[double_ << lit("px")] << lit(" stroke-width=") << confix('"', '"')[double_ << lit("px")]
<< lit(" stroke-linecap=") << confix('"', '"')[string] << lit(" stroke-linecap=") << confix('"', '"')[kstring]
<< lit(" stroke-linejoin=") << confix('"', '"')[string] << lit(" stroke-linejoin=") << confix('"', '"')[kstring]
<< lit(" stroke-dashoffset=") << confix('"', '"')[double_ << lit("px")]; << lit(" stroke-dashoffset=") << confix('"', '"')[double_ << lit("px")];
} }
@ -124,8 +125,9 @@ struct svg_path_dash_array_grammar : karma::grammar<OutputIterator, mapnik::dash
explicit svg_path_dash_array_grammar() explicit svg_path_dash_array_grammar()
: svg_path_dash_array_grammar::base_type(svg_path_dash_array) : svg_path_dash_array_grammar::base_type(svg_path_dash_array)
{ {
using karma::double_; karma::double_type double_;
using repository::confix; karma::lit_type lit;
repository::confix_type confix;
svg_path_dash_array = svg_path_dash_array =
lit("stroke-dasharray=") lit("stroke-dasharray=")
@ -142,16 +144,17 @@ struct svg_rect_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg:
explicit svg_rect_attributes_grammar() explicit svg_rect_attributes_grammar()
: svg_rect_attributes_grammar::base_type(svg_rect_attributes) : svg_rect_attributes_grammar::base_type(svg_rect_attributes)
{ {
using karma::int_; karma::lit_type lit;
using karma::string; karma::int_type int_;
using repository::confix; karma::string_type kstring;
repository::confix_type confix;
svg_rect_attributes = svg_rect_attributes =
lit("x=") << confix('"', '"')[int_] lit("x=") << confix('"', '"')[int_]
<< lit(" y=") << confix('"', '"')[int_] << lit(" y=") << confix('"', '"')[int_]
<< lit(" width=") << confix('"', '"')[int_ << lit("px")] << lit(" width=") << confix('"', '"')[int_ << lit("px")]
<< lit(" height=") << confix('"', '"')[int_ << lit("px")] << lit(" height=") << confix('"', '"')[int_ << lit("px")]
<< lit(" fill=") << confix('"', '"')[string]; << lit(" fill=") << confix('"', '"')[kstring];
} }
karma::rule<OutputIterator, mapnik::svg::rect_output_attributes()> svg_rect_attributes; karma::rule<OutputIterator, mapnik::svg::rect_output_attributes()> svg_rect_attributes;
@ -163,16 +166,17 @@ struct svg_root_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg:
explicit svg_root_attributes_grammar() explicit svg_root_attributes_grammar()
: svg_root_attributes_grammar::base_type(svg_root_attributes) : svg_root_attributes_grammar::base_type(svg_root_attributes)
{ {
using karma::int_; karma::lit_type lit;
using karma::string; karma::int_type int_;
using karma::double_; karma::string_type kstring;
using repository::confix; karma::double_type double_;
repository::confix_type confix;
svg_root_attributes = svg_root_attributes =
lit("width=") << confix('"', '"')[int_ << lit("px")] lit("width=") << confix('"', '"')[int_ << lit("px")]
<< lit(" height=") << confix('"', '"')[int_ << lit("px")] << lit(" height=") << confix('"', '"')[int_ << lit("px")]
<< " version=" << confix('"', '"')[double_] << " version=" << confix('"', '"')[double_]
<< " xmlns=" << confix('"', '"')[string] << " xmlns=" << confix('"', '"')[kstring]
<< lit(" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\""); << lit(" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"");
} }

View file

@ -24,6 +24,7 @@
#define MAPNIK_SVG_RENDERER_HPP #define MAPNIK_SVG_RENDERER_HPP
// mapnik // mapnik
#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
#include <mapnik/config.hpp> #include <mapnik/config.hpp>
#include <mapnik/feature_style_processor.hpp> #include <mapnik/feature_style_processor.hpp>
#include <mapnik/font_engine_freetype.hpp> #include <mapnik/font_engine_freetype.hpp>

View file

@ -53,16 +53,16 @@ namespace mapnik { namespace svg {
arc_to_(arc_to<PathType>(path)), arc_to_(arc_to<PathType>(path)),
close_(close<PathType>(path)) close_(close<PathType>(path))
{ {
using qi::_1; qi::_1_type _1;
using qi::_2; qi::_2_type _2;
using qi::_3; qi::_3_type _3;
using qi::_4; qi::_4_type _4;
using qi::_5; qi::_5_type _5;
using qi::_a; qi::_a_type _a;
using qi::lit; qi::lit_type lit;
using qi::double_; qi::double_type double_;
using qi::int_; qi::int_type int_;
using qi::no_case; qi::no_case_type no_case;
start = +cmd; start = +cmd;
cmd = M >> *drawto_cmd; cmd = M >> *drawto_cmd;

View file

@ -45,9 +45,9 @@ namespace mapnik { namespace svg {
line_to_(line_to<PathType>(path)), line_to_(line_to<PathType>(path)),
close_(close<PathType>(path)) close_(close<PathType>(path))
{ {
using qi::_1; qi::_1_type _1;
using qi::_2; qi::lit_type lit;
using qi::double_; qi::double_type double_;
start = coord[move_to_(_1,false)] // move_to start = coord[move_to_(_1,false)] // move_to
>> *(-lit(',') >> coord [ line_to_(_1,false) ] ); // *line_to >> *(-lit(',') >> coord [ line_to_(_1,false) ] ); // *line_to

View file

@ -207,18 +207,18 @@ namespace mapnik { namespace svg {
scale_action(process_scale<TransformType>(tr)), scale_action(process_scale<TransformType>(tr)),
skew_action(process_skew<TransformType>(tr)) skew_action(process_skew<TransformType>(tr))
{ {
using qi::_1; qi::_1_type _1;
using qi::_2; qi::_2_type _2;
using qi::_3; qi::_3_type _3;
using qi::_4; qi::_4_type _4;
using qi::_5; qi::_5_type _5;
using qi::_6; qi::_6_type _6;
using qi::_a; qi::_a_type _a;
using qi::_b; qi::_b_type _b;
using qi::_c; qi::_c_type _c;
using qi::_val; qi::lit_type lit;
using qi::double_; qi::double_type double_;
using qi::no_case; qi::no_case_type no_case;
start = +transform_ ; start = +transform_ ;

View file

@ -33,22 +33,22 @@ namespace mapnik { namespace util {
template <typename Iterator> template <typename Iterator>
bool parse_dasharray(Iterator first, Iterator last, std::vector<double>& dasharray) bool parse_dasharray(Iterator first, Iterator last, std::vector<double>& dasharray)
{ {
using qi::double_; qi::double_type double_;
using qi::phrase_parse; qi::_1_type _1;
using qi::_1; qi::lit_type lit;
using qi::lit; qi::char_type char_;
using qi::char_; qi::ascii::space_type space;
#if BOOST_VERSION > 104200 #if BOOST_VERSION > 104200
using qi::no_skip; qi::no_skip_type no_skip;
#else #else
using qi::lexeme; qi::lexeme_type lexeme;
#endif #endif
using phoenix::push_back; using phoenix::push_back;
// SVG // SVG
// dasharray ::= (length | percentage) (comma-wsp dasharray)? // dasharray ::= (length | percentage) (comma-wsp dasharray)?
// no support for 'percentage' as viewport is unknown at load_map // no support for 'percentage' as viewport is unknown at load_map
// //
bool r = phrase_parse(first, last, bool r = qi::phrase_parse(first, last,
(double_[push_back(phoenix::ref(dasharray), _1)] % (double_[push_back(phoenix::ref(dasharray), _1)] %
#if BOOST_VERSION > 104200 #if BOOST_VERSION > 104200
no_skip[char_(", ")] no_skip[char_(", ")]
@ -56,7 +56,7 @@ bool parse_dasharray(Iterator first, Iterator last, std::vector<double>& dasharr
lexeme[char_(", ")] lexeme[char_(", ")]
#endif #endif
| lit("none")), | lit("none")),
qi::ascii::space); space);
if (first != last) if (first != last)
{ {
return false; return false;

View file

@ -166,11 +166,12 @@ namespace mapnik { namespace util {
svg_generator() svg_generator()
: svg_generator::base_type(svg) : svg_generator::base_type(svg)
{ {
using boost::spirit::karma::uint_; boost::spirit::karma::uint_type uint_;
using boost::spirit::karma::_val; boost::spirit::karma::_val_type _val;
using boost::spirit::karma::_1; boost::spirit::karma::_1_type _1;
using boost::spirit::karma::lit; boost::spirit::karma::lit_type lit;
using boost::spirit::karma::_a; boost::spirit::karma::_a_type _a;
boost::spirit::karma::string_type kstring;
svg = point | linestring | polygon svg = point | linestring | polygon
; ;
@ -194,7 +195,7 @@ namespace mapnik { namespace util {
; ;
svg_path %= ((&uint_(mapnik::SEG_MOVETO) << lit('M') svg_path %= ((&uint_(mapnik::SEG_MOVETO) << lit('M')
| &uint_(mapnik::SEG_LINETO) [_a +=1] << karma::string [if_(_a == 1) [_1 = "L" ].else_[_1 =""]]) | &uint_(mapnik::SEG_LINETO) [_a +=1] << kstring [if_(_a == 1) [_1 = "L" ].else_[_1 =""]])
<< lit(' ') << coordinate << lit(' ') << coordinate) % lit(' ') << lit(' ') << coordinate << lit(' ') << coordinate) % lit(' ')
; ;

View file

@ -99,9 +99,17 @@ namespace mapnik { namespace wkt {
wkt_grammar() wkt_grammar()
: wkt_grammar::base_type(geometry_tagged_text) : wkt_grammar::base_type(geometry_tagged_text)
{ {
using qi::no_case; qi::_r1_type _r1;
using qi::_1; qi::_r2_type _r2;
using qi::_2; qi::_pass_type _pass;
qi::eps_type eps;
qi::_val_type _val;
qi::lit_type lit;
qi::no_case_type no_case;
qi::double_type double_;
qi::_1_type _1;
qi::_2_type _2;
qi::_a_type _a;
using boost::phoenix::push_back; using boost::phoenix::push_back;
geometry_tagged_text = point_tagged_text geometry_tagged_text = point_tagged_text
@ -223,9 +231,8 @@ struct wkt_collection_grammar : qi::grammar<Iterator, boost::ptr_vector<mapnik::
wkt_collection_grammar() wkt_collection_grammar()
: wkt_collection_grammar::base_type(start) : wkt_collection_grammar::base_type(start)
{ {
using qi::_1; qi::lit_type lit;
using qi::_val; qi::no_case_type no_case;
using qi::no_case;
using boost::phoenix::push_back; using boost::phoenix::push_back;
start = wkt | no_case[lit("GEOMETRYCOLLECTION")] start = wkt | no_case[lit("GEOMETRYCOLLECTION")]
>> (lit("(") >> wkt % lit(",") >> lit(")")); >> (lit("(") >> wkt % lit(",") >> lit(")"));

View file

@ -184,16 +184,24 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat
double val = 0.0; double val = 0.0;
const char *itr = record_+fields_[col].offset_; const char *itr = record_+fields_[col].offset_;
const char *end = itr + fields_[col].length_; const char *end = itr + fields_[col].length_;
if (qi::phrase_parse(itr,end,double_,ascii::space,val)) ascii::space_type space;
qi::double_type double_;
if (qi::phrase_parse(itr,end,double_,space,val))
{
f.put(name,val); f.put(name,val);
}
} }
else else
{ {
mapnik::value_integer val = 0; mapnik::value_integer val = 0;
const char *itr = record_+fields_[col].offset_; const char *itr = record_+fields_[col].offset_;
const char *end = itr + fields_[col].length_; const char *end = itr + fields_[col].length_;
if (qi::phrase_parse(itr,end,int_,ascii::space,val)) ascii::space_type space;
qi::int_type int_;
if (qi::phrase_parse(itr,end,int_,space,val))
{
f.put(name,val); f.put(name,val);
}
} }
break; break;
} }

View file

@ -1,3 +1,5 @@
#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
#define BOOST_TEST_MODULE background_color_test #define BOOST_TEST_MODULE background_color_test
/* /*

View file

@ -1,3 +1,4 @@
#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
#define BOOST_TEST_MODULE combined_tests #define BOOST_TEST_MODULE combined_tests
// boost.test // boost.test

View file

@ -1,3 +1,4 @@
#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
#define BOOST_TEST_MODULE compile_test #define BOOST_TEST_MODULE compile_test
// boost.test // boost.test

View file

@ -1,3 +1,4 @@
#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
#define BOOST_TEST_MODULE file_output_test #define BOOST_TEST_MODULE file_output_test
/* /*

View file

@ -1,3 +1,4 @@
#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
#define BOOST_TEST_MODULE path_element_tests #define BOOST_TEST_MODULE path_element_tests
// boost.test // boost.test

View file

@ -1,3 +1,4 @@
#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
#define BOOST_TEST_MODULE root_element_test #define BOOST_TEST_MODULE root_element_test
/* /*