Base class for binary file classes. More...
#include <itpp/base/binfile.h>
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. | |
endian | get_native_endianity () const |
Returns the native endianity for this computer architecture. | |
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. | |
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 of the endian data type.
The Endianness 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 address (i.e. the little end comes first). "Big Endian" means that the high-order byte of the number is stored in memory at the lowest address (i.e. the big end comes first)
itpp::bfstream_base::bfstream_base | ( | endian | e = b_endian | ) |
Class Constructor.
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 113 of file binfile.cpp.
References native_endianity, and switch_endianity.
|
inline |
|
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().
|
inline |
Set the endianity for this class.
Definition at line 110 of file binfile.h.
Referenced by itpp::it_ifile_old::read_data_header(), and itpp::it_file_old::write_data_header_here().
|
inline |
|
protected |
Indicates if the endianity of the processed data needs to be changed.
Definition at line 125 of file binfile.h.
Referenced by bfstream_base(), itpp::bfstream::open(), itpp::bifstream::open(), itpp::bofstream::open(), itpp::bfstream::open_readonly(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bofstream::operator<<(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), itpp::bifstream::operator>>(), itpp::bifstream::operator>>(), itpp::bifstream::operator>>(), itpp::bifstream::operator>>(), itpp::bifstream::operator>>(), itpp::bifstream::operator>>(), itpp::bifstream::operator>>(), itpp::bifstream::operator>>(), and itpp::bifstream::operator>>().
|
protected |
The native endianity for this computer architecture.
Definition at line 127 of file binfile.h.
Referenced by bfstream_base(), itpp::bfstream::open(), itpp::bifstream::open(), itpp::bofstream::open(), and itpp::bfstream::open_readonly().
Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.12.0