Loading src/html.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -2400,6 +2400,22 @@ libhtmlpp::Element* libhtmlpp::HtmlElement::firstChild() const { return _childElement.get(); } const std::string libhtmlpp::HtmlElement::Attributes::getKey() const { return std::string(_Key.begin(), _Key.end()); } const std::string libhtmlpp::HtmlElement::Attributes::getValue() const { return std::string(_Value.begin(), _Value.end()); } libhtmlpp::HtmlElement::Attributes* libhtmlpp::HtmlElement::Attributes::nextAttribute() const { return _nextAttr.get(); } const libhtmlpp::HtmlElement::Attributes* libhtmlpp::HtmlElement::firstAttribute() const { return _firstAttr.get(); } void libhtmlpp::HtmlElement::setAttribute(const std::string &name, const std::string &value) { Attributes* cattr = nullptr; Loading src/html.h +20 −8 Original line number Diff line number Diff line Loading @@ -140,22 +140,34 @@ namespace libhtmlpp { Element* firstChild() const; int getType() const; void remove(Element* el); static size_t parseElement(const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,size_t start,bool &termination); protected: std::unique_ptr<Element> _childElement=nullptr; struct Attributes { Attributes(); ~Attributes(); const std::string getKey() const; const std::string getValue() const; Attributes* nextAttribute() const; private: std::vector<char> _Key; std::vector<char> _Value; std::unique_ptr<Attributes> _nextAttr; friend class HtmlElement; friend void print(const Element& element, HtmlString &output,bool formated); friend void _copy(libhtmlpp::Element *dest,const libhtmlpp::Element *src); }; const Attributes* firstAttribute() const; int getType() const; void remove(Element* el); static size_t parseElement(const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,size_t start,bool &termination); protected: std::unique_ptr<Element> _childElement=nullptr; void _serialelize(const std::vector<char> &in); private: //if text tagname must be zero Loading Loading
src/html.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -2400,6 +2400,22 @@ libhtmlpp::Element* libhtmlpp::HtmlElement::firstChild() const { return _childElement.get(); } const std::string libhtmlpp::HtmlElement::Attributes::getKey() const { return std::string(_Key.begin(), _Key.end()); } const std::string libhtmlpp::HtmlElement::Attributes::getValue() const { return std::string(_Value.begin(), _Value.end()); } libhtmlpp::HtmlElement::Attributes* libhtmlpp::HtmlElement::Attributes::nextAttribute() const { return _nextAttr.get(); } const libhtmlpp::HtmlElement::Attributes* libhtmlpp::HtmlElement::firstAttribute() const { return _firstAttr.get(); } void libhtmlpp::HtmlElement::setAttribute(const std::string &name, const std::string &value) { Attributes* cattr = nullptr; Loading
src/html.h +20 −8 Original line number Diff line number Diff line Loading @@ -140,22 +140,34 @@ namespace libhtmlpp { Element* firstChild() const; int getType() const; void remove(Element* el); static size_t parseElement(const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,size_t start,bool &termination); protected: std::unique_ptr<Element> _childElement=nullptr; struct Attributes { Attributes(); ~Attributes(); const std::string getKey() const; const std::string getValue() const; Attributes* nextAttribute() const; private: std::vector<char> _Key; std::vector<char> _Value; std::unique_ptr<Attributes> _nextAttr; friend class HtmlElement; friend void print(const Element& element, HtmlString &output,bool formated); friend void _copy(libhtmlpp::Element *dest,const libhtmlpp::Element *src); }; const Attributes* firstAttribute() const; int getType() const; void remove(Element* el); static size_t parseElement(const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,size_t start,bool &termination); protected: std::unique_ptr<Element> _childElement=nullptr; void _serialelize(const std::vector<char> &in); private: //if text tagname must be zero Loading