// HTML_Document.cpp: implementation of the HTML_Document class.
//
//////////////////////////////////////////////////////////////////////
#include "HTML_all.h"
#include "HTML_Document.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
HTML_Document::HTML_Document()
{
HTML_Tag* doc;
//initialize pointers
body = NULL;
head = NULL;
title = NULL;
//outer tag
doc = newTag("HTML");
//include
with nested
head = doc->newTag("HEAD");
title = head->newTag("TITLE");
//include
body = doc->newTag("BODY");
}
HTML_Document::~HTML_Document()
{
}
HTML_Document*
HTML_Document::setTitle(char * str)
{
title->overwrite(str);
return(this);
}
HTML_Element*
HTML_Document::insert(HTML_Element * obj)
{
if(body != NULL)
{
//if body defined, insert everything else in body
body->insert(obj);
}
else
{
//if body not defined, insert new objects in list as usually
objects.push_back(obj);
}
return(this);
}
HTML_Tag*
HTML_Document::getHead()
{
return(head);
}