Loading src/html.cpp +17 −2 Changes for src/html.cpp: 17 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -627,7 +627,23 @@ void libhtmlpp::print(Element* el, HtmlElement* parent,std::string& output) { break; } } #include <iostream> libhtmlpp::HtmlElement * libhtmlpp::getRootNode(libhtmlpp::Element* el){ for(Element *curel=el; curel; curel=curel->nextElement()){ if(curel->getType()==HtmlEl){ if(strcmp(((libhtmlpp::HtmlElement*)curel)->getTagname(),"html")==0){ return (libhtmlpp::HtmlElement*)curel; } } } return nullptr; } const char * libhtmlpp::HtmlElement::getTagname(){ return _TagName.c_str(); } libhtmlpp::HtmlElement *libhtmlpp::HtmlElement::getElementbyID(const char *id){ for(Element *curel=this; curel; curel=curel->nextElement()){ if(curel->getType()==HtmlEl){ Loading @@ -638,7 +654,6 @@ libhtmlpp::HtmlElement *libhtmlpp::HtmlElement::getElementbyID(const char *id){ } const char *key=((HtmlElement*)curel)->getAtributte("id"); if(key && strcmp(key,id)==0){ std::cout << "hurray" << std::endl; return (HtmlElement*)curel; } } Loading src/html.h +4 −0 Changes for src/html.h: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -83,6 +83,8 @@ namespace libhtmlpp { void insertChild(Element* el); void appendChild(Element* el); const char *getTagname(); HtmlElement *getElementbyID(const char *id); protected: Loading Loading @@ -120,6 +122,8 @@ namespace libhtmlpp { void print(Element* el, HtmlElement* parent,std::string &output); HtmlElement *getRootNode(Element* el); class HtmlTable { public: HtmlTable(HtmlElement *element); Loading Loading
src/html.cpp +17 −2 Changes for src/html.cpp: 17 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -627,7 +627,23 @@ void libhtmlpp::print(Element* el, HtmlElement* parent,std::string& output) { break; } } #include <iostream> libhtmlpp::HtmlElement * libhtmlpp::getRootNode(libhtmlpp::Element* el){ for(Element *curel=el; curel; curel=curel->nextElement()){ if(curel->getType()==HtmlEl){ if(strcmp(((libhtmlpp::HtmlElement*)curel)->getTagname(),"html")==0){ return (libhtmlpp::HtmlElement*)curel; } } } return nullptr; } const char * libhtmlpp::HtmlElement::getTagname(){ return _TagName.c_str(); } libhtmlpp::HtmlElement *libhtmlpp::HtmlElement::getElementbyID(const char *id){ for(Element *curel=this; curel; curel=curel->nextElement()){ if(curel->getType()==HtmlEl){ Loading @@ -638,7 +654,6 @@ libhtmlpp::HtmlElement *libhtmlpp::HtmlElement::getElementbyID(const char *id){ } const char *key=((HtmlElement*)curel)->getAtributte("id"); if(key && strcmp(key,id)==0){ std::cout << "hurray" << std::endl; return (HtmlElement*)curel; } } Loading
src/html.h +4 −0 Changes for src/html.h: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -83,6 +83,8 @@ namespace libhtmlpp { void insertChild(Element* el); void appendChild(Element* el); const char *getTagname(); HtmlElement *getElementbyID(const char *id); protected: Loading Loading @@ -120,6 +122,8 @@ namespace libhtmlpp { void print(Element* el, HtmlElement* parent,std::string &output); HtmlElement *getRootNode(Element* el); class HtmlTable { public: HtmlTable(HtmlElement *element); Loading