rename mapnik::boolean to mapnik::boolean_type - closes #1899
This commit is contained in:
parent
51be686f6c
commit
8feedd94cd
17 changed files with 77 additions and 77 deletions
|
@ -32,13 +32,13 @@ namespace mapnik
|
|||
{
|
||||
|
||||
// Helper for class bool
|
||||
class boolean {
|
||||
class boolean_type {
|
||||
public:
|
||||
boolean()
|
||||
boolean_type()
|
||||
: b_(false) {}
|
||||
boolean(bool b)
|
||||
boolean_type(bool b)
|
||||
: b_(b) {}
|
||||
boolean(boolean const& b)
|
||||
boolean_type(boolean_type const& b)
|
||||
: b_(b.b_) {}
|
||||
|
||||
operator bool() const
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
return b_;
|
||||
}
|
||||
|
||||
boolean & operator =(boolean const& other)
|
||||
boolean_type & operator =(boolean_type const& other)
|
||||
{
|
||||
if (this == &other)
|
||||
return *this;
|
||||
|
@ -58,10 +58,10 @@ private:
|
|||
bool b_;
|
||||
};
|
||||
|
||||
// Special stream input operator for boolean values
|
||||
// Special stream input operator for boolean_type values
|
||||
template <typename charT, typename traits>
|
||||
std::basic_istream<charT, traits> &
|
||||
operator >> ( std::basic_istream<charT, traits> & s, boolean & b )
|
||||
operator >> ( std::basic_istream<charT, traits> & s, boolean_type & b )
|
||||
{
|
||||
std::string word;
|
||||
s >> word;
|
||||
|
@ -88,7 +88,7 @@ operator >> ( std::basic_istream<charT, traits> & s, boolean & b )
|
|||
|
||||
template <typename charT, typename traits>
|
||||
std::basic_ostream<charT, traits> &
|
||||
operator << ( std::basic_ostream<charT, traits> & s, boolean const& b )
|
||||
operator << ( std::basic_ostream<charT, traits> & s, boolean_type const& b )
|
||||
{
|
||||
s << ( b ? "true" : "false" );
|
||||
return s;
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace mapnik
|
|||
{
|
||||
|
||||
// fwd declare
|
||||
class boolean;
|
||||
class boolean_type;
|
||||
|
||||
using value_holder = boost::variant<value_null,value_integer,value_double,std::string>;
|
||||
using parameter = std::pair<std::string, value_holder>;
|
||||
|
@ -74,10 +74,10 @@ boost::optional<value_integer> parameters::get(std::string const& key,
|
|||
value_integer const& default_opt_value) const;
|
||||
|
||||
template MAPNIK_DECL
|
||||
boost::optional<mapnik::boolean> parameters::get(std::string const& key) const;
|
||||
boost::optional<mapnik::boolean_type> parameters::get(std::string const& key) const;
|
||||
template MAPNIK_DECL
|
||||
boost::optional<mapnik::boolean> parameters::get(std::string const& key,
|
||||
mapnik::boolean const& default_opt_value) const;
|
||||
boost::optional<mapnik::boolean_type> parameters::get(std::string const& key,
|
||||
mapnik::boolean_type const& default_opt_value) const;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -55,14 +55,14 @@ struct extract_value
|
|||
};
|
||||
|
||||
template <>
|
||||
struct extract_value<mapnik::boolean>
|
||||
struct extract_value<mapnik::boolean_type>
|
||||
{
|
||||
static inline boost::optional<mapnik::boolean> do_extract_from_string(std::string const& source)
|
||||
static inline boost::optional<mapnik::boolean_type> do_extract_from_string(std::string const& source)
|
||||
{
|
||||
bool result;
|
||||
if (mapnik::util::string2bool(source, result))
|
||||
return boost::optional<mapnik::boolean>(result);
|
||||
return boost::optional<mapnik::boolean>();
|
||||
return boost::optional<mapnik::boolean_type>(result);
|
||||
return boost::optional<mapnik::boolean_type>();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -57,16 +57,16 @@ struct do_xml_attribute_cast
|
|||
}
|
||||
};
|
||||
|
||||
// specialization for mapnik::boolean
|
||||
// specialization for mapnik::boolean_type
|
||||
template <>
|
||||
struct do_xml_attribute_cast<mapnik::boolean>
|
||||
struct do_xml_attribute_cast<mapnik::boolean_type>
|
||||
{
|
||||
static inline boost::optional<mapnik::boolean> xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source)
|
||||
static inline boost::optional<mapnik::boolean_type> xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source)
|
||||
{
|
||||
bool result;
|
||||
if (mapnik::util::string2bool(source, result))
|
||||
return boost::optional<mapnik::boolean>(result);
|
||||
return boost::optional<mapnik::boolean>();
|
||||
return boost::optional<mapnik::boolean_type>(result);
|
||||
return boost::optional<mapnik::boolean_type>();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ csv_datasource::csv_datasource(parameters const& params)
|
|||
quote_(*params.get<std::string>("quote", "")),
|
||||
headers_(),
|
||||
manual_headers_(mapnik::util::trim_copy(*params.get<std::string>("headers", ""))),
|
||||
strict_(*params.get<mapnik::boolean>("strict", false)),
|
||||
strict_(*params.get<mapnik::boolean_type>("strict", false)),
|
||||
filesize_max_(*params.get<double>("filesize_max", 20.0)), // MB
|
||||
ctx_(std::make_shared<mapnik::context_type>()),
|
||||
extent_initialized_(false)
|
||||
|
|
|
@ -101,7 +101,7 @@ gdal_datasource::gdal_datasource(parameters const& params)
|
|||
dataset_name_ = *file;
|
||||
}
|
||||
|
||||
shared_dataset_ = *params.get<mapnik::boolean>("shared", false);
|
||||
shared_dataset_ = *params.get<mapnik::boolean_type>("shared", false);
|
||||
band_ = *params.get<mapnik::value_integer>("band", -1);
|
||||
|
||||
GDALDataset *dataset = open_dataset();
|
||||
|
|
|
@ -77,7 +77,7 @@ occi_datasource::occi_datasource(parameters const& params)
|
|||
pixel_width_token_("!pixel_width!"),
|
||||
pixel_height_token_("!pixel_height!"),
|
||||
desc_(occi_datasource::name(), *params.get<std::string>("encoding", "utf-8")),
|
||||
use_wkb_(*params.get<mapnik::boolean>("use_wkb", false)),
|
||||
use_wkb_(*params.get<mapnik::boolean_type>("use_wkb", false)),
|
||||
row_limit_(*params.get<mapnik::value_integer>("row_limit", 0)),
|
||||
row_prefetch_(*params.get<int>("row_prefetch", 100)),
|
||||
pool_(0),
|
||||
|
@ -100,9 +100,9 @@ occi_datasource::occi_datasource(parameters const& params)
|
|||
{
|
||||
table_ = *table;
|
||||
}
|
||||
estimate_extent_ = *params.get<mapnik::boolean>("estimate_extent",false);
|
||||
use_spatial_index_ = *params.get<mapnik::boolean>("use_spatial_index",true);
|
||||
use_connection_pool_ = *params.get<mapnik::boolean>("use_connection_pool",true);
|
||||
estimate_extent_ = *params.get<mapnik::boolean_type>("estimate_extent",false);
|
||||
use_spatial_index_ = *params.get<mapnik::boolean_type>("use_spatial_index",true);
|
||||
use_connection_pool_ = *params.get<mapnik::boolean_type>("use_connection_pool",true);
|
||||
|
||||
boost::optional<std::string> ext = params.get<std::string>("extent");
|
||||
if (ext) extent_initialized_ = extent_.from_string(*ext);
|
||||
|
|
|
@ -82,8 +82,8 @@ postgis_datasource::postgis_datasource(parameters const& params)
|
|||
pixel_width_token_("!pixel_width!"),
|
||||
pixel_height_token_("!pixel_height!"),
|
||||
pool_max_size_(*params_.get<mapnik::value_integer>("max_size", 10)),
|
||||
persist_connection_(*params.get<mapnik::boolean>("persist_connection", true)),
|
||||
extent_from_subquery_(*params.get<mapnik::boolean>("extent_from_subquery", false)),
|
||||
persist_connection_(*params.get<mapnik::boolean_type>("persist_connection", true)),
|
||||
extent_from_subquery_(*params.get<mapnik::boolean_type>("extent_from_subquery", false)),
|
||||
max_async_connections_(*params_.get<mapnik::value_integer>("max_async_connection", 1)),
|
||||
asynchronous_request_(false),
|
||||
// TODO - use for known tokens too: "(@\\w+|!\\w+!)"
|
||||
|
@ -121,10 +121,10 @@ postgis_datasource::postgis_datasource(parameters const& params)
|
|||
}
|
||||
|
||||
boost::optional<mapnik::value_integer> initial_size = params.get<mapnik::value_integer>("initial_size", 1);
|
||||
boost::optional<mapnik::boolean> autodetect_key_field = params.get<mapnik::boolean>("autodetect_key_field", false);
|
||||
boost::optional<mapnik::boolean> estimate_extent = params.get<mapnik::boolean>("estimate_extent", false);
|
||||
boost::optional<mapnik::boolean_type> autodetect_key_field = params.get<mapnik::boolean_type>("autodetect_key_field", false);
|
||||
boost::optional<mapnik::boolean_type> estimate_extent = params.get<mapnik::boolean_type>("estimate_extent", false);
|
||||
estimate_extent_ = estimate_extent && *estimate_extent;
|
||||
boost::optional<mapnik::boolean> simplify_opt = params.get<mapnik::boolean>("simplify_geometries", false);
|
||||
boost::optional<mapnik::boolean_type> simplify_opt = params.get<mapnik::boolean_type>("simplify_geometries", false);
|
||||
simplify_geometries_ = simplify_opt && *simplify_opt;
|
||||
|
||||
ConnectionManager::instance().registerPool(creator_, *initial_size, pool_max_size_);
|
||||
|
|
|
@ -61,7 +61,7 @@ raster_datasource::raster_datasource(parameters const& params)
|
|||
else
|
||||
filename_ = *file;
|
||||
|
||||
multi_tiles_ = *params.get<mapnik::boolean>("multi", false);
|
||||
multi_tiles_ = *params.get<mapnik::boolean_type>("multi", false);
|
||||
tile_size_ = *params.get<mapnik::value_integer>("tile_size", 256);
|
||||
tile_stride_ = *params.get<mapnik::value_integer>("tile_stride", 1);
|
||||
|
||||
|
|
|
@ -93,10 +93,10 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
|
|||
throw datasource_exception("Sqlite Plugin: " + dataset_name_ + " does not exist");
|
||||
}
|
||||
|
||||
use_spatial_index_ = *params.get<mapnik::boolean>("use_spatial_index", true);
|
||||
use_spatial_index_ = *params.get<mapnik::boolean_type>("use_spatial_index", true);
|
||||
|
||||
// TODO - remove this option once all datasources have an indexing api
|
||||
bool auto_index = *params.get<mapnik::boolean>("auto_index", true);
|
||||
bool auto_index = *params.get<mapnik::boolean_type>("auto_index", true);
|
||||
|
||||
boost::optional<std::string> ext = params.get<std::string>("extent");
|
||||
if (ext) extent_initialized_ = extent_.from_string(*ext);
|
||||
|
|
|
@ -431,7 +431,7 @@ void map_parser::parse_style(Map & map, xml_node const& node)
|
|||
optional<double> opacity = node.get_opt_attr<double>("opacity");
|
||||
if (opacity) style.set_opacity(*opacity);
|
||||
|
||||
optional<mapnik::boolean> image_filters_inflate = node.get_opt_attr<mapnik::boolean>("image-filters-inflate");
|
||||
optional<mapnik::boolean_type> image_filters_inflate = node.get_opt_attr<mapnik::boolean_type>("image-filters-inflate");
|
||||
if (image_filters_inflate)
|
||||
{
|
||||
style.set_image_filters_inflate(*image_filters_inflate);
|
||||
|
@ -557,7 +557,7 @@ void map_parser::parse_layer(Map & map, xml_node const& node)
|
|||
}
|
||||
layer lyr(name, srs);
|
||||
|
||||
optional<mapnik::boolean> status = node.get_opt_attr<mapnik::boolean>("status");
|
||||
optional<mapnik::boolean_type> status = node.get_opt_attr<mapnik::boolean_type>("status");
|
||||
if (status)
|
||||
{
|
||||
lyr.set_active(* status);
|
||||
|
@ -576,21 +576,21 @@ void map_parser::parse_layer(Map & map, xml_node const& node)
|
|||
lyr.set_max_zoom(* max_zoom);
|
||||
}
|
||||
|
||||
optional<mapnik::boolean> queryable = node.get_opt_attr<mapnik::boolean>("queryable");
|
||||
optional<mapnik::boolean_type> queryable = node.get_opt_attr<mapnik::boolean_type>("queryable");
|
||||
if (queryable)
|
||||
{
|
||||
lyr.set_queryable(* queryable);
|
||||
}
|
||||
|
||||
optional<mapnik::boolean> clear_cache =
|
||||
node.get_opt_attr<mapnik::boolean>("clear-label-cache");
|
||||
optional<mapnik::boolean_type> clear_cache =
|
||||
node.get_opt_attr<mapnik::boolean_type>("clear-label-cache");
|
||||
if (clear_cache)
|
||||
{
|
||||
lyr.set_clear_label_cache(* clear_cache);
|
||||
}
|
||||
|
||||
optional<mapnik::boolean> cache_features =
|
||||
node.get_opt_attr<mapnik::boolean>("cache-features");
|
||||
optional<mapnik::boolean_type> cache_features =
|
||||
node.get_opt_attr<mapnik::boolean_type>("cache-features");
|
||||
if (cache_features)
|
||||
{
|
||||
lyr.set_cache_features(* cache_features);
|
||||
|
@ -959,7 +959,7 @@ void map_parser::parse_symbolizer_base(symbolizer_base &sym, xml_node const& nod
|
|||
// geometry transform
|
||||
set_symbolizer_property<symbolizer_base, transform_type>(sym, keys::geometry_transform, node);
|
||||
// clip
|
||||
set_symbolizer_property<symbolizer_base, boolean>(sym, keys::clip, node);
|
||||
set_symbolizer_property<symbolizer_base, boolean_type>(sym, keys::clip, node);
|
||||
// simplify algorithm
|
||||
set_symbolizer_property<symbolizer_base, simplify_algorithm_e>(sym, keys::simplify_algorithm, node);
|
||||
// simplify value
|
||||
|
@ -979,11 +979,11 @@ void map_parser::parse_point_symbolizer(rule & rule, xml_node const & node)
|
|||
point_symbolizer sym;
|
||||
parse_symbolizer_base(sym, node);
|
||||
// allow-overlap
|
||||
set_symbolizer_property<point_symbolizer,boolean>(sym, keys::allow_overlap, node);
|
||||
set_symbolizer_property<point_symbolizer,boolean_type>(sym, keys::allow_overlap, node);
|
||||
// opacity
|
||||
set_symbolizer_property<point_symbolizer,double>(sym, keys::opacity, node);
|
||||
// ignore-placement
|
||||
set_symbolizer_property<point_symbolizer,boolean>(sym, keys::ignore_placement, node);
|
||||
set_symbolizer_property<point_symbolizer,boolean_type>(sym, keys::ignore_placement, node);
|
||||
// point placement
|
||||
set_symbolizer_property<symbolizer_base,point_placement_enum>(sym, keys::point_placement_type, node);
|
||||
if (file && !file->empty())
|
||||
|
@ -1076,9 +1076,9 @@ void map_parser::parse_markers_symbolizer(rule & rule, xml_node const& node)
|
|||
// max-error
|
||||
set_symbolizer_property<markers_symbolizer,double>(sym, keys::max_error, node);
|
||||
// allow-overlap
|
||||
set_symbolizer_property<markers_symbolizer,boolean>(sym, keys::allow_overlap, node);
|
||||
set_symbolizer_property<markers_symbolizer,boolean_type>(sym, keys::allow_overlap, node);
|
||||
// ignore-placement
|
||||
set_symbolizer_property<markers_symbolizer,boolean>(sym, keys::ignore_placement, node);
|
||||
set_symbolizer_property<markers_symbolizer,boolean_type>(sym, keys::ignore_placement, node);
|
||||
// width
|
||||
//set_symbolizer_property<markers_symbolizer,double>(sym, keys::width, node);
|
||||
// height
|
||||
|
@ -1280,7 +1280,7 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& node)
|
|||
set_symbolizer_property<shield_symbolizer,double>(sym, keys::text_opacity, node);
|
||||
|
||||
// unlock_image
|
||||
optional<mapnik::boolean> unlock_image = node.get_opt_attr<mapnik::boolean>("unlock-image");
|
||||
optional<mapnik::boolean_type> unlock_image = node.get_opt_attr<mapnik::boolean_type>("unlock-image");
|
||||
if (unlock_image) put(sym, keys::unlock_image, *unlock_image);
|
||||
|
||||
std::string file = node.get_attr<std::string>("file");
|
||||
|
@ -1301,7 +1301,7 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& node)
|
|||
|
||||
// no_text - removed property in 2.1.x that used to have a purpose
|
||||
// before you could provide an expression with an empty string
|
||||
optional<mapnik::boolean> no_text = node.get_opt_attr<mapnik::boolean>("no-text");
|
||||
optional<mapnik::boolean_type> no_text = node.get_opt_attr<mapnik::boolean_type>("no-text");
|
||||
if (no_text)
|
||||
{
|
||||
MAPNIK_LOG_ERROR(shield_symbolizer) << "'no-text' is deprecated and will be removed in Mapnik 3.x, to create a ShieldSymbolizer without text just provide an element like: \"<ShieldSymbolizer ... />' '</>\"";
|
||||
|
@ -1509,7 +1509,7 @@ void map_parser::parse_raster_symbolizer(rule & rule, xml_node const & node)
|
|||
if (mesh_size) put<value_integer>(raster_sym, keys::mesh_size, *mesh_size);
|
||||
|
||||
// premultiplied status of image
|
||||
optional<mapnik::boolean> premultiplied = node.get_opt_attr<mapnik::boolean>("premultiplied");
|
||||
optional<mapnik::boolean_type> premultiplied = node.get_opt_attr<mapnik::boolean_type>("premultiplied");
|
||||
if (premultiplied) put(raster_sym, keys::premultiplied, *premultiplied);
|
||||
|
||||
bool found_colorizer = false;
|
||||
|
|
|
@ -75,7 +75,7 @@ memory_datasource::memory_datasource(parameters const& params)
|
|||
desc_(memory_datasource::name(),
|
||||
*params.get<std::string>("encoding","utf-8")),
|
||||
type_(datasource::Vector),
|
||||
bbox_check_(*params.get<boolean>("bbox_check", true)) {}
|
||||
bbox_check_(*params.get<boolean_type>("bbox_check", true)) {}
|
||||
|
||||
memory_datasource::~memory_datasource() {}
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ template boost::optional<std::string> parameters::get(std::string const& key, st
|
|||
template boost::optional<value_double> parameters::get(std::string const& key) const;
|
||||
template boost::optional<value_double> parameters::get(std::string const& key, value_double const& default_opt_value) const;
|
||||
|
||||
template boost::optional<boolean> parameters::get(std::string const& key) const;
|
||||
template boost::optional<boolean> parameters::get(std::string const& key, boolean const& default_opt_value) const;
|
||||
template boost::optional<boolean_type> parameters::get(std::string const& key) const;
|
||||
template boost::optional<boolean_type> parameters::get(std::string const& key, boolean_type const& default_opt_value) const;
|
||||
|
||||
template boost::optional<value_null> parameters::get(std::string const& key) const;
|
||||
template boost::optional<value_null> parameters::get(std::string const& key, value_null const& default_opt_value) const;
|
||||
|
|
|
@ -69,8 +69,8 @@ node_ptr layout_node::from_xml(xml_node const& xml)
|
|||
if (xml.has_attribute("dy")) set_property_from_xml<double>(n->dy, "dy", xml);
|
||||
if (xml.has_attribute("text-ratio")) set_property_from_xml<double>(n->text_ratio, "text-ratio", xml);
|
||||
if (xml.has_attribute("wrap-width")) set_property_from_xml<double>(n->wrap_width, "wrap-width", xml);
|
||||
if (xml.has_attribute("wrap-before")) set_property_from_xml<mapnik::boolean>(n->wrap_before, "wrap-before", xml);
|
||||
if (xml.has_attribute("rotate-displacement")) set_property_from_xml<mapnik::boolean>(n->rotate_displacement, "rotate-displacement", xml);
|
||||
if (xml.has_attribute("wrap-before")) set_property_from_xml<mapnik::boolean_type>(n->wrap_before, "wrap-before", xml);
|
||||
if (xml.has_attribute("rotate-displacement")) set_property_from_xml<mapnik::boolean_type>(n->rotate_displacement, "rotate-displacement", xml);
|
||||
if (xml.has_attribute("orientation")) set_property_from_xml<double>(n->orientation, "orientation", xml);
|
||||
if (xml.has_attribute("horizontal-alignment")) set_property_from_xml<horizontal_alignment_e>(n->halign, "horizontal-alignment", xml);
|
||||
if (xml.has_attribute("vertical-alignment")) set_property_from_xml<vertical_alignment_e>(n->valign, "vertical-alignment", xml);
|
||||
|
|
|
@ -114,11 +114,11 @@ void text_symbolizer_properties::placement_properties_from_xml(xml_node const& s
|
|||
if (min_padding_) minimum_padding = *min_padding_;
|
||||
optional<double> min_path_length_ = sym.get_opt_attr<double>("minimum-path-length");
|
||||
if (min_path_length_) minimum_path_length = *min_path_length_;
|
||||
optional<mapnik::boolean> avoid_edges_ = sym.get_opt_attr<mapnik::boolean>("avoid-edges");
|
||||
optional<mapnik::boolean_type> avoid_edges_ = sym.get_opt_attr<mapnik::boolean_type>("avoid-edges");
|
||||
if (avoid_edges_) avoid_edges = *avoid_edges_;
|
||||
optional<mapnik::boolean> allow_overlap_ = sym.get_opt_attr<mapnik::boolean>("allow-overlap");
|
||||
optional<mapnik::boolean_type> allow_overlap_ = sym.get_opt_attr<mapnik::boolean_type>("allow-overlap");
|
||||
if (allow_overlap_) allow_overlap = *allow_overlap_;
|
||||
optional<mapnik::boolean> largest_bbox_only_ = sym.get_opt_attr<mapnik::boolean>("largest-bbox-only");
|
||||
optional<mapnik::boolean_type> largest_bbox_only_ = sym.get_opt_attr<mapnik::boolean_type>("largest-bbox-only");
|
||||
if (largest_bbox_only_) largest_bbox_only = *largest_bbox_only_;
|
||||
}
|
||||
|
||||
|
@ -224,8 +224,8 @@ void text_layout_properties::from_xml(xml_node const &node)
|
|||
set_property_from_xml<double>(dy, "dy", node);
|
||||
set_property_from_xml<double>(text_ratio, "text-ratio", node);
|
||||
set_property_from_xml<double>(wrap_width, "wrap-width", node);
|
||||
set_property_from_xml<mapnik::boolean>(wrap_before, "wrap-before", node);
|
||||
set_property_from_xml<mapnik::boolean>(rotate_displacement, "rotate-displacement", node);
|
||||
set_property_from_xml<mapnik::boolean_type>(wrap_before, "wrap-before", node);
|
||||
set_property_from_xml<mapnik::boolean_type>(rotate_displacement, "rotate-displacement", node);
|
||||
set_property_from_xml<double>(orientation, "orientation", node);
|
||||
set_property_from_xml<vertical_alignment_e>(valign, "vertical-alignment", node);
|
||||
set_property_from_xml<horizontal_alignment_e>(halign, "horizontal-alignment", node);
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
namespace mapnik
|
||||
{
|
||||
|
||||
class boolean;
|
||||
class boolean_type;
|
||||
template <typename T>
|
||||
struct name_trait
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ struct name_trait
|
|||
DEFINE_NAME_TRAIT( double, "double")
|
||||
DEFINE_NAME_TRAIT( float, "float")
|
||||
DEFINE_NAME_TRAIT( unsigned, "unsigned")
|
||||
DEFINE_NAME_TRAIT( boolean, "boolean")
|
||||
DEFINE_NAME_TRAIT( boolean_type, "boolean_type")
|
||||
#ifdef BIGINT
|
||||
DEFINE_NAME_TRAIT( mapnik::value_integer, "long long" )
|
||||
#else
|
||||
|
@ -394,7 +394,7 @@ std::string xml_node::line_to_string() const
|
|||
#define compile_get_attr(T) template T xml_node::get_attr<T>(std::string const&) const; template T xml_node::get_attr<T>(std::string const&, T const&) const
|
||||
#define compile_get_value(T) template T xml_node::get_value<T>() const
|
||||
|
||||
compile_get_opt_attr(boolean);
|
||||
compile_get_opt_attr(boolean_type);
|
||||
compile_get_opt_attr(std::string);
|
||||
compile_get_opt_attr(unsigned);
|
||||
compile_get_opt_attr(mapnik::value_integer);
|
||||
|
|
|
@ -20,47 +20,47 @@ int main(int argc, char** argv)
|
|||
|
||||
// true
|
||||
params["bool"] = mapnik::value_integer(true);
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == true));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == true));
|
||||
|
||||
params["bool"] = "true";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == true));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == true));
|
||||
|
||||
params["bool"] = mapnik::value_integer(1);
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == true));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == true));
|
||||
|
||||
params["bool"] = "1";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == true));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == true));
|
||||
|
||||
params["bool"] = "True";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == true));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == true));
|
||||
|
||||
params["bool"] = "on";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == true));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == true));
|
||||
|
||||
params["bool"] = "yes";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == true));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == true));
|
||||
|
||||
// false
|
||||
params["bool"] = mapnik::value_integer(false);
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == false) );
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == false) );
|
||||
|
||||
params["bool"] = "false";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == false) );
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == false) );
|
||||
|
||||
params["bool"] = mapnik::value_integer(0);
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == false));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == false));
|
||||
|
||||
params["bool"] = "0";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == false));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == false));
|
||||
|
||||
params["bool"] = "False";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == false));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == false));
|
||||
|
||||
params["bool"] = "off";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == false));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == false));
|
||||
|
||||
params["bool"] = "no";
|
||||
BOOST_TEST( (params.get<mapnik::boolean>("bool") && *params.get<mapnik::boolean>("bool") == false));
|
||||
BOOST_TEST( (params.get<mapnik::boolean_type>("bool") && *params.get<mapnik::boolean_type>("bool") == false));
|
||||
|
||||
// strings
|
||||
params["string"] = "hello";
|
||||
|
|
Loading…
Add table
Reference in a new issue