Loading src/html.cpp +22 −7 Changes for src/html.cpp: 22 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -448,6 +448,14 @@ libhtmlpp::HtmlElement::~HtmlElement(){ } } void libhtmlpp::HtmlElement::setTagname(const char* name){ _TagName=name; } const char* libhtmlpp::HtmlElement::getTagname(){ return _TagName.c_str(); } void libhtmlpp::HtmlElement::insertChild(libhtmlpp::Element* el){ if(_childElement){ delete _childElement; Loading Loading @@ -640,11 +648,6 @@ libhtmlpp::HtmlElement * libhtmlpp::getRootNode(libhtmlpp::Element* el){ 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 Loading @@ -754,10 +757,22 @@ libhtmlpp::HtmlTable::Row & libhtmlpp::HtmlTable::operator[](size_t pos){ return *curel; } void libhtmlpp::HtmlTable::insert(libhtmlpp::Element* element){ void libhtmlpp::HtmlTable::insert(libhtmlpp::HtmlElement* element){ element->setTagname("table"); for(Row *crow=_firstRow; crow; crow=crow->_nextRow){ HtmlElement *hrow= new HtmlElement("tr"); for(Column *ccol=crow->_firstColumn; ccol; ccol=ccol->_nextColumn ){ HtmlElement *hcol= new HtmlElement("td"); hcol->appendChild(ccol->Data.parse()); hrow->appendChild(hcol); } element->appendChild(hrow); } } void libhtmlpp::HtmlTable::parse(libhtmlpp::Element* element){ void libhtmlpp::HtmlTable::parse(libhtmlpp::HtmlElement* element){ } void libhtmlpp::HtmlTable::setHeader(int count,...){ Loading src/html.h +3 −2 Changes for src/html.h: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ namespace libhtmlpp { void insertChild(Element* el); void appendChild(Element* el); void setTagname(const char *name); const char *getTagname(); HtmlElement *getElementbyID(const char *id); Loading Loading @@ -220,8 +221,8 @@ namespace libhtmlpp { Row& operator<<(const Row row); Row& operator[](size_t pos); void insert(Element *element); void parse(Element *element); void insert(HtmlElement *element); void parse(HtmlElement *element); void setHeader(int count,...); void deleteRow(size_t pos); Loading Loading
src/html.cpp +22 −7 Changes for src/html.cpp: 22 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -448,6 +448,14 @@ libhtmlpp::HtmlElement::~HtmlElement(){ } } void libhtmlpp::HtmlElement::setTagname(const char* name){ _TagName=name; } const char* libhtmlpp::HtmlElement::getTagname(){ return _TagName.c_str(); } void libhtmlpp::HtmlElement::insertChild(libhtmlpp::Element* el){ if(_childElement){ delete _childElement; Loading Loading @@ -640,11 +648,6 @@ libhtmlpp::HtmlElement * libhtmlpp::getRootNode(libhtmlpp::Element* el){ 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 Loading @@ -754,10 +757,22 @@ libhtmlpp::HtmlTable::Row & libhtmlpp::HtmlTable::operator[](size_t pos){ return *curel; } void libhtmlpp::HtmlTable::insert(libhtmlpp::Element* element){ void libhtmlpp::HtmlTable::insert(libhtmlpp::HtmlElement* element){ element->setTagname("table"); for(Row *crow=_firstRow; crow; crow=crow->_nextRow){ HtmlElement *hrow= new HtmlElement("tr"); for(Column *ccol=crow->_firstColumn; ccol; ccol=ccol->_nextColumn ){ HtmlElement *hcol= new HtmlElement("td"); hcol->appendChild(ccol->Data.parse()); hrow->appendChild(hcol); } element->appendChild(hrow); } } void libhtmlpp::HtmlTable::parse(libhtmlpp::Element* element){ void libhtmlpp::HtmlTable::parse(libhtmlpp::HtmlElement* element){ } void libhtmlpp::HtmlTable::setHeader(int count,...){ Loading
src/html.h +3 −2 Changes for src/html.h: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ namespace libhtmlpp { void insertChild(Element* el); void appendChild(Element* el); void setTagname(const char *name); const char *getTagname(); HtmlElement *getElementbyID(const char *id); Loading Loading @@ -220,8 +221,8 @@ namespace libhtmlpp { Row& operator<<(const Row row); Row& operator[](size_t pos); void insert(Element *element); void parse(Element *element); void insert(HtmlElement *element); void parse(HtmlElement *element); void setHeader(int count,...); void deleteRow(size_t pos); Loading