Commit e5e60db1 authored by jan.koester's avatar jan.koester
Browse files

make life esaier

parent 271a12a6
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -715,7 +715,7 @@ const char* libhtmlpp::HtmlElement::getTagname(){
    return _CStr.data();
}

void libhtmlpp::HtmlElement::insertChild(libhtmlpp::Element* el){
void libhtmlpp::HtmlElement::insertChild(const libhtmlpp::Element* el){
    if(_childElement){
        remove(_childElement);
    }
@@ -737,7 +737,11 @@ void libhtmlpp::HtmlElement::insertChild(libhtmlpp::Element* el){
    _copy(_childElement,el);
}

void libhtmlpp::HtmlElement::appendChild(libhtmlpp::Element* el){
void libhtmlpp::HtmlElement::insertChild(const Element& el){
    insertChild(&el);
}

void libhtmlpp::HtmlElement::appendChild(const libhtmlpp::Element* el){
    if(_childElement){
        Element *curel=_childElement,*prev=nullptr;
        do{
@@ -772,6 +776,10 @@ void libhtmlpp::HtmlElement::appendChild(libhtmlpp::Element* el){
    }
}

void libhtmlpp::HtmlElement::appendChild(const Element& el){
    appendChild(&el);
}


bool libhtmlpp::HtmlElement::operator==(const HtmlElement *hel){
    if(_TagName.size() != hel->_TagName.size())
+4 −2
Original line number Diff line number Diff line
@@ -102,8 +102,10 @@ namespace libhtmlpp {

        int          getIntAtributte(const char* name);

        void         insertChild(Element* el);
        void         appendChild(Element* el);
        void         insertChild(const Element* el);
        void         insertChild(const Element& el);
        void         appendChild(const Element* el);
        void         appendChild(const Element& el);

        void         setTagname(const char *name);
        const char  *getTagname();