[core] Initial implementation of 'format' expression
This commit is contained in:
@@ -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&) {
|
||||
|
||||
Reference in New Issue
Block a user