diff options
Diffstat (limited to 'src/mbgl/style/conversion/stringify.hpp')
-rw-r--r-- | src/mbgl/style/conversion/stringify.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mbgl/style/conversion/stringify.hpp b/src/mbgl/style/conversion/stringify.hpp index 3d188b6390..c5cd52093f 100644 --- a/src/mbgl/style/conversion/stringify.hpp +++ b/src/mbgl/style/conversion/stringify.hpp @@ -2,6 +2,8 @@ #include <mbgl/style/filter.hpp> #include <mbgl/style/property_value.hpp> +#include <mbgl/style/expression/value.hpp> +#include <mbgl/style/expression/formatted.hpp> #include <mbgl/util/enum.hpp> #include <mbgl/util/color.hpp> #include <mbgl/util/feature.hpp> @@ -129,6 +131,15 @@ void stringify(Writer& writer, const Filter& filter) { if (!filter.expression) writer.Null(); else stringify(writer, (*filter.expression)->serialize()); } + + +template <class Writer> +void stringify(Writer& writer, const expression::Formatted& v) { + // Convert to mbgl::Value and then use the existing stringify + // Serialization strategy for Formatted objects is to return the constant + // expression that would generate them. + stringify(writer, expression::ValueConverter<mbgl::Value>::fromExpressionValue(v)); +} template <class Writer> void stringify(Writer& writer, const Undefined&) { |