summaryrefslogtreecommitdiff
path: root/platform/android/src/style/conversion/types_string_values.hpp.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/style/conversion/types_string_values.hpp.ejs')
-rw-r--r--platform/android/src/style/conversion/types_string_values.hpp.ejs48
1 files changed, 48 insertions, 0 deletions
diff --git a/platform/android/src/style/conversion/types_string_values.hpp.ejs b/platform/android/src/style/conversion/types_string_values.hpp.ejs
new file mode 100644
index 0000000000..db90a614f5
--- /dev/null
+++ b/platform/android/src/style/conversion/types_string_values.hpp.ejs
@@ -0,0 +1,48 @@
+<%
+ const properties = locals.properties;
+-%>
+// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
+#pragma once
+
+#include <mbgl/style/types.hpp>
+
+#include <string>
+#include <stdexcept>
+
+namespace mbgl {
+namespace android {
+namespace conversion {
+
+ //visibility
+ inline std::string toString(mbgl::style::VisibilityType value) {
+ switch (value) {
+ case mbgl::style::VisibilityType::Visible:
+ return "visible";
+ break;
+ case mbgl::style::VisibilityType::None:
+ return "none";
+ break;
+ default:
+ throw std::runtime_error("Not implemented");
+ }
+ }
+
+<% for (const property of properties) { -%>
+ //<%- property.name %>
+ inline std::string toString(mbgl::style::<%- propertyNativeType(property) %> value) {
+ switch (value) {
+<% for (const value of property.values) { -%>
+ case mbgl::style::<%- propertyNativeType(property) %>::<%- camelize(value) %>:
+ return "<%- value %>";
+ break;
+<% } -%>
+ default:
+ throw std::runtime_error("Not implemented");
+ }
+ }
+
+<% } -%>
+
+} // namespace conversion
+} // namespace android
+} // namespace mbgl \ No newline at end of file