Fix bug with attributeList.empty()
Diffstat:
3 files changed, 8 insertions(+), 3 deletions(-)
@@ -4,7 +4,7 @@
include(cmake/prelude.cmake)
project(
hemplate
VERSION 0.1.8
VERSION 0.1.9
DESCRIPTION "Simple HTML template engine"
HOMEPAGE_URL "https://git.dimitrijedobrota.com/hemplate.git"
LANGUAGES CXX
@@ -62,7 +62,7 @@
public:
attributeList& set(const std::string& name);
attributeList& set(const std::string& name, const std::string& value);
bool empty() const { return m_attributes.empty(); }
bool empty() const;
void render(std::ostream& out) const override;
@@ -24,6 +24,12 @@
bool attribute::operator==(const attribute& rhs) const
return m_name == rhs.m_name && m_value == rhs.m_value;
}
bool attributeList::empty() const
{
return m_attributes.empty() && m_class.get_value().empty()
&& m_style.get_value().empty();
}
void attribute::render(std::ostream& out) const
{
out << get_name() << "=\"" << get_value() << "\"";
@@ -34,7 +40,6 @@
attributeList& attributeList::set(const std::string& name)
if (name != "class" && name != "style") m_attributes.emplace_back(name);
return *this;
}
attributeList& attributeList::set(const std::string& name,
const std::string& value)
{