blob: bf529197412654a5e8133e5f1abc95cea94269e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<%
const properties = locals.properties;
-%>
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
#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 in 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
|