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

file_bitwriter Class Reference
[bitio]

#include <file_bitwriter.hpp>

Inheritance diagram for file_bitwriter:

bitwriter List of all members.

Detailed Description

Specialization for files.

This class creates a file and writes to it. Unlike the stream_bitwriter it manages the file that it operates on, and thus hides the details of file access.

It adds the member function error(), which checks if there was an error creating the file in the constructor.

Definition at line 33 of file file_bitwriter.hpp.

Public Member Functions

 file_bitwriter (const char *name)
 Constructor.

bool error () const
 Check the state of the file.


Protected Member Functions

void write_next_byte (char c)
 Defines the method of writing a single byte of output.


Protected Attributes

std::ofstream s


Constructor & Destructor Documentation

file_bitwriter::file_bitwriter const char *  name  )  [inline]
 

Constructor.

Parameters:
name - the name of the file to create.

Definition at line 38 of file file_bitwriter.hpp.

00038 : s(name, std::ios::binary) { ; }


Member Function Documentation

bool file_bitwriter::error  )  const [inline, virtual]
 

Check the state of the file.

Returns:
true if a file error has occurred.

Reimplemented from bitwriter.

Definition at line 44 of file file_bitwriter.hpp.

Referenced by OctaneTester::RunCommand_Compress(), OctaneTester::RunCommand_Decompress(), and OctaneTester::RunCommand_SaveCompressor().

00044 { return !s; }

void file_bitwriter::write_next_byte char  c  )  [inline, protected, virtual]
 

Defines the method of writing a single byte of output.

Derived classes should implement this function.

Parameters:
c - the 8 bits to write to the output.

Implements bitwriter.

Definition at line 47 of file file_bitwriter.hpp.

00047 { s.put(c); }


The documentation for this class was generated from the following file:  
Generated on 20 May 2004 by doxygen 1.3.3