#include #include #include #include "debug.h" namespace xstream { dater::dater(std::streambuf* sb, const std::string& f, const char sep, const bool wn): _sb(sb),date(f),separator(sep),write_next(wn) { LOG("dater::dater format="<pubsync(); } int dater::overflow(const int c){ LOG("dater::overflow ("<sputc(c); if(separator==c){ write_next=true; } return cret; } std::streamsize dater::xsputn(char *buffer, std::streamsize n){ LOG("dater::xsputn "<sputn(beg,w); written+=w; beg=end+1; write_next=true; } } return written; } void dater::write_date() { LOG("dater::write_date"); //XXX check return code std::string d=date.now(); _sb->sputn(d.c_str(), d.size()); write_next=false; } dater::~dater(){ LOG("dater::~dater"); _sb->pubsync(); } }//namespace xstream