Loading src/html.cpp +10 −9 Changes for src/html.cpp: 10 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -264,9 +264,6 @@ void libhtmlpp::HtmlString::_serialelize(sys::array<char> in, HtmlElement **out) }else if (i == (in.length()-1)){ *out = new HtmlElement(in.substr(s, i-s).c_str()); break; }else if (in.substr(i,(i+3)-i) == "!--") { (*out) = new HtmlComment(in.substr(in.length() - 1).c_str()); return; } } Loading Loading @@ -332,10 +329,14 @@ void libhtmlpp::HtmlString::_parseTree(){ for (size_t i = 0; i < _Data.size(); ++i) { switch (_Data[i]) { case HTMLTAG_OPEN: if (_Data.substr(i, 4) != "<!--") { ++opentag; } break; case HTMLTAG_CLOSE: if (_Data.substr(i - 2, 3) != "-->") { ++closetag; } break; default: break; Loading Loading @@ -363,13 +364,16 @@ void libhtmlpp::HtmlString::_parseTree(){ for(size_t ii=0; ii<_Data.size(); ++ii){ switch(_Data[ii]){ case HTMLTAG_OPEN: if (_Data.substr(ii, 4) != "<!--") { open = true; _HTable[ip][0] = ii; } break; case HTMLTAG_TERMINATE: _HTable[ip][1]=ii; break; case HTMLTAG_CLOSE: if (_Data.substr(ii - 2, 3) != "-->") { if (!open) { excp[HTMLException::Error] << "HtmlString: parseTree parse Error couldn't fid opentag"; throw excp; Loading @@ -377,6 +381,7 @@ void libhtmlpp::HtmlString::_parseTree(){ _HTable[ip][2] = ii; ++ip; open = false; } break; default: break; Loading Loading @@ -513,18 +518,14 @@ libhtmlpp::HtmlElement::HtmlAttributes::~HtmlAttributes() { delete _nextAttr; } libhtmlpp::HtmlComment::HtmlComment(const char* comment) : HtmlElement("!--") { libhtmlpp::HtmlText::HtmlText() { } libhtmlpp::HtmlComment::~HtmlComment() { libhtmlpp::HtmlText::~HtmlText() { } const char* libhtmlpp::HtmlComment::printHtmlElement() { return _Cstr.c_str(); }; libhtmlpp::HtmlTable::HtmlTable() : HtmlElement("table") { } Loading src/html.h +8 −6 Changes for src/html.h: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -127,14 +127,16 @@ namespace libhtmlpp { HtmlElement *_RootNode; }; class HtmlComment : public HtmlElement { class HtmlText{ public: HtmlComment(const char *comment); ~HtmlComment(); const char* printHtmlElement(); HtmlText(); ~HtmlText(); void insertTextBefore(); void insertTextAfter(); private: sys::array<char> _Cstr; sys::array<char> _Comment; sys::array<char> _Text; bool _Before; HtmlElement *_Element; }; class HtmlDivLayer : public HtmlElement { Loading Loading
src/html.cpp +10 −9 Changes for src/html.cpp: 10 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -264,9 +264,6 @@ void libhtmlpp::HtmlString::_serialelize(sys::array<char> in, HtmlElement **out) }else if (i == (in.length()-1)){ *out = new HtmlElement(in.substr(s, i-s).c_str()); break; }else if (in.substr(i,(i+3)-i) == "!--") { (*out) = new HtmlComment(in.substr(in.length() - 1).c_str()); return; } } Loading Loading @@ -332,10 +329,14 @@ void libhtmlpp::HtmlString::_parseTree(){ for (size_t i = 0; i < _Data.size(); ++i) { switch (_Data[i]) { case HTMLTAG_OPEN: if (_Data.substr(i, 4) != "<!--") { ++opentag; } break; case HTMLTAG_CLOSE: if (_Data.substr(i - 2, 3) != "-->") { ++closetag; } break; default: break; Loading Loading @@ -363,13 +364,16 @@ void libhtmlpp::HtmlString::_parseTree(){ for(size_t ii=0; ii<_Data.size(); ++ii){ switch(_Data[ii]){ case HTMLTAG_OPEN: if (_Data.substr(ii, 4) != "<!--") { open = true; _HTable[ip][0] = ii; } break; case HTMLTAG_TERMINATE: _HTable[ip][1]=ii; break; case HTMLTAG_CLOSE: if (_Data.substr(ii - 2, 3) != "-->") { if (!open) { excp[HTMLException::Error] << "HtmlString: parseTree parse Error couldn't fid opentag"; throw excp; Loading @@ -377,6 +381,7 @@ void libhtmlpp::HtmlString::_parseTree(){ _HTable[ip][2] = ii; ++ip; open = false; } break; default: break; Loading Loading @@ -513,18 +518,14 @@ libhtmlpp::HtmlElement::HtmlAttributes::~HtmlAttributes() { delete _nextAttr; } libhtmlpp::HtmlComment::HtmlComment(const char* comment) : HtmlElement("!--") { libhtmlpp::HtmlText::HtmlText() { } libhtmlpp::HtmlComment::~HtmlComment() { libhtmlpp::HtmlText::~HtmlText() { } const char* libhtmlpp::HtmlComment::printHtmlElement() { return _Cstr.c_str(); }; libhtmlpp::HtmlTable::HtmlTable() : HtmlElement("table") { } Loading
src/html.h +8 −6 Changes for src/html.h: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -127,14 +127,16 @@ namespace libhtmlpp { HtmlElement *_RootNode; }; class HtmlComment : public HtmlElement { class HtmlText{ public: HtmlComment(const char *comment); ~HtmlComment(); const char* printHtmlElement(); HtmlText(); ~HtmlText(); void insertTextBefore(); void insertTextAfter(); private: sys::array<char> _Cstr; sys::array<char> _Comment; sys::array<char> _Text; bool _Before; HtmlElement *_Element; }; class HtmlDivLayer : public HtmlElement { Loading