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

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

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

Inheritance diagram for itpp::it_file_old:

## Public Types

typedef it_file_old &(* | it_manip) (it_file_old &)
| ACTION: Add documentation for this typedef.

## Public Member Functions

| it_file_old ()
| Constructor.
| it_file_old (const std::string &name, bool trunc=false)
| Constructor. More...
virtual | ~it_file_old ()
| Destructor.
void | open (const std::string &name, bool trunc=false)
| Open a file for reading and writing. More...
void | close ()
| Close the file.
void | flush ()
| Flush the data to disk.
bfstream & | low_level ()
| Returns pointer to the underlying `bfstream` used.
void | set_low_precision (bool p=true)
| Set the precision. Low precision means floats, high means doubles.
bool | get_low_precision ()
| Get the precision.
void | set_next_name (const std::string &n)
| Set the name of the next name to be saved. See also the `Name` class.
void | write_file_header ()
| Write the header for the `it_file_old`.
void | write_data_header (const std::string &type, uint32_t size)
| Write the data header for a variable, specifying the type and size of the data to follow.
void | write_data_header (const std::string &type, const std::string &name, uint32_t size)
| Write the data header for a variable, specifying the type, name, and size of the data to follow.
void | low_level_write (char x)
| Write a char value at the current file pointer position.
void | low_level_write (bin x)
| Write a binary value at the current file pointer position.
void | low_level_write (short x)
| Write a short value at the current file pointer position.
void | low_level_write (int x)
| Write an integer value at the current file pointer position.
void | low_level_write (float x)
| Write a float value at the current file pointer position.
void | low_level_write (double x)
| Write a double value at the current file pointer position.
void | low_level_write (const std::complex< float > &x)
| Write a float complex value at the current file pointer position.
void | low_level_write (const std::complex< double > &x)
| Write a double complex value at the current file pointer position.
void | low_level_write (const vec &v)
| Write a vec at the current file pointer position.
void | low_level_write (const ivec &v)
| Write an ivec at the current file pointer position.
void | low_level_write (const bvec &v)
| Write a bvec at the current file pointer position.
void | low_level_write (const cvec &v)
| Write a cvec at the current file pointer position.
void | low_level_write (const std::string &str)
| Write a string at the current file pointer position.
void | low_level_write (const mat &m)
| Write a mat at the current file pointer position.
void | low_level_write (const imat &m)
| Write a imat at the current file pointer position.
void | low_level_write (const bmat &m)
| Write a bmat at the current file pointer position.
void | low_level_write (const cmat &m)
| Write a cmat at the current file pointer position.
void | low_level_write (const Array< float > &v)
| Write a float Array at the current file pointer position.
void | low_level_write (const Array< double > &v)
| Write a double Array at the current file pointer position.
void | low_level_write (const Array< int > &v)
| Write a integer Array at the current file pointer position.
void | low_level_write (const Array< bin > &v)
| Write a bin Array at the current file pointer position.
void | low_level_write (const Array< std::complex< float > > &v)
| Write a float complex Array at the current file pointer position.
void | low_level_write (const Array< std::complex< double > > &v)
| Write a double complex Array at the current file pointer position.
it_file_old & | operator<< (it_manip func)
| ACTION: ADD DOCUMENTATION FOR THIS MEMBER !!!!!!!!
void | remove (const std::string &name)
| Removes the variable `name` from the file.
bool | exists (const std::string &name)
| Returns true if the variable `name` exists in the file.
void | pack ()
| Remove slack space from the file.
void | open (const std::string &name)
| Open a file. The file must exist.
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 (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 (std::string &str)
| Read a string 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 (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 (vec &v)
| Read a vector of float 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_lo (mat &m)
| Read a matrix of float 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_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_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 (vec &v)
| Read a vector of double 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_hi (mat &m)
| Read a matrix of double 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_hi (Array< double > &v)
| Read an Array of double 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 Member Functions

void | remove ()
| ACTION: Add documenation for this protected member.
void | write_data_header_here (const data_header &h)
| ACTION: Add documenation for this protected member.
std::string & | next_name ()
| ACTION: Add documenation for this protected member.

## Protected Attributes

bool | low_prec
| ACTION: Add documenation for this protected member.
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 and writing class.

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

Definition at line 806 of file itfile.h.

## Constructor & Destructor Documentation

## it_file_old()

itpp::it_file_old::it_file_old | ( | const std::string & | name,
|  | bool | trunc = `false`
| ) |  |

explicit

Constructor.

If the file does not exist it will be created. If `trunc` is true, the file will be truncated.

Definition at line 2324 of file itfile.cpp.

References low_prec, and open().

## Member Function Documentation

## open()

void itpp::it_file_old::open | ( | const std::string & | name,
|  | bool | trunc = `false`
| ) |  |

Open a file for reading and writing.

If the file does not exist it will be created. If `trunc` is true, the file will be truncated.

Definition at line 2331 of file itfile.cpp.

References itpp::binfile_details::Fstream_Binfile_Facade::close(), itpp::exist(), itpp::binfile_details::Fstream_Binfile_Facade::is_open(), it_error, it_error_if, itpp::bfstream::open(), itpp::it_ifile_old::read_check_file_header(), itpp::it_ifile_old::s, and write_file_header().

Referenced by it_file_old().

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

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

Generated on Mon Mar 23 2020 06:18:03 for IT++ by Doxygen 1.8.17