1 // vim: set expandtab tabstop=4 shiftwidth=4:
6 using std::stringstream;
15 Container::Container(void) {
17 cerr << "In Container::Container();" << endl;
21 Container::Container(const Hash& attrs): Widget(attrs) {
23 cerr << "In Container::Container(attrs = {" /* TODO << attrs */ << "});" << endl;
27 Container::Container(const Hash& attrs, Widget& content): Widget(attrs) {
28 // FIXME - this->content.push_back(content);
30 cerr << "In Container::Container(attrs = {" /* TODO << attrs */
31 << "}, content = {" /* TODO << content */ << "});" << endl;
35 Container::Container(Widget& content, const Hash& attrs): Widget(attrs) {
36 // FIXME - this->content.push_back(content);
38 cerr << "In Container::Container(content = {" /* TODO << content */
39 << "}, attrs = {" /* TODO << attrs */ << "});" << endl;
43 Container::~Container(void) {
45 cerr << "In Container destructor." << endl;
50 string Container::render(HIT& hit) {
52 out << "container = attributes: [";
53 for (Hash::iterator i = attrs.begin(); i != --attrs.end(); i++) {
54 out << i->first << ": " << i->second << ", ";
56 Hash::iterator i = --attrs.end();
57 out << i->first << ": " << i->second << "] ";
58 out << "content: [" << renderContent(hit) << "]";
63 string Container::renderContent(HIT& hit) {
65 for (Content::iterator i = content.begin(); i != content.end(); i++) {
66 out << i->render(hit);