IT++ Logo
Public Member Functions | Protected Member Functions | List of all members
itpp::binfile_details::Ifstream_Binfile_Facade Class Reference

Ifstream Interface Facade for Binary Streams.This class implements std::ofstream facade to make ITPP binary file streams exportable from dll. This facade implements basic functionality only. It does not provide an access to the following stream facilities (all of them are useless for binary streams) More...

#include <itpp/base/binfile.h>

Inheritance diagram for itpp::binfile_details::Ifstream_Binfile_Facade:
itpp::bifstream

Public Member Functions

 Ifstream_Binfile_Facade ()
 Default Constructor.
 
 Ifstream_Binfile_Facade (const char *filename, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::binary)
 Constructor from filename and stream mode.
 
bool is_open ()
 Open state.
 
void open (const char *filename, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::binary)
 Method to open corresponding file.
 
void close ()
 Method to close corresponding file.
 
std::streamsize gcount () const
 Last extracted chars count.
 
int get ()
 Get single char.
 
Ifstream_Binfile_Facadeget (char &c)
 Get single char.
 
Ifstream_Binfile_Facadeget (char *s, std::streamsize n)
 Get multiple chars to c-string and add trailing 0.
 
Ifstream_Binfile_Facadeget (char *s, std::streamsize n, char delim)
 Get multiple chars to c-string without trailing 0.
 
Ifstream_Binfile_Facadegetline (char *s, std::streamsize n)
 Get multiple chars to c-string without trailing 0.
 
Ifstream_Binfile_Facadegetline (char *s, std::streamsize n, char delim)
 
Ifstream_Binfile_Facadeignore (std::streamsize n=1, int delim=EOF)
 Extract and ignore chars.
 
int peek ()
 Peak single char from the top of the buffer.
 
Ifstream_Binfile_Facaderead (char *s, std::streamsize n)
 Read n chars from stream.
 
std::streamsize readsome (char *s, std::streamsize n)
 Read up to n available chars from stream.
 
Ifstream_Binfile_Facadeputback (char c)
 This method attempts to put back single char.
 
Ifstream_Binfile_Facadeunget ()
 Unget last extracted char.
 
std::streampos tellg ()
 Get position.
 
Ifstream_Binfile_Facadeseekg (std::streampos pos)
 Set position.
 
Ifstream_Binfile_Facadeseekg (std::streamoff pos, std::ios_base::seekdir way)
 Set relative position.
 
bool good () const
 This method returns true is stream state is good.
 
bool eof () const
 This method returns true if eof is reached.
 
bool fail () const
 This method returns true if either failbit or badbit is set.
 
bool bad () const
 This method returns true if badbit is set.
 
bool operator! () const
 Unary not operator to check the stream state.
 
 operator bool () const
 Conversion to bool to validate stream state.
 
std::ios_base::iostate rdstate () const
 Method to read stream state flags.
 
void setstate (std::ios_base::iostate state)
 Method to set the stream state (combines already set flags with flags provide by user)
 
void clear (std::ios_base::iostate state=std::ios_base::goodbit)
 Method to set stream state (overwrites stream state flags)
 
std::ios_base::iostate exceptions () const
 Method to get the exceptions mask.
 
void exceptions (std::ios_base::iostate except)
 Method to set the exceptions mask.
 
virtual ~Ifstream_Binfile_Facade ()
 Destructor.
 

Protected Member Functions

std::ifstream * stream ()
 Access to internal stream for derived classes.
 

Detailed Description

Ifstream Interface Facade for Binary Streams.

This class implements std::ofstream facade to make ITPP binary file streams exportable from dll. This facade implements basic functionality only. It does not provide an access to the following stream facilities (all of them are useless for binary streams)

  1. locale(imbue) It does not make sence to change locale settings for binary streams. Changes in formatting or char conversion can result in compatibility problems with resulting binary files
  2. stream buffer (rdbuf). DLL and application can use different versions of runtime , so it would be dangerous to use buffer created in DLL in application context
  3. stream extraction operators. It is assumed that stream extraction is defined in binary stream classes derived from this class
  4. formatting interface (copyfmt, fill, narrow, widen). This is not relevant to binary streams
  5. ios_base-related stuff. These things are excluded since they provide unnecessarily formatting facilities.

Definition at line 240 of file binfile.h.


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:35 for IT++ by Doxygen 1.8.2