File Class Reference

High-level input stream operations on files with bit precision. More...

#include <file.h>

List of all members.

Public Member Functions

 File ()
virtual void setPath (const std::string &path)=0
 Sets the path to the file.
virtual const std::string & path () const =0
 Returns the path to the file.
virtual void open ()=0
 Opens stream.
virtual void close ()=0
 Closes stream.
virtual void clear ()=0
 Clears the file error flags.
virtual void read (char *s, int64_t size)=0
 Extracts bits from stream.
virtual void seekg (int64_t off, std::ios_base::seekdir dir)=0
 Offsets the position.
virtual int64_t tellg ()=0
 Returns the current stream position.
virtual int64_t size ()=0
 Returns the size of the file.
virtual bool good ()=0
 Checks if data can be recovered from the stream.

Protected Attributes

char _bitPosition

Detailed Description

High-level input stream operations on files with bit precision.

The class is implemented as an adaptor for a std::ifstream instance that reimplements common operation with bit precision instead of byte precision


Constructor & Destructor Documentation


Member Function Documentation

virtual void File::clear ( ) [pure virtual]

Clears the file error flags.

virtual void File::close ( ) [pure virtual]

Closes stream.

virtual bool File::good ( ) [pure virtual]

Checks if data can be recovered from the stream.

virtual void File::open ( ) [pure virtual]

Opens stream.

virtual const std::string& File::path ( ) const [pure virtual]

Returns the path to the file.

virtual void File::read ( char *  s,
int64_t  size 
) [pure virtual]

Extracts bits from stream.

Puts the result in a byte array already allocated the result is right aligned and zero padded

virtual void File::seekg ( int64_t  off,
std::ios_base::seekdir  dir 
) [pure virtual]

Offsets the position.

Parameters:
offOffset to apply in bits.
dirWhere to start from to apply the offset. begin (std::ios_base::beg), current (std::ios_base::cur) or end (std::ios_base::end).
virtual void File::setPath ( const std::string &  path) [pure virtual]

Sets the path to the file.

virtual int64_t File::size ( ) [pure virtual]

Returns the size of the file.

virtual int64_t File::tellg ( ) [pure virtual]

Returns the current stream position.


Member Data Documentation

char File::_bitPosition [protected]

The documentation for this class was generated from the following file: