summaryrefslogtreecommitdiff
path: root/platform/android/src/style/conversion/types_string_values.hpp.ejs
blob: db90a614f59418195fc15996a60f8e02195e4afa (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 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