4 #include <ctemplate/template.h>
16 std::stringstream*
const outbuf_;
19 virtual void Emit(
char c) { *outbuf_ << c; }
20 virtual void Emit(
const std::string& s) { *outbuf_ << s; }
21 virtual void Emit(
const char* s) { *outbuf_ << s; }
22 virtual void Emit(
const char* s,
size_t slen) { outbuf_->write(s, slen); }
25 inline bool ExpandTemplate(
const TemplateString& filename, Strip strip,
26 const TemplateDictionaryInterface *dictionary,
27 std::stringstream* output) {
28 if(output == NULL)
return false;
30 return mutable_default_template_cache()->ExpandWithData(filename, strip, dictionary, NULL, &e);