fast_buf\!

This commit is contained in:
gabime
2014-03-20 03:47:57 +02:00
parent d0f3b05f90
commit ba2b6aea25
12 changed files with 75 additions and 55 deletions

View File

@@ -13,9 +13,9 @@ public:
_flush_every(flush_every),
_write_counter(0) {};
void write(std::ofstream& ofs, const std::string& msg)
void write(std::ofstream& ofs, const bufpair_t& msg)
{
ofs.write(msg.c_str(), msg.size());
ofs.write(msg.first, msg.second);
if(++_write_counter == _flush_every)
{
ofs.flush();