itpp::bfstream Class Reference
Base Module » IT++ File Format

Binary in/out-file Class. More...

`#include <itpp/base/binfile.h>`

Inheritance diagram for itpp::bfstream:

## Public Types

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

## Public Member Functions

| bfstream (const std::string &name, endian e=b_endian)
| Class constructor that opens a file and sets the endianity.
| bfstream ()
| Class Constructor.
| ~bfstream ()
| Class Destructor.
void | open (const std::string &name, bool trunc=false, endian e=b_endian)
| Open a file for reading and writing and set the endianity.
void | open_readonly (const std::string &name, endian e=b_endian)
| Open a file for reading only and set the endianity.
int | length ()
| Returns the length in bytes of the file.
bfstream & | operator<< (char a)
| Writes an char variable to the binary file.
bfstream & | operator<< (int8_t a)
| Writes a 8-bit signed integer variable to the binary file.
bfstream & | operator<< (uint8_t a)
| Writes a 8-bit unsigned integer variable to the binary file.
bfstream & | operator<< (int16_t a)
| Writes a 16-bit signed integer variable to the binary file.
bfstream & | operator<< (uint16_t a)
| Writes a 16-bit unsigned integer variable to the binary file.
bfstream & | operator<< (int32_t a)
| Writes a 32-bit signed integer variable to the binary file.
bfstream & | operator<< (uint32_t a)
| Writes a 32-bit unsigned integer variable to the binary file.
bfstream & | operator<< (int64_t a)
| Writes a 64-bit signed integer variable to the binary file.
bfstream & | operator<< (uint64_t a)
| Writes a 64-bit unsigned ingeger variable to the binary file.
bfstream & | operator<< (float a)
| Writes a float variable to the binary file.
bfstream & | operator<< (double a)
| Writes a double variable to the binary file.
bfstream & | operator<< (bin a)
| Writes a binary variable to the binary file.
bfstream & | operator<< (const char *a)
| Writes a char* string to the binary file.
bfstream & | operator<< (const std::string &a)
| Writes a string variable to the binary file.
bfstream & | operator>> (char &a)
| Reads a char variable from the binary file.
bfstream & | operator>> (int8_t &a)
| Reads a 8-bit signed integer variable from the binary file.
bfstream & | operator>> (uint8_t &a)
| Reads a 8-bit unsigned integer variable from the binary file.
bfstream & | operator>> (int16_t &a)
| Reads a 16-bit signed integer variable from the binary file.
bfstream & | operator>> (uint16_t &a)
| Reads a 16-bit unsigned integer variable from the binary file.
bfstream & | operator>> (int32_t &a)
| Reads a 32-bit signed integer variable from the binary file.
bfstream & | operator>> (uint32_t &a)
| Reads a 32-bit unsigned integer variable from the binary file.
bfstream & | operator>> (int64_t &a)
| Reads a 64-bit signed integer variable from the binary file.
bfstream & | operator>> (uint64_t &a)
| Reads a 64-bit unsigned ingeger variable from the binary file.
bfstream & | operator>> (float &a)
| Reads a float variable from the binary file.
bfstream & | operator>> (double &a)
| Reads a double variable from the binary file.
bfstream & | operator>> (bin &a)
| Reads a binary variable from the binary file.
bfstream & | operator>> (char *a)
| Reads a char* string from the binary file.
bfstream & | operator>> (std::string &a)
| Reads a string variable from the binary file.
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.
bool | is_open ()
| Open state.
void | open (const char *filename, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out|std::ios_base::binary)
| Method to open corresponding file.
void | close ()
| Method to close corresponding file.
Fstream_Binfile_Facade & | write (const char *c, std::streamsize n)
| Output multiple characters.
Fstream_Binfile_Facade & | put (const char c)
| Output single char.
std::streampos | tellp ()
| Get position.
Fstream_Binfile_Facade & | seekp (std::streampos pos)
| Set position.
Fstream_Binfile_Facade & | seekp (std::streamoff pos, std::ios_base::seekdir way)
| Set relative position.
Fstream_Binfile_Facade & | flush ()
| Flushes stream buffer.
std::streamsize | gcount () const
| Last extracted chars count.
int | get ()
| Get single char.
Fstream_Binfile_Facade & | get (char &c)
| Get single char.
Fstream_Binfile_Facade & | get (char *s, std::streamsize n)
| Get multiple chars to c-string and add trailing 0.
Fstream_Binfile_Facade & | get (char *s, std::streamsize n, char delim)
| Get multiple chars to c-string without trailing 0.
Fstream_Binfile_Facade & | getline (char *s, std::streamsize n)
| Get multiple chars to c-string without trailing 0.
Fstream_Binfile_Facade & | getline (char *s, std::streamsize n, char delim)
Fstream_Binfile_Facade & | ignore (std::streamsize n=1, int delim=EOF)
| Extract and ignore chars.
int | peek ()
| Peak single char from the top of the buffer.
Fstream_Binfile_Facade & | read (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.
Fstream_Binfile_Facade & | putback (char c)
| This method attempts to put back single char.
Fstream_Binfile_Facade & | unget ()
| Unget last extracted char.
std::streampos | tellg ()
| Get position.
Fstream_Binfile_Facade & | seekg (std::streampos pos)
| Set position.
Fstream_Binfile_Facade & | seekg (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.

## Protected Member Functions

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

## 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

Binary in/out-file Class.

Definition at line 603 of file binfile.h.

## Member Enumeration Documentation

## endian

enum itpp::bfstream_base::endian

inherited

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)

Definition at line 74 of file binfile.h.

## Constructor & Destructor Documentation

## bfstream() [1/2]

itpp::bfstream::bfstream | ( | const std::string & | name,
|  | endian | e = b_endian )

Class constructor that opens a file and sets the endianity.

Parameters

  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 353 of file binfile.cpp.

References itpp::bfstream_base::bfstream_base().

Referenced by operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), and operator>>().

## bfstream() [2/2]

itpp::bfstream::bfstream | ( |  | ) |

Class Constructor.

Definition at line 357 of file binfile.cpp.

References itpp::bfstream_base::bfstream_base().

## ~bfstream()

itpp::bfstream::~bfstream | ( |  | ) |

inline

Class Destructor.

Definition at line 620 of file binfile.h.

## Member Function Documentation

## open() [1/2]

void itpp::bfstream::open | ( | const std::string & | name,
|  | bool | trunc = false,
|  | endian | e = b_endian )

Open a file for reading and writing and set the endianity.

Parameters

  name | The name of the file to open
  trunc | Rewrite the file if it exists (default value is `false`)
  e | Defines the endianity of the class (default value is `b_endian` )

Definition at line 359 of file binfile.cpp.

References itpp::bfstream_base::native_endianity, itpp::binfile_details::Fstream_Binfile_Facade::open(), and itpp::bfstream_base::switch_endianity.

## open_readonly()

void itpp::bfstream::open_readonly | ( | const std::string & | name,
|  | endian | e = b_endian )

Open a file for reading only and set the endianity.

Parameters

  name | The name of the file to open
  e | Defines the endianity of the class (default value is `b_endian` )

Definition at line 373 of file binfile.cpp.

References itpp::bfstream_base::native_endianity, itpp::binfile_details::Fstream_Binfile_Facade::open(), and itpp::bfstream_base::switch_endianity.

## length()

int itpp::bfstream::length | ( |  | ) |

Returns the length in bytes of the file.

Definition at line 382 of file binfile.cpp.

References itpp::binfile_details::Fstream_Binfile_Facade::seekg(), and itpp::binfile_details::Fstream_Binfile_Facade::tellg().

## operator<<() [1/14]

bfstream & itpp::bfstream::operator<< | ( | char | a | ) |

Writes an char variable to the binary file.

Definition at line 392 of file binfile.cpp.

References bfstream(), and itpp::binfile_details::Fstream_Binfile_Facade::put().

## operator<<() [2/14]

bfstream & itpp::bfstream::operator<< | ( | int8_t | a | ) |

Writes a 8-bit signed integer variable to the binary file.

Definition at line 398 of file binfile.cpp.

References bfstream(), it_assert, and itpp::binfile_details::Fstream_Binfile_Facade::put().

## operator<<() [3/14]

bfstream & itpp::bfstream::operator<< | ( | uint8_t | a | ) |

Writes a 8-bit unsigned integer variable to the binary file.

Definition at line 405 of file binfile.cpp.

References bfstream(), it_assert, and itpp::binfile_details::Fstream_Binfile_Facade::put().

## operator<<() [4/14]

bfstream & itpp::bfstream::operator<< | ( | int16_t | a | ) |

Writes a 16-bit signed integer variable to the binary file.

Definition at line 412 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [5/14]

bfstream & itpp::bfstream::operator<< | ( | uint16_t | a | ) |

Writes a 16-bit unsigned integer variable to the binary file.

Definition at line 418 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [6/14]

bfstream & itpp::bfstream::operator<< | ( | int32_t | a | ) |

Writes a 32-bit signed integer variable to the binary file.

Definition at line 424 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [7/14]

bfstream & itpp::bfstream::operator<< | ( | uint32_t | a | ) |

Writes a 32-bit unsigned integer variable to the binary file.

Definition at line 430 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [8/14]

bfstream & itpp::bfstream::operator<< | ( | int64_t | a | ) |

Writes a 64-bit signed integer variable to the binary file.

Definition at line 436 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [9/14]

bfstream & itpp::bfstream::operator<< | ( | uint64_t | a | ) |

Writes a 64-bit unsigned ingeger variable to the binary file.

Definition at line 442 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [10/14]

bfstream & itpp::bfstream::operator<< | ( | float | a | ) |

Writes a float variable to the binary file.

Definition at line 448 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [11/14]

bfstream & itpp::bfstream::operator<< | ( | double | a | ) |

Writes a double variable to the binary file.

Definition at line 454 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [12/14]

bfstream & itpp::bfstream::operator<< | ( | bin | a | ) |

Writes a binary variable to the binary file.

Definition at line 460 of file binfile.cpp.

References bfstream(), itpp::bfstream_base::switch_endianity, and itpp::write_endian().

## operator<<() [13/14]

bfstream & itpp::bfstream::operator<< | ( | const char * | a | ) |

Writes a char* string to the binary file.

Definition at line 466 of file binfile.cpp.

References bfstream(), and itpp::binfile_details::Fstream_Binfile_Facade::write().

## operator<<() [14/14]

bfstream & itpp::bfstream::operator<< | ( | const std::string & | a | ) |

Writes a string variable to the binary file.

Definition at line 472 of file binfile.cpp.

References bfstream(), and itpp::binfile_details::Fstream_Binfile_Facade::write().

## operator>>() [1/14]

bfstream & itpp::bfstream::operator>> | ( | char & | a | ) |

Reads a char variable from the binary file.

Definition at line 479 of file binfile.cpp.

References bfstream(), and itpp::binfile_details::Fstream_Binfile_Facade::get().

## operator>>() [2/14]

bfstream & itpp::bfstream::operator>> | ( | int8_t & | a | ) |

Reads a 8-bit signed integer variable from the binary file.

Definition at line 485 of file binfile.cpp.

References bfstream(), itpp::binfile_details::Fstream_Binfile_Facade::get(), and it_assert.

## operator>>() [3/14]

bfstream & itpp::bfstream::operator>> | ( | uint8_t & | a | ) |

Reads a 8-bit unsigned integer variable from the binary file.

Definition at line 494 of file binfile.cpp.

References bfstream(), itpp::binfile_details::Fstream_Binfile_Facade::get(), and it_assert.

## operator>>() [4/14]

bfstream & itpp::bfstream::operator>> | ( | int16_t & | a | ) |

Reads a 16-bit signed integer variable from the binary file.

Definition at line 503 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [5/14]

bfstream & itpp::bfstream::operator>> | ( | uint16_t & | a | ) |

Reads a 16-bit unsigned integer variable from the binary file.

Definition at line 509 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [6/14]

bfstream & itpp::bfstream::operator>> | ( | int32_t & | a | ) |

Reads a 32-bit signed integer variable from the binary file.

Definition at line 515 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [7/14]

bfstream & itpp::bfstream::operator>> | ( | uint32_t & | a | ) |

Reads a 32-bit unsigned integer variable from the binary file.

Definition at line 521 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [8/14]

bfstream & itpp::bfstream::operator>> | ( | int64_t & | a | ) |

Reads a 64-bit signed integer variable from the binary file.

Definition at line 527 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [9/14]

bfstream & itpp::bfstream::operator>> | ( | uint64_t & | a | ) |

Reads a 64-bit unsigned ingeger variable from the binary file.

Definition at line 533 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [10/14]

bfstream & itpp::bfstream::operator>> | ( | float & | a | ) |

Reads a float variable from the binary file.

Definition at line 539 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [11/14]

bfstream & itpp::bfstream::operator>> | ( | double & | a | ) |

Reads a double variable from the binary file.

Definition at line 545 of file binfile.cpp.

References bfstream(), itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [12/14]

bfstream & itpp::bfstream::operator>> | ( | bin & | a | ) |

Reads a binary variable from the binary file.

Definition at line 551 of file binfile.cpp.

References bfstream(), it_assert, itpp::read_endian(), and itpp::bfstream_base::switch_endianity.

## operator>>() [13/14]

bfstream & itpp::bfstream::operator>> | ( | char * | a | ) |

Reads a char* string from the binary file.

Definition at line 561 of file binfile.cpp.

References bfstream(), and itpp::binfile_details::Fstream_Binfile_Facade::getline().

## operator>>() [14/14]

bfstream & itpp::bfstream::operator>> | ( | std::string & | a | ) |

Reads a string variable from the binary file.

Definition at line 567 of file binfile.cpp.

References bfstream(), and itpp::binfile_details::Fstream_Binfile_Facade::stream().

## get_endianity()

endian itpp::bfstream_base::get_endianity | ( |  | ) | const

inline inherited

Returns the endianity of the class.

Definition at line 88 of file binfile.h.

References native_endianity, and switch_endianity.

## get_native_endianity()

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

inline inherited

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.

References native_endianity.

## set_endianity()

void itpp::bfstream_base::set_endianity | ( | endian | e | ) |

inline inherited

Set the endianity for this class.

Definition at line 110 of file binfile.h.

References native_endianity, and switch_endianity.

## set_native_endianity()

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 121 of file binfile.h.

References switch_endianity.

## is_open()

bool itpp::binfile_details::Fstream_Binfile_Facade::is_open | ( |  | ) |

inline inherited

Open state.

Definition at line 367 of file binfile.h.

## open() [2/2]

void itpp::binfile_details::Fstream_Binfile_Facade::open | ( | const char * | filename,
|  | std::ios_base::openmode | mode = std::ios_base::in | std::ios_base::out | std::ios_base::binary )

inline inherited

Method to open corresponding file.

Definition at line 369 of file binfile.h.

Referenced by itpp::bfstream::open(), and itpp::bfstream::open_readonly().

## close()

void itpp::binfile_details::Fstream_Binfile_Facade::close | ( |  | ) |

inline inherited

Method to close corresponding file.

Definition at line 373 of file binfile.h.

## write()

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::write | ( | const char * | c,
|  | std::streamsize | n )

inline inherited

Output multiple characters.

Definition at line 376 of file binfile.h.

References write().

Referenced by itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), and write().

## put()

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::put | ( | const char | c | ) |

inline inherited

Output single char.

Definition at line 379 of file binfile.h.

References put().

Referenced by itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), itpp::bfstream::operator<<(), and put().

## tellp()

std::streampos itpp::binfile_details::Fstream_Binfile_Facade::tellp | ( |  | ) |

inline inherited

Get position.

Definition at line 382 of file binfile.h.

## seekp() [1/2]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::seekp | ( | std::streampos | pos | ) |

inline inherited

Set position.

Definition at line 384 of file binfile.h.

References seekp().

Referenced by seekp(), and seekp().

## seekp() [2/2]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::seekp | ( | std::streamoff | pos,
|  | std::ios_base::seekdir | way )

inline inherited

Set relative position.

Definition at line 387 of file binfile.h.

References seekp().

## flush()

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::flush | ( |  | ) |

inline inherited

Flushes stream buffer.

Definition at line 390 of file binfile.h.

References flush().

Referenced by flush().

## gcount()

std::streamsize itpp::binfile_details::Fstream_Binfile_Facade::gcount | ( |  | ) | const

inline inherited

Last extracted chars count.

Definition at line 392 of file binfile.h.

## get() [1/4]

int itpp::binfile_details::Fstream_Binfile_Facade::get | ( |  | ) |

inline inherited

Get single char.

Definition at line 394 of file binfile.h.

Referenced by get(), get(), get(), itpp::bfstream::operator>>(), itpp::bfstream::operator>>(), and itpp::bfstream::operator>>().

## get() [2/4]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::get | ( | char & | c | ) |

inline inherited

Get single char.

Definition at line 396 of file binfile.h.

References get().

## get() [3/4]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::get | ( | char * | s,
|  | std::streamsize | n )

inline inherited

Get multiple chars to c-string and add trailing 0.

Definition at line 398 of file binfile.h.

References get().

## get() [4/4]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::get | ( | char * | s,
|  | std::streamsize | n,
|  | char | delim )

inline inherited

Get multiple chars to c-string without trailing 0.

Definition at line 401 of file binfile.h.

References get().

## getline() [1/2]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::getline | ( | char * | s,
|  | std::streamsize | n )

inline inherited

Get multiple chars to c-string without trailing 0.

Definition at line 404 of file binfile.h.

References getline().

Referenced by getline(), and itpp::bfstream::operator>>().

## getline() [2/2]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::getline | ( | char * | s,
|  | std::streamsize | n,
|  | char | delim )

inline inherited

Definition at line 406 of file binfile.h.

## ignore()

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::ignore | ( | std::streamsize | n = 1,
|  | int | delim = EOF )

inline inherited

Extract and ignore chars.

Definition at line 409 of file binfile.h.

References ignore().

Referenced by ignore().

## peek()

int itpp::binfile_details::Fstream_Binfile_Facade::peek | ( |  | ) |

inline inherited

Peak single char from the top of the buffer.

Definition at line 412 of file binfile.h.

## read()

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::read | ( | char * | s,
|  | std::streamsize | n )

inline inherited

Read n chars from stream.

Definition at line 414 of file binfile.h.

References read().

Referenced by read().

## readsome()

std::streamsize itpp::binfile_details::Fstream_Binfile_Facade::readsome | ( | char * | s,
|  | std::streamsize | n )

inline inherited

Read up to n available chars from stream.

Definition at line 417 of file binfile.h.

## putback()

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::putback | ( | char | c | ) |

inline inherited

This method attempts to put back single char.

Definition at line 420 of file binfile.h.

References putback().

Referenced by putback().

## unget()

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::unget | ( |  | ) |

inline inherited

Unget last extracted char.

Definition at line 423 of file binfile.h.

References unget().

Referenced by unget().

## tellg()

std::streampos itpp::binfile_details::Fstream_Binfile_Facade::tellg | ( |  | ) |

inline inherited

Get position.

Definition at line 426 of file binfile.h.

Referenced by itpp::bfstream::length().

## seekg() [1/2]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::seekg | ( | std::streampos | pos | ) |

inline inherited

Set position.

Definition at line 428 of file binfile.h.

References seekg().

Referenced by itpp::bfstream::length(), seekg(), and seekg().

## seekg() [2/2]

Fstream_Binfile_Facade & itpp::binfile_details::Fstream_Binfile_Facade::seekg | ( | std::streamoff | pos,
|  | std::ios_base::seekdir | way )

inline inherited

Set relative position.

Definition at line 431 of file binfile.h.

References seekg().

## good()

bool itpp::binfile_details::Fstream_Binfile_Facade::good | ( |  | ) | const

inline inherited

This method returns true is stream state is good.

Definition at line 435 of file binfile.h.

## eof()

bool itpp::binfile_details::Fstream_Binfile_Facade::eof | ( |  | ) | const

inline inherited

This method returns true if eof is reached.

Definition at line 437 of file binfile.h.

## fail()

bool itpp::binfile_details::Fstream_Binfile_Facade::fail | ( |  | ) | const

inline inherited

This method returns true if either failbit or badbit is set.

Definition at line 439 of file binfile.h.

## bad()

bool itpp::binfile_details::Fstream_Binfile_Facade::bad | ( |  | ) | const

inline inherited

This method returns true if badbit is set.

Definition at line 441 of file binfile.h.

## operator!()

bool itpp::binfile_details::Fstream_Binfile_Facade::operator! | ( |  | ) | const

inline inherited

Unary not operator to check the stream state.

Definition at line 444 of file binfile.h.

## operator bool()

itpp::binfile_details::Fstream_Binfile_Facade::operator bool | ( |  | ) | const

inline inherited

Conversion to bool to validate stream state.

Definition at line 446 of file binfile.h.

## rdstate()

std::ios_base::iostate itpp::binfile_details::Fstream_Binfile_Facade::rdstate | ( |  | ) | const

inline inherited

Method to read stream state flags.

Definition at line 449 of file binfile.h.

## setstate()

void itpp::binfile_details::Fstream_Binfile_Facade::setstate | ( | std::ios_base::iostate | state | ) |

inline inherited

Method to set the stream state (combines already set flags with flags provide by user).

Definition at line 451 of file binfile.h.

## clear()

void itpp::binfile_details::Fstream_Binfile_Facade::clear | ( | std::ios_base::iostate | state = std::ios_base::goodbit | ) |

inline inherited

Method to set stream state (overwrites stream state flags).

Definition at line 453 of file binfile.h.

## exceptions() [1/2]

std::ios_base::iostate itpp::binfile_details::Fstream_Binfile_Facade::exceptions | ( |  | ) | const

inline inherited

Method to get the exceptions mask.

Definition at line 456 of file binfile.h.

## exceptions() [2/2]

void itpp::binfile_details::Fstream_Binfile_Facade::exceptions | ( | std::ios_base::iostate | except | ) |

inline inherited

Method to set the exceptions mask.

Definition at line 458 of file binfile.h.

## stream()

std::fstream * itpp::binfile_details::Fstream_Binfile_Facade::stream | ( |  | ) |

inline protected inherited

Access to internal stream for derived classes.

Definition at line 464 of file binfile.h.

Referenced by itpp::bfstream::operator>>().

## Member Data Documentation

## switch_endianity

bool itpp::bfstream_base::switch_endianity

protected inherited

Indicates if the endianity of the processed data needs to be changed.

Definition at line 125 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::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>>(), itpp::bifstream::operator>>(), set_endianity(), and set_native_endianity().

## native_endianity

endian itpp::bfstream_base::native_endianity

protected inherited

The native endianity for this computer architecture.

Definition at line 127 of file binfile.h.

Referenced by bfstream_base(), get_endianity(), get_native_endianity(), itpp::bfstream::open(), itpp::bifstream::open(), itpp::bofstream::open(), itpp::bfstream::open_readonly(), and set_endianity().

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

- itpp/base/binfile.h
- itpp/base/binfile.cpp

Generated on for IT++ by Doxygen 1.15.0