00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00014 
00015 #ifndef FILE_BITWRITER_HPP_INCLUDED
00016 #define FILE_BITWRITER_HPP_INCLUDED
00017 
00018 #include <fstream>
00019 
00020 #include "bitwriter.hpp"
00021 
00033 class file_bitwriter : public bitwriter {
00034 
00035 public:
00038     file_bitwriter(const char *name) : s(name, std::ios::binary) { ; }
00039 
00040     ~file_bitwriter() { finalize(); }
00041 
00044     bool error() const { return !s; }
00045 
00046 protected:
00047     void write_next_byte(char c) { s.put(c); }
00048 
00049     std::ofstream s;
00050 };
00051 
00052 #endif // FILE_BITWRITER_HPP_INCLUDED