15 #ifndef SHAKA_EMBEDDED_JS_DOM_ELEMENT_H_ 16 #define SHAKA_EMBEDDED_JS_DOM_ELEMENT_H_ 19 #include <unordered_map> 56 return !attributes_.empty();
60 const std::string& name)
const;
61 void SetAttribute(
const std::string& key,
const std::string& value);
63 const std::string& value);
65 bool HasAttributeNS(
const std::string& ns,
const std::string& name)
const;
72 using attr_iter = std::vector<Member<Attr>>::iterator;
73 using const_attr_iter = std::vector<Member<Attr>>::const_iterator;
75 attr_iter FindAttribute(
const std::string& name);
76 const_attr_iter FindAttribute(
const std::string& name)
const {
77 return const_cast<Element*
>(
this)->FindAttribute(name);
80 attr_iter FindAttributeNS(
const std::string& ns,
const std::string& name);
81 const_attr_iter FindAttributeNS(
const std::string& ns,
82 const std::string& name)
const {
83 return const_cast<Element*
>(
this)->FindAttributeNS(ns, name);
86 std::vector<Member<Attr>> attributes_;
98 #endif // SHAKA_EMBEDDED_JS_DOM_ELEMENT_H_
bool HasAttribute(const std::string &name) const
void RemoveAttributeNS(const std::string &ns, const std::string &attr)
std::vector< RefPtr< Attr > > attributes() const
bool has_attributes() const
optional< std::string > NodeValue() const override
const optional< std::string > namespace_uri
bool HasAttributeNS(const std::string &ns, const std::string &name) const
virtual void RemoveAttribute(const std::string &attr)
optional< std::string > TextContent() const override
Element(RefPtr< Document > document, const std::string &local_name, optional< std::string > namespace_uri, optional< std::string > namespace_prefix)
void Trace(memory::HeapTracer *tracer) const override
RefPtr< Document > document() const
optional< std::string > GetAttribute(const std::string &name) const
std::string node_name() const override
void SetAttributeNS(const std::string &ns, const std::string &key, const std::string &value)
void SetAttribute(const std::string &key, const std::string &value)
const std::string local_name
optional< std::string > GetAttributeNS(const std::string &ns, const std::string &name) const
std::string tag_name() const
const optional< std::string > namespace_prefix