{% from "templates/macros.tmpl" import license, source_files_for_generated_file %}
{{ license() }}
{{source_files_for_generated_file(template_file, input_files)}}
#ifndef {{header_guard}}
#define {{header_guard}}
#include <memory>
{% if export == 'CORE_EXPORT' %}
#include "third_party/blink/renderer/core/core_export.h"
{% endif %}
#include "third_party/blink/renderer/core/dom/qualified_name.h"
namespace blink {
class {{namespace}}QualifiedName : public QualifiedName { };
namespace {{cpp_namespace}} {
{% set symbol_export = '%s ' % export if export else '' %}
// Namespace
{{symbol_export}}extern const WTF::AtomicString& {{namespace_prefix}}NamespaceURI;
// Tags
{% if generate_tag_enum %}
enum class {{namespace}}Tag {
// Explicitly give unknown a value of 0 as comparison to unknown happens a
// lot, and comparing to 0 saves an instruction on some hardware.
kUnknown = 0,
{% for tag in tags|sort(attribute='name') %}
{{tag|tag_symbol}},
{% endfor %}
};
{% endif %}
{% for tag in tags|sort(attribute='name') %}
{{symbol_export}}extern const blink::{{namespace}}QualifiedName& {{tag|symbol}}Tag;
{% endfor %}
// Attributes
{% for attr in attrs|sort(attribute='name') %}
{{symbol_export}}extern const blink::QualifiedName& {{attr|symbol}}Attr;
{% endfor %}
{% if tags %}
constexpr unsigned kTagsCount = {{tags|count}};
{{symbol_export}}std::unique_ptr<const {{namespace}}QualifiedName*[]> GetTags();
{% endif %}
constexpr unsigned kAttrsCount = {{attrs|count}};
{% if namespace != 'HTML' %}
std::unique_ptr<const QualifiedName*[]> GetAttrs();
{% endif %}
{% if generate_tag_enum %}
{{symbol_export}} extern const blink::{{namespace}}QualifiedName& TagToQualifiedName({{namespace}}Tag tag);
{% endif %}
void Init();
} // namespace {{cpp_namespace}}
} // namespace blink
#endif // {{header_guard}}