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

The old (version 2) IT++ file format reading class. More...

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

Inheritance diagram for itpp::it_ifile_old:

## Public Member Functions

| it_ifile_old ()
| Constructor.
| it_ifile_old (const std::string &name)
| Constructor. Calls open().
virtual | ~it_ifile_old ()
| Destructor.
void | open (const std::string &name)
| Open a file. The file must exist.
virtual void | close ()
| Close a file.
bfstream & | low_level ()
| Returns pointer to the underlying `bfstream` used.
bool | read_check_file_header ()
| Reads and checks the file data header. Returns true if the header is valid and false otherwise.
void | read_data_header (data_header &h)
| Read the data header and return the result in the variable `h`.
void | low_level_read (char &x)
| Read a char value at the current file pointer position.
void | low_level_read (bin &x)
| Read a binary value at the current file pointer position.
void | low_level_read (short &x)
| Read a short value at the current file pointer position.
void | low_level_read (int &x)
| Read an integer value at the current file pointer position.
void | low_level_read (float &x)
| Read a float value at the current file pointer position.
void | low_level_read (double &x)
| Read a double value at the current file pointer position.
void | low_level_read (std::complex< float > &x)
| Read a float complex value at the current file pointer position.
void | low_level_read (std::complex< double > &x)
| Read a double complex value at the current file pointer position.
void | low_level_read_lo (vec &v)
| Read a vector of float values at the current file pointer position.
void | low_level_read_hi (vec &v)
| Read a vector of double values at the current file pointer position.
void | low_level_read (ivec &v)
| Read a vector of integer values at the current file pointer position.
void | low_level_read (bvec &v)
| Read a vector of binary values at the current file pointer position.
void | low_level_read_lo (cvec &v)
| Read a vector of float complex values at the current file pointer position.
void | low_level_read_hi (cvec &v)
| Read a vector of double complex values at the current file pointer position.
void | low_level_read (std::string &str)
| Read a string at the current file pointer position.
void | low_level_read_lo (mat &m)
| Read a matrix of float values at the current file pointer position.
void | low_level_read_hi (mat &m)
| Read a matrix of double values at the current file pointer position.
void | low_level_read (imat &m)
| Read a matrix of integer values at the current file pointer position.
void | low_level_read (bmat &m)
| Read a matrix of binary values at the current file pointer position.
void | low_level_read_lo (cmat &m)
| Read a matrix of float complex values at the current file pointer position.
void | low_level_read_hi (cmat &m)
| Read a matrix of double complex values at the current file pointer position.
void | low_level_read_lo (Array< float > &v)
| Read an Array of float values at the current file pointer position.
void | low_level_read_lo (Array< double > &v)
| Read an Array of float values at the current file pointer position.
void | low_level_read_hi (Array< double > &v)
| Read an Array of double values at the current file pointer position.
void | low_level_read (Array< int > &v)
| Read an Array of integer values at the current file pointer position.
void | low_level_read (Array< bin > &v)
| Read an Array of binary values at the current file pointer position.
void | low_level_read_lo (Array< std::complex< float > > &v)
| Read an Array of float complex values at the current file pointer position.
void | low_level_read_lo (Array< std::complex< double > > &v)
| Read an Array of float complex values at the current file pointer position.
void | low_level_read_hi (Array< std::complex< double > > &v)
| Read an Array of double complex values at the current file pointer position.
bool | seek (const std::string &name)
| Find the variable `name`.
bool | seek (int n)
| Find the variable number `n`.
void | info (std::string &name, std::string &type, int &bytes)
| Get information about the current variable.

## Protected Attributes

bfstream | s
| Protected binary file stream.

## Static Protected Attributes

static char | file_magic [4] = { 'I', 'T', '+', '+' }
| ACTION: Add documentation.
static char | file_version = 2
| ACTION: Add documentation.

## Detailed Description

The old (version 2) IT++ file format reading class.

Warning
  This class is deprecated and will be removed in future.

Definition at line 707 of file itfile.h.

## Constructor & Destructor Documentation

## it_ifile_old() [1/2]

itpp::it_ifile_old::it_ifile_old | ( |  | ) |

Constructor.

Definition at line 1879 of file itfile.cpp.

## it_ifile_old() [2/2]

itpp::it_ifile_old::it_ifile_old | ( | const std::string & | name | ) |

explicit

Constructor. Calls open().

Definition at line 1883 of file itfile.cpp.

References open().

## ~it_ifile_old()

virtual itpp::it_ifile_old::~it_ifile_old | ( |  | ) |

inline virtual

Destructor.

Definition at line 715 of file itfile.h.

## Member Function Documentation

## open()

void itpp::it_ifile_old::open | ( | const std::string & | name | ) |

Open a file. The file must exist.

Definition at line 1888 of file itfile.cpp.

References itpp::exist(), it_assert, it_error, read_check_file_header(), and s.

Referenced by it_ifile_old().

## close()

void itpp::it_ifile_old::close | ( |  | ) |

virtual

Close a file.

Reimplemented in itpp::it_file_old.

Definition at line 1901 of file itfile.cpp.

References s.

## low_level()

bfstream & itpp::it_ifile_old::low_level | ( |  | ) |

inline

Returns pointer to the underlying `bfstream` used.

Definition at line 721 of file itfile.h.

References s.

## read_check_file_header()

bool itpp::it_ifile_old::read_check_file_header | ( |  | ) |

Reads and checks the file data header. Returns true if the header is valid and false otherwise.

Definition at line 1965 of file itfile.cpp.

References itpp::it_file_base_old::file_magic, itpp::it_file_base_old::file_version, itpp::it_file_base_old::file_header::magic, s, and itpp::it_file_base_old::file_header::version.

Referenced by itpp::it_file_old::open(), and open().

## read_data_header()

void itpp::it_ifile_old::read_data_header | ( | data_header & | h | ) |

Read the data header and return the result in the variable `h`.

Definition at line 1975 of file itfile.cpp.

References itpp::it_file_base_old::data_header::block_bytes, itpp::it_file_base_old::data_header::data_bytes, itpp::it_file_base_old::data_header::endianity, itpp::it_file_base_old::data_header::hdr_bytes, itpp::it_file_base_old::data_header::name, s, and itpp::it_file_base_old::data_header::type.

Referenced by info(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::operator>>(), itpp::it_file_old::remove(), seek(), seek(), and itpp::it_file_old::write_data_header().

## low_level_read() [1/15]

void itpp::it_ifile_old::low_level_read | ( | char & | x | ) |

Read a char value at the current file pointer position.

Definition at line 1995 of file itfile.cpp.

References s.

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

## low_level_read() [2/15]

void itpp::it_ifile_old::low_level_read | ( | bin & | x | ) |

Read a binary value at the current file pointer position.

Definition at line 2000 of file itfile.cpp.

References s.

## low_level_read() [3/15]

void itpp::it_ifile_old::low_level_read | ( | short & | x | ) |

Read a short value at the current file pointer position.

Definition at line 2005 of file itfile.cpp.

References s.

## low_level_read() [4/15]

void itpp::it_ifile_old::low_level_read | ( | int & | x | ) |

Read an integer value at the current file pointer position.

Definition at line 2010 of file itfile.cpp.

References s.

## low_level_read() [5/15]

void itpp::it_ifile_old::low_level_read | ( | float & | x | ) |

Read a float value at the current file pointer position.

Definition at line 2017 of file itfile.cpp.

References s.

## low_level_read() [6/15]

void itpp::it_ifile_old::low_level_read | ( | double & | x | ) |

Read a double value at the current file pointer position.

Definition at line 2022 of file itfile.cpp.

References s.

## low_level_read() [7/15]

void itpp::it_ifile_old::low_level_read | ( | std::complex< float > & | x | ) |

Read a float complex value at the current file pointer position.

Definition at line 2027 of file itfile.cpp.

References s.

## low_level_read() [8/15]

void itpp::it_ifile_old::low_level_read | ( | std::complex< double > & | x | ) |

Read a double complex value at the current file pointer position.

Definition at line 2035 of file itfile.cpp.

References s.

## low_level_read_lo() [1/8]

void itpp::it_ifile_old::low_level_read_lo | ( | vec & | v | ) |

Read a vector of float values at the current file pointer position.

Definition at line 2043 of file itfile.cpp.

References s.

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

## low_level_read_hi() [1/6]

void itpp::it_ifile_old::low_level_read_hi | ( | vec & | v | ) |

Read a vector of double values at the current file pointer position.

Definition at line 2056 of file itfile.cpp.

References s.

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

## low_level_read() [9/15]

void itpp::it_ifile_old::low_level_read | ( | ivec & | v | ) |

Read a vector of integer values at the current file pointer position.

Definition at line 2069 of file itfile.cpp.

References s.

## low_level_read() [10/15]

void itpp::it_ifile_old::low_level_read | ( | bvec & | v | ) |

Read a vector of binary values at the current file pointer position.

Definition at line 2081 of file itfile.cpp.

References s.

## low_level_read_lo() [2/8]

void itpp::it_ifile_old::low_level_read_lo | ( | cvec & | v | ) |

Read a vector of float complex values at the current file pointer position.

Definition at line 2091 of file itfile.cpp.

References s.

## low_level_read_hi() [2/6]

void itpp::it_ifile_old::low_level_read_hi | ( | cvec & | v | ) |

Read a vector of double complex values at the current file pointer position.

Definition at line 2105 of file itfile.cpp.

References s.

## low_level_read() [11/15]

void itpp::it_ifile_old::low_level_read | ( | std::string & | str | ) |

Read a string at the current file pointer position.

Definition at line 2119 of file itfile.cpp.

References s.

## low_level_read_lo() [3/8]

void itpp::it_ifile_old::low_level_read_lo | ( | mat & | m | ) |

Read a matrix of float values at the current file pointer position.

Definition at line 2133 of file itfile.cpp.

References s.

## low_level_read_hi() [3/6]

void itpp::it_ifile_old::low_level_read_hi | ( | mat & | m | ) |

Read a matrix of double values at the current file pointer position.

Definition at line 2147 of file itfile.cpp.

References s.

## low_level_read() [12/15]

void itpp::it_ifile_old::low_level_read | ( | imat & | m | ) |

Read a matrix of integer values at the current file pointer position.

Definition at line 2161 of file itfile.cpp.

References s.

## low_level_read() [13/15]

void itpp::it_ifile_old::low_level_read | ( | bmat & | m | ) |

Read a matrix of binary values at the current file pointer position.

Definition at line 2174 of file itfile.cpp.

References s.

## low_level_read_lo() [4/8]

void itpp::it_ifile_old::low_level_read_lo | ( | cmat & | m | ) |

Read a matrix of float complex values at the current file pointer position.

Definition at line 2185 of file itfile.cpp.

References s.

## low_level_read_hi() [4/6]

void itpp::it_ifile_old::low_level_read_hi | ( | cmat & | m | ) |

Read a matrix of double complex values at the current file pointer position.

Definition at line 2200 of file itfile.cpp.

References s.

## low_level_read_lo() [5/8]

void itpp::it_ifile_old::low_level_read_lo | ( | Array< float > & | v | ) |

Read an Array of float values at the current file pointer position.

Definition at line 2216 of file itfile.cpp.

References s, itpp::Array< T >::set_size(), and itpp::Array< T >::size().

## low_level_read_lo() [6/8]

void itpp::it_ifile_old::low_level_read_lo | ( | Array< double > & | v | ) |

Read an Array of float values at the current file pointer position.

Definition at line 2229 of file itfile.cpp.

References s, itpp::Array< T >::set_size(), and itpp::Array< T >::size().

## low_level_read_hi() [5/6]

void itpp::it_ifile_old::low_level_read_hi | ( | Array< double > & | v | ) |

Read an Array of double values at the current file pointer position.

Definition at line 2242 of file itfile.cpp.

References s, itpp::Array< T >::set_size(), and itpp::Array< T >::size().

## low_level_read() [14/15]

void itpp::it_ifile_old::low_level_read | ( | Array< int > & | v | ) |

Read an Array of integer values at the current file pointer position.

Definition at line 2255 of file itfile.cpp.

References s, itpp::Array< T >::set_size(), and itpp::Array< T >::size().

## low_level_read() [15/15]

void itpp::it_ifile_old::low_level_read | ( | Array< bin > & | v | ) |

Read an Array of binary values at the current file pointer position.

Definition at line 2267 of file itfile.cpp.

References s, itpp::Array< T >::set_size(), and itpp::Array< T >::size().

## low_level_read_lo() [7/8]

void itpp::it_ifile_old::low_level_read_lo | ( | Array< std::complex< float > > & | v | ) |

Read an Array of float complex values at the current file pointer position.

Definition at line 2277 of file itfile.cpp.

References s.

## low_level_read_lo() [8/8]

void itpp::it_ifile_old::low_level_read_lo | ( | Array< std::complex< double > > & | v | ) |

Read an Array of float complex values at the current file pointer position.

Definition at line 2291 of file itfile.cpp.

References s.

## low_level_read_hi() [6/6]

void itpp::it_ifile_old::low_level_read_hi | ( | Array< std::complex< double > > & | v | ) |

Read an Array of double complex values at the current file pointer position.

Definition at line 2305 of file itfile.cpp.

References s.

## seek() [1/2]

bool itpp::it_ifile_old::seek | ( | const std::string & | name | ) |

Find the variable `name`.

Definition at line 1906 of file itfile.cpp.

References itpp::it_file_base_old::data_header::block_bytes, itpp::it_file_base_old::data_header::name, read_data_header(), s, and itpp::it_file_base_old::data_header::type.

Referenced by itpp::it_file_old::exists(), itpp::operator>>(), and itpp::it_file_old::remove().

## seek() [2/2]

bool itpp::it_ifile_old::seek | ( | int | n | ) |

Find the variable number `n`.

Definition at line 1931 of file itfile.cpp.

References itpp::it_file_base_old::data_header::block_bytes, read_data_header(), s, and itpp::it_file_base_old::data_header::type.

## info()

void itpp::it_ifile_old::info | ( | std::string & | name,
|  | std::string & | type,
|  | int & | bytes )

Get information about the current variable.

Definition at line 1952 of file itfile.cpp.

References itpp::it_file_base_old::data_header::data_bytes, itpp::it_file_base_old::data_header::name, read_data_header(), s, and itpp::it_file_base_old::data_header::type.

## Member Data Documentation

## s

bfstream itpp::it_ifile_old::s

protected

Protected binary file stream.

Definition at line 797 of file itfile.h.

Referenced by itpp::it_file_old::close(), close(), itpp::it_file_old::flush(), info(), itpp::it_file_old::low_level(), low_level(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read(), low_level_read_hi(), low_level_read_hi(), low_level_read_hi(), low_level_read_hi(), low_level_read_hi(), low_level_read_hi(), low_level_read_lo(), low_level_read_lo(), low_level_read_lo(), low_level_read_lo(), low_level_read_lo(), low_level_read_lo(), low_level_read_lo(), low_level_read_lo(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::low_level_write(), itpp::it_file_old::open(), open(), read_check_file_header(), read_data_header(), itpp::it_file_old::remove(), seek(), seek(), itpp::it_file_old::write_data_header(), itpp::it_file_old::write_data_header_here(), and itpp::it_file_old::write_file_header().

## file_magic

char itpp::it_file_base_old::file_magic = { 'I', 'T', '+', '+' }

static protected inherited

ACTION: Add documentation.

Definition at line 696 of file itfile.h.

Referenced by itpp::it_ifile_old::read_check_file_header(), and itpp::it_file_old::write_file_header().

## file_version

char itpp::it_file_base_old::file_version = 2

static protected inherited

ACTION: Add documentation.

Definition at line 698 of file itfile.h.

Referenced by itpp::it_ifile_old::read_check_file_header(), and itpp::it_file_old::write_file_header().

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

- itpp/base/itfile.h
- itpp/base/itfile.cpp

Generated on for IT++ by Doxygen 1.15.0