// makePage.cpp
#include "makePage.h"
using namespace std;
makePage::makePage(const std::string &title)
: _title(title) {}
void makePage::addParagraph(const std::string &text)
{
_text += std::string("
") + text;
}
std::string makePage::buildPage()
{
string page;
// build head
page += string("") + _title + string("");
// build body
page += string("");
page += string("") + _title + string("
");
page += _text;
page += string("");
return page;
}
#ifdef TEST_MAKEPAGE
#include
int main()
{
makePage mp("Testing makePage");
mp.addParagraph("This is the first paragraph. It only has two sentences");
mp.addParagraph("This is a second paragraph, with only one sentence.");
cout << "\n " << mp.buildPage();
cout << "\n\n";
}
#endif