Merge branch 'master' into mapnik-geometry
This commit is contained in:
commit
c3284aa958
3 changed files with 22 additions and 1 deletions
|
@ -40,7 +40,7 @@ namespace mapnik
|
||||||
// fwd declare
|
// fwd declare
|
||||||
class boolean_type;
|
class boolean_type;
|
||||||
|
|
||||||
using value_holder_base = util::variant<value_null,value_integer,value_double,std::string>;
|
using value_holder_base = util::variant<value_null,value_integer,value_double,std::string,value_bool>;
|
||||||
|
|
||||||
struct value_holder : value_holder_base
|
struct value_holder : value_holder_base
|
||||||
{
|
{
|
||||||
|
@ -87,6 +87,12 @@ template MAPNIK_DECL
|
||||||
boost::optional<value_integer> parameters::get(std::string const& key,
|
boost::optional<value_integer> parameters::get(std::string const& key,
|
||||||
value_integer const& default_opt_value) const;
|
value_integer const& default_opt_value) const;
|
||||||
|
|
||||||
|
template MAPNIK_DECL
|
||||||
|
boost::optional<value_bool> parameters::get(std::string const& key) const;
|
||||||
|
template MAPNIK_DECL
|
||||||
|
boost::optional<value_bool> parameters::get(std::string const& key,
|
||||||
|
value_bool const& default_opt_value) const;
|
||||||
|
|
||||||
template MAPNIK_DECL
|
template MAPNIK_DECL
|
||||||
boost::optional<mapnik::boolean_type> parameters::get(std::string const& key) const;
|
boost::optional<mapnik::boolean_type> parameters::get(std::string const& key) const;
|
||||||
template MAPNIK_DECL
|
template MAPNIK_DECL
|
||||||
|
|
|
@ -55,6 +55,18 @@ struct extract_value
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct extract_value<value_bool>
|
||||||
|
{
|
||||||
|
static inline boost::optional<value_bool> do_extract_from_string(std::string const& source)
|
||||||
|
{
|
||||||
|
bool result;
|
||||||
|
if (mapnik::util::string2bool(source, result))
|
||||||
|
return boost::optional<value_bool>(result);
|
||||||
|
return boost::optional<value_bool>();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct extract_value<mapnik::boolean_type>
|
struct extract_value<mapnik::boolean_type>
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,9 @@ 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) const;
|
||||||
template boost::optional<value_double> parameters::get(std::string const& key, value_double const& default_opt_value) const;
|
template boost::optional<value_double> parameters::get(std::string const& key, value_double const& default_opt_value) const;
|
||||||
|
|
||||||
|
template boost::optional<value_bool> parameters::get(std::string const& key) const;
|
||||||
|
template boost::optional<value_bool> parameters::get(std::string const& key, value_bool 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) const;
|
||||||
template boost::optional<boolean_type> parameters::get(std::string const& key, boolean_type const& default_opt_value) const;
|
template boost::optional<boolean_type> parameters::get(std::string const& key, boolean_type const& default_opt_value) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue