IT++ Logo Newcom Logo

itpp::bfstream_base Class Reference
[IT++ File Format]

Base class for binary file classes. More...

#include <itpp/base/binfile.h>

Inheritance diagram for itpp::bfstream_base:

itpp::bfstream itpp::bifstream itpp::bofstream List of all members.

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.
endian get_endianity () const
 Returns the endianity of the class (l_endian or b_endian ).
endian get_native_endianity () const
 Returns the native endianity for this computer architecture (l_endian or b_endian ).
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

endian endianity
 The endianity used by this class.
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 54 of file binfile.h.


Member Enumeration Documentation

enum itpp::bfstream_base::endian

Definition of the endian data type.

The Endian defines the order in which multibyte numbers are stored in the file. The two orders are called "Little Endian" (l_endian ) and "Big Endian" (b_endian ).

"Little Endian" means that the low-order byte of the number is stored at the lowest adress (i.e. the little end comes first). "Big Endian" means that the high-order byte of the number is stored in memory at the highest address (i.e. the big end comes first)

Enumerator:
l_endian 
b_endian 

Definition at line 66 of file binfile.h.


Constructor & Destructor Documentation

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

Class Constructor.

Parameters:
e Defines 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 65 of file binfile.cpp.

References b_endian, endianity, l_endian, and native_endianity.


Member Function Documentation

endian itpp::bfstream_base::get_endianity (  )  const [inline]

Returns the endianity of the class (l_endian or b_endian ).

Definition at line 78 of file binfile.h.

References endianity.

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

Returns the native endianity for this computer architecture (l_endian or b_endian ).

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

Definition at line 85 of file binfile.h.

References native_endianity.

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

void itpp::bfstream_base::set_endianity ( endian  e  )  [inline]

Set the endianity for this class.

Definition at line 90 of file binfile.h.

References endianity.

Referenced by itpp::it_ifile::read_data_header(), and itpp::it_file::write_data_header_here().

void itpp::bfstream_base::set_native_endianity (  )  [inline]

Set the endianity of this class to the native endianity for this computer architecture.

Definition at line 95 of file binfile.h.

References endianity, and native_endianity.


Member Data Documentation

endian itpp::bfstream_base::endianity [protected]

The endianity used by this class.

Definition at line 99 of file binfile.h.

Referenced by bfstream_base(), get_endianity(), itpp::bfstream::open(), itpp::bifstream::open(), itpp::bofstream::open(), itpp::bfstream::open_readonly(), itpp::bfstream::operator<<(), itpp::bofstream::operator<<(), itpp::bfstream::operator>>(), itpp::bifstream::operator>>(), itpp::it_ifile::read_data_header(), set_endianity(), set_native_endianity(), and itpp::it_file::write_data_header_here().

endian itpp::bfstream_base::native_endianity [protected]

The native endianity for this computer architecture.

Definition at line 101 of file binfile.h.

Referenced by bfstream_base(), get_native_endianity(), itpp::bfstream::operator<<(), itpp::bofstream::operator<<(), itpp::bfstream::operator>>(), itpp::bifstream::operator>>(), and set_native_endianity().


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

Generated on Sat Aug 25 23:40:07 2007 for IT++ by Doxygen 1.5.2