static char const* get_name() { return Name.data(); }
};
class comment : public elementBoolean<tag<"">>
{
public:
comment() = default;
explicit comment(std::string text)
: elementBoolean(std::move(text))
{
}
void render(std::ostream& out) const override
{
if (get_data().empty())
{
tgl_state();
out << (get_state() ? "<!-- " : " -->");
}
else out << "<!-- " << get_data() << " -->";
}
};
class xml : public elementAtomic<tag<"xml">>
{
public:
explicit xml(std::string version = "1.0", std::string encoding = "UTF-8")
: m_version(std::move(version))
, m_encoding(std::move(encoding))
{
}
void render(std::ostream& out) const override
{
out << R"(<?xml version=")" << m_version << '"';
out << R"( encoding=")" << m_encoding << "\"?>";
}
private:
std::string m_version;
std::string m_encoding;
};
namespace html {
class doctype : public elementAtomic<tag<"doctype">>
{
public:
explicit doctype() = default;
void render(std::ostream& out) const override { out << "<!DOCTYPE html>"; }
};
using a = elementBoolean<tag<"a">>;
using abbr = elementBoolean<tag<"abbr">>;
using address = elementBoolean<tag<"address">>;