summaryrefslogtreecommitdiff
path: root/src/mbgl/style/expression/value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/expression/value.cpp')
-rw-r--r--src/mbgl/style/expression/value.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mbgl/style/expression/value.cpp b/src/mbgl/style/expression/value.cpp
index f089c918cd..4bac8116c2 100644
--- a/src/mbgl/style/expression/value.cpp
+++ b/src/mbgl/style/expression/value.cpp
@@ -34,6 +34,15 @@ type::Type typeOf(const Value& value) {
);
}
+std::string toString(const Value& value) {
+ return value.match(
+ [](const NullValue&) { return std::string(); },
+ [](const Color& c) { return c.stringify(); }, // avoid quoting
+ [](const std::string& s) { return s; }, // avoid quoting
+ [](const auto& v_) { return stringify(v_); }
+ );
+}
+
void writeJSON(rapidjson::Writer<rapidjson::StringBuffer>& writer, const Value& value) {
value.match(
[&] (const NullValue&) { writer.Null(); },