1 // vim: set expandtab tabstop=4 shiftwidth=4:
6 using std::stringstream;
15 Translate::Translate(const string& name): Fallback(name) {
17 cerr << "In Translate::Translate(name = '" << name << "');" << endl;
21 Translate::Translate(const string& name, const Hash& attrs): Fallback(name, attrs) {
23 cerr << "In Translate::Translate(name = '" << name
24 << "', attrs = {" /* TODO << attrs */ << "});" << endl;
28 Translate::Translate(const string& name, const Hash& attrs, Widget& content):
29 Fallback(name, attrs, content) {
30 // FIXME - this->content.push_back(content);
32 cerr << "In Translate::Translate(name = '" << name
33 << "', attrs = {" /* TODO << attrs */
34 << "}, content = {" /* TODO << content */ << "});" << endl;
38 Translate::Translate(const string& name, Widget& content, const Hash& attrs):
39 Fallback(name, content, attrs) {
40 // FIXME - this->content.push_back(content);
42 cerr << "In Translate::Translate(name = '" << name
43 << "', content = {" /* TODO << content */
44 << "}, attrs = {" /* TODO << attrs */ << "});" << endl;
48 Translate::~Translate(void) {
50 cerr << "In Translate destructor." << endl;
54 string Translate::render(HIT& tpl) {
56 if (false /* TODO tpl.exists(name, '')*/) {
58 a["CONTENT"] = renderContent(tpl);
59 out << tpl.parse(name, attrs /* TODO ,"", "" */);
62 for (Hash::iterator i = attrs.begin(); i != attrs.end(); i++) {
63 out << " " << i->first << "=\"" << i->second << "\"";
65 string c = renderContent(tpl);
69 out << ">" << c << "</" << name << ">";