BinaryFileWriter: interface for writing to binary files, bit by bit or byte by byte.  
 More...
#include <binary_file_writer.h>
BinaryFileWriter: interface for writing to binary files, bit by bit or byte by byte. 
Wraps an ofstream in binary mode. 
      
        
          | BinaryFileWriter::BinaryFileWriter | ( | const std::string & | fileName | ) |  | 
      
 
Constructs a new BinaryFileWriter by opening the given filename. 
- Parameters
- 
  
    | fileName | File to be opened. |  
 
 
 
      
        
          | BinaryFileWriter::~BinaryFileWriter | ( |  | ) |  | 
      
 
Destroys an BinaryFileWriter: the destructor here ensures that all remaining bits are written to the file before closing the file. 
If the file was already closed, nothing is done. 
 
 
      
        
          | void BinaryFileWriter::close | ( |  | ) |  | 
      
 
 
      
        
          | void BinaryFileWriter::writeBit | ( | bool | bit | ) |  | 
      
 
Writes the next bit of the file. 
- Parameters
- 
  
    | bit | The bit to be written. |  
 
 
 
      
        
          | void BinaryFileWriter::writeByte | ( | char | byte | ) |  | 
      
 
Writes the next byte to the file. 
- Parameters
- 
  
    | byte | The byte to be written. |  
 
 
 
  
  | 
        
          | void BinaryFileWriter::writeCurrentByte | ( |  | ) |  |  | private | 
 
Writes the current byte to the file. 
 
 
  
  | 
        
          | int BinaryFileWriter::currentBit_ |  | private | 
 
The current bit within the currentByte that is being written. 
 
 
  
  | 
        
          | char BinaryFileWriter::currentByte_ |  | private | 
 
The current byte to write bits into. 
 
 
The documentation for this class was generated from the following files: