OLD | NEW |
1 // This file is generated | 1 // This file is generated |
2 | 2 |
3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style license that can be | 4 // Use of this source code is governed by a BSD-style license that can be |
5 // found in the LICENSE file. | 5 // found in the LICENSE file. |
6 | 6 |
7 #ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imported_h | 7 #ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imported_h |
8 #define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imported_h | 8 #define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imported_h |
9 | 9 |
10 #include "{{config.protocol.package}}/Protocol.h" | 10 #include "{{config.protocol.package}}/Protocol.h" |
11 #include "{{config.imported.package}}/{{domain.domain}}.h" | 11 #include {{format_include(config.imported.header if config.imported.header else
"\"%s/%s.h\"" % (config.imported.package, domain.domain))}} |
12 | 12 |
13 {% for namespace in config.protocol.namespace %} | 13 {% for namespace in config.protocol.namespace %} |
14 namespace {{namespace}} { | 14 namespace {{namespace}} { |
15 {% endfor %} | 15 {% endfor %} |
16 {% for type in domain.types %} | 16 {% for type in domain.types %} |
17 {% if not (type.type == "object") or not ("properties" in type) or not (type
.exported) %}{% continue %}{% endif %} | 17 {% if not (type.type == "object") or not ("properties" in type) or not (type
.exported) %}{% continue %}{% endif %} |
18 | 18 |
19 template<> | 19 template<> |
20 struct ValueConversions<{{"::".join(config.imported.namespace)}}::{{domain.domai
n}}::API::{{type.id}}> { | 20 struct ValueConversions<{{"::".join(config.imported.namespace)}}::{{domain.domai
n}}::API::{{type.id}}> { |
21 static std::unique_ptr<{{"::".join(config.imported.namespace)}}::{{domain.do
main}}::API::{{type.id}}> parse(protocol::Value* value, ErrorSupport* errors) | 21 static std::unique_ptr<{{"::".join(config.imported.namespace)}}::{{domain.do
main}}::API::{{type.id}}> parse(protocol::Value* value, ErrorSupport* errors) |
(...skipping 20 matching lines...) Expand all Loading... |
42 return serialize(value.get()); | 42 return serialize(value.get()); |
43 } | 43 } |
44 }; | 44 }; |
45 {% endfor %} | 45 {% endfor %} |
46 | 46 |
47 {% for namespace in config.protocol.namespace %} | 47 {% for namespace in config.protocol.namespace %} |
48 } // namespace {{namespace}} | 48 } // namespace {{namespace}} |
49 {% endfor %} | 49 {% endfor %} |
50 | 50 |
51 #endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imp
orted_h) | 51 #endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_imp
orted_h) |
OLD | NEW |