13 HtmlObject::HtmlObject() : TObject(), fClass(
""), fID(
""), fStyle(
""), fContent(
""), fOtherAttribs(
"") {}
15 HtmlObject::~HtmlObject() {}
17 HtmlObject::HtmlObject(
const HtmlObject& other) :
22 fContent(other.fContent),
23 fOtherAttribs(other.fOtherAttribs) {}
27 HtmlObject::HtmlObject(TString
id, TString className, TString style) : fClass(className), fID(id), fStyle(style) {}
29 HtmlObject& HtmlObject::operator=(
const HtmlObject& other) {
30 if (
this == &other)
return *
this;
31 TObject::operator=(other);
32 fClass = other.fClass;
34 fStyle = other.fStyle;
35 fContent = other.fContent;
36 fOtherAttribs = other.fOtherAttribs;
40 TString HtmlObject::GetProperties()
const {
42 if (GetStyle().Length() > 0) { properties = properties +
" style=\"" + GetStyle() +
"\" "; }
43 if (GetClass().Length() > 0) { properties = properties +
" class=\"" + GetClass() +
"\" "; }
44 if (fOtherAttribs.Length() > 0) properties = properties + fOtherAttribs;
45 if (GetId().Length() > 0) { properties = properties +
" id=\"" + GetId() +
"\" "; }
50 TString res = Form(
"<%s", tag.Data());
51 res = res + GetProperties();
52 res = res +
">\n" + GetContent() +
"</" + tag +
">\n";
56 void HtmlObject::AddAtrib(TString name, TString value) {
57 fOtherAttribs = fOtherAttribs + Form(
" %s=\"%s\"", name.Data(), value.Data());
TString GetDefaultString(TString tag) const
virtual TString ToString() const =0