size_t WriteCb(void* buffer_p, size_t size, size_t nmemb) throw() { write_stream_ << std::string ((char*) buffer_p, size * nmemb); if (write_stream_.fail()) return 0; return size * nmemb; }
size_t HeaderCb(void* buffer_p, size_t size, size_t nmemb) throw() { header_stream_ << std::string ((char*) buffer_p, size * nmemb); if (header_stream_.fail()) return 0; return size * nmemb; }
bool seek(size_t v, int origin) { if (origin == SEEK_CUR) stream.seekp(v, std::ios_base::cur); else if (origin == SEEK_END) stream.seekp(v, std::ios_base::end); else stream.seekp(v, std::ios_base::beg); return !stream.fail(); }