BTK  0.3dev.0
Open-source library to visualize/process biomechanical data
List of all members | Public Types | Public Member Functions
btk::mmfstream Class Reference

Provides an interface to read/write data from files as input/output streams. More...

#include <btkBinaryFileStream_mmfstream.h>

Public Types

typedef std::ios_base::failure failure
 

Public Member Functions

bool bad () const
 
void clear (std::ios_base::iostate state=std::ios_base::goodbit)
 
void close ()
 
bool eof () const
 
std::ios_base::iostate exceptions () const
 
void exceptions (std::ios_base::iostate except)
 
bool fail () const
 
bool good () const
 
bool is_open () const
 
 mmfstream ()
 
 mmfstream (const char *s, std::ios_base::openmode mode)
 
void open (const char *s, std::ios_base::openmode mode)
 
const mmfilebufrdbuf () const
 
std::ios_base::iostate rdstate () const
 
mmfstreamread (char *s, std::streamsize n)
 
mmfstreamseekg (std::streampos pos)
 
mmfstreamseekg (std::streamoff off, std::ios_base::seekdir dir)
 
mmfstreamseekp (std::streampos pos)
 
mmfstreamseekp (std::streamoff off, std::ios_base::seekdir dir)
 
void setstate (std::ios_base::iostate state)
 
std::streampos tellg ()
 
mmfstreamwrite (const char *s, std::streamsize n)
 

Detailed Description

Provides an interface to read/write data from files as input/output streams.

This class is a low level class used by the class BinaryFileStream when possible (if the OS supports it). It is not advised to use this class directly even if the direct access to the buffer can speed the reading of a file (compared to the use of the class BinaryFileStream).

Member Typedef Documentation

Exception thrown by the class mmfstream.

Constructor & Destructor Documentation

btk::mmfstream::mmfstream ( )
inline

Simple constructor which must use the method open() after.

btk::mmfstream::mmfstream ( const char *  s,
std::ios_base::openmode  mode 
)
inline

Constructor which opens the given filename s and options mode.

Member Function Documentation

bool btk::mmfstream::bad ( ) const
inline

Checks if badbit is set

void btk::mmfstream::clear ( std::ios_base::iostate  state = std::ios_base::goodbit)
inline

Sets a new value for the error control state.

void btk::mmfstream::close ( )
inline

Close file.

bool btk::mmfstream::eof ( ) const
inline

Checks if eofbit is set

std::ios_base::iostate btk::mmfstream::exceptions ( ) const
inline

Returns the exception mask

void btk::mmfstream::exceptions ( std::ios_base::iostate  except)
inline

Sets the exception mask

bool btk::mmfstream::fail ( ) const
inline

Checks if either failbit or badbit is set

bool btk::mmfstream::good ( ) const
inline

Checks if the state of the stream is good for i/o operations

bool btk::mmfstream::is_open ( ) const
inline

Check if a file is open.

void btk::mmfstream::open ( const char *  s,
std::ios_base::openmode  mode 
)
inline

Open file.

const mmfilebuf * btk::mmfstream::rdbuf ( ) const
inline

Gets the associated file buffer object.

std::ios_base::iostate btk::mmfstream::rdstate ( ) const
inline

Returns the current internal error state flags of the stream.

mmfstream & btk::mmfstream::read ( char *  s,
std::streamsize  n 
)

Reads a block of data

mmfstream & btk::mmfstream::seekg ( std::streampos  pos)
inline

Sets position of the get pointer

mmfstream & btk::mmfstream::seekg ( std::streamoff  off,
std::ios_base::seekdir  dir 
)
inline

Sets position of the get pointer

mmfstream & btk::mmfstream::seekp ( std::streampos  pos)
inline

Sets position of put pointer

mmfstream & btk::mmfstream::seekp ( std::streamoff  off,
std::ios_base::seekdir  dir 
)
inline

Sets position of put pointer

void btk::mmfstream::setstate ( std::ios_base::iostate  state)
inline

Sets error state flag

std::streampos btk::mmfstream::tellg ( )
inline

Gets position of the get pointer.

mmfstream & btk::mmfstream::write ( const char *  s,
std::streamsize  n 
)

Writes a block of data