IT++ Logo
Public Types | Public Member Functions | Protected Attributes | List of all members
itpp::bfstream_base Class Reference

Base class for binary file classesThis class serves as a base class for the classes bofstream, bifstream, and bfstream. It controls the endianity (i.e. the byte order of multibyte numbers on the disk) of the inhereted classes. More...

#include <itpp/base/binfile.h>

Inheritance diagram for itpp::bfstream_base:
itpp::bfstream itpp::bifstream itpp::bofstream

Public Types

enum  endian { l_endian, b_endian }
 Definition of the endian data type. More...
 

Public Member Functions

 bfstream_base (endian e=b_endian)
 Class Constructor. More...
 
endian get_endianity () const
 Returns the endianity of the class.
 
endian get_native_endianity () const
 Returns the native endianity for this computer architecture. More...
 
void set_endianity (endian e)
 Set the endianity for this class.
 
void set_native_endianity ()
 Set the endianity of this class to the native endianity for this computer architecture.
 

Protected Attributes

bool switch_endianity
 Indicates if the endianity of the processed data needs to be changed.
 
endian native_endianity
 The native endianity for this computer architecture.
 

Detailed Description

Base class for binary file classes

This class serves as a base class for the classes bofstream, bifstream, and bfstream. It controls the endianity (i.e. the byte order of multibyte numbers on the disk) of the inhereted classes.

Definition at line 59 of file binfile.h.

Constructor & Destructor Documentation

itpp::bfstream_base::bfstream_base ( endian  e = b_endian)

Class Constructor.

Parameters
eDefines the endianity of the class. Possible values are l_endian for little endian or b_endian for big endian. The default value is b_endian.

Definition at line 113 of file binfile.cpp.

References native_endianity, and switch_endianity.

Member Function Documentation

endian itpp::bfstream_base::get_native_endianity ( ) const
inline

Returns the native endianity for this computer architecture.

Intel processors use "Little Endian" byte ordering while e.g. Motorola processors use "Big Endian" byte ordering.

Definition at line 105 of file binfile.h.

Referenced by itpp::it_file_old::write_data_header().


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

Generated on Thu Jan 28 2016 07:31:15 for IT++ by Doxygen 1.8.9.1