#include <itpp/base/binfile.h>
Inheritance diagram for itpp::bifstream:
Public Types | |
enum | endian { l_endian, b_endian } |
Definition of the endian data type. More... | |
Public Member Functions | |
bifstream (const std::string &name, endian e=b_endian) | |
Class constructor that opens a file and sets the endianity. | |
bifstream () | |
Class Constructor. | |
~bifstream () | |
Class Destructor. | |
void | open (const std::string &name, endian e=b_endian) |
Open a file for reading and set the endianity. | |
long | length () |
Returns the length in bytes of the file. | |
bifstream & | operator>> (char &a) |
Reads a char variable from the binary input file. | |
bifstream & | operator>> (class bin &a) |
Reads a bin variable from the binary input file. | |
bifstream & | operator>> (int &a) |
Reads an int variable from the binary input file. | |
bifstream & | operator>> (unsigned int &a) |
Reads an unsigned int variable from the binary input file. | |
bifstream & | operator>> (short int &a) |
Reads a short int variable from the binary input file. | |
bifstream & | operator>> (unsigned short int &a) |
Reads an unsigned short int variable from the binary input file. | |
bifstream & | operator>> (float &a) |
Reads a float variable from the binary input file. | |
bifstream & | operator>> (double &a) |
Reads a double variable from the binary input file. | |
bifstream & | operator>> (long int &a) |
Reads a long int variable from the binary input file. | |
bifstream & | operator>> (unsigned long int &a) |
Reads an unsigned long int variable from the binary input file. | |
bifstream & | operator>> (char *a) |
ACTION: ADD DOCUMENTATION FOR THIS MEMBER!!!!!!!!!! | |
bifstream & | operator>> (std::string &a) |
Reads a string variable from the binary input file. | |
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. |
Definition at line 166 of file binfile.h.
enum itpp::bfstream_base::endian [inherited] |
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)
itpp::bifstream::bifstream | ( | const std::string & | name, | |
endian | e = b_endian | |||
) |
Class constructor that opens a file and sets the endianity.
name | The name of the file to open | |
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 262 of file binfile.cpp.
itpp::bifstream::bifstream | ( | ) |
itpp::bifstream::~bifstream | ( | ) | [inline] |
void itpp::bifstream::open | ( | const std::string & | name, | |
endian | e = b_endian | |||
) |
Open a file for reading and set the endianity.
name | The name of the file to open | |
e | Defines the endianity of the class (default value is b_endian ) |
Definition at line 272 of file binfile.cpp.
References itpp::bfstream_base::endianity.
long itpp::bifstream::length | ( | ) |
bifstream & itpp::bifstream::operator>> | ( | char & | a | ) |
bifstream & itpp::bifstream::operator>> | ( | int & | a | ) |
Reads an int
variable from the binary input file.
Definition at line 302 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | unsigned int & | a | ) |
Reads an unsigned
int
variable from the binary input file.
Definition at line 317 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | short int & | a | ) |
Reads a short
int
variable from the binary input file.
Definition at line 332 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | unsigned short int & | a | ) |
Reads an unsigned
short
int
variable from the binary input file.
Definition at line 345 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | float & | a | ) |
Reads a float
variable from the binary input file.
Definition at line 358 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | double & | a | ) |
Reads a double
variable from the binary input file.
Definition at line 373 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | long int & | a | ) |
Reads a long
int
variable from the binary input file.
Definition at line 413 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | unsigned long int & | a | ) |
Reads an unsigned
long
int
variable from the binary input file.
Definition at line 428 of file binfile.cpp.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
bifstream & itpp::bifstream::operator>> | ( | char * | a | ) |
bifstream & itpp::bifstream::operator>> | ( | std::string & | a | ) |
endian itpp::bfstream_base::get_endianity | ( | ) | const [inline, inherited] |
Returns the endianity of the class (l_endian
or b_endian
).
Definition at line 78 of file binfile.h.
References itpp::bfstream_base::endianity.
endian itpp::bfstream_base::get_native_endianity | ( | ) | const [inline, inherited] |
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 itpp::bfstream_base::native_endianity.
Referenced by itpp::it_file::write_data_header().
void itpp::bfstream_base::set_endianity | ( | endian | e | ) | [inline, inherited] |
Set the endianity for this class.
Definition at line 90 of file binfile.h.
References itpp::bfstream_base::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, inherited] |
Set the endianity of this class to the native endianity for this computer architecture.
Definition at line 95 of file binfile.h.
References itpp::bfstream_base::endianity, and itpp::bfstream_base::native_endianity.
endian itpp::bfstream_base::endianity [protected, inherited] |
The endianity used by this class.
Definition at line 99 of file binfile.h.
Referenced by itpp::bfstream_base::bfstream_base(), itpp::bfstream_base::get_endianity(), itpp::bfstream::open(), open(), itpp::bofstream::open(), itpp::bfstream::open_readonly(), itpp::bfstream::operator<<(), itpp::bofstream::operator<<(), itpp::bfstream::operator>>(), operator>>(), itpp::it_ifile::read_data_header(), itpp::bfstream_base::set_endianity(), itpp::bfstream_base::set_native_endianity(), and itpp::it_file::write_data_header_here().
endian itpp::bfstream_base::native_endianity [protected, inherited] |
The native endianity for this computer architecture.
Definition at line 101 of file binfile.h.
Referenced by itpp::bfstream_base::bfstream_base(), itpp::bfstream_base::get_native_endianity(), itpp::bfstream::operator<<(), itpp::bofstream::operator<<(), itpp::bfstream::operator>>(), operator>>(), and itpp::bfstream_base::set_native_endianity().
Generated on Thu Apr 19 14:18:37 2007 for IT++ by Doxygen 1.5.1