Octane v1.01.20 - The Open Compression Toolkit for C++ http://octane.sourceforge.net/
Homepage | Main | Modules | Class Hierarchy | Compound List | File List | Compound Members | Related Pages

bitio/file_bitwriter.hpp

Go to the documentation of this file.
00001 //
00002 // file_bitwriter  --  file bitwriter
00003 //
00004 // Copyright (c) 2003 by Jørgen Ibsen / Jibz
00005 // All Rights Reserved
00006 //
00007 // http://www.ibsensoftware.com/
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
 
Generated on 20 May 2004 by doxygen 1.3.3