#include <itpp/base/itfile.h>
Inheritance diagram for itpp::it_file:
Public Types | |
typedef it_file &(* | it_manip )(it_file &) |
ACTION: Add documentation for this typedef. | |
Public Member Functions | |
it_file () | |
Constructor. | |
it_file (const std::string &name, bool trunc=false) | |
Constructor. | |
virtual | ~it_file () |
Destructor. | |
void | open (const std::string &name, bool trunc=false) |
Open a file for reading and writing. | |
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 . | |
void | write_data_header (const std::string &type, it_u32 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, it_u32 size) |
Write the data header for a variable, specifying the type, name, and size of the data to follow. | |
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 & | operator<< (it_manip func) |
ACTTION: 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 (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. | |
Protected Attributes | |
bool | low_prec |
ACTION: Add documenation for this protected member. | |
std::string | next_name |
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. |
Definition at line 218 of file itfile.h.
|
ACTION: Add documentation for this typedef.
|
|
Constructor.
Definition at line 475 of file itfile.cpp. |
|
Constructor.
If the file does not exist it will be created. If Definition at line 481 of file itfile.cpp. |
|
Destructor.
|
|
Open a file for reading and writing.
If the file does not exist it will be created. If Definition at line 488 of file itfile.cpp. References itpp::exist(), it_error, it_error_if, itpp::bfstream::open(), itpp::it_ifile::read_check_file_header(), itpp::it_ifile::s, and write_file_header(). Referenced by it_file(). |
|
Close the file.
Reimplemented from itpp::it_ifile. Definition at line 504 of file itfile.cpp. References itpp::it_ifile::s. Referenced by itpp::it_save_var_as(). |
|
Flush the data to disk.
Definition at line 509 of file itfile.cpp. References itpp::it_ifile::s. Referenced by itpp::flush(). |
|
Returns pointer to the underlying
Reimplemented from itpp::it_ifile. Definition at line 252 of file itfile.h. References itpp::it_ifile::s. |
|
Set the precision. Low precision means floats, high means doubles.
Definition at line 255 of file itfile.h. References low_prec. |
|
Get the precision.
Definition at line 258 of file itfile.h. References low_prec. Referenced by low_level_write(), and itpp::operator<<(). |
|
Set the name of the next name to be saved. See also the
Definition at line 261 of file itfile.h. References next_name. Referenced by itpp::operator<<(). |
|
Write the header for the
Definition at line 514 of file itfile.cpp. References itpp::it_file_base::file_magic, itpp::it_file_base::file_version, and itpp::it_ifile::s. Referenced by open(). |
|
Write the data header for a variable, specifying the type and size of the data to follow.
Definition at line 520 of file itfile.cpp. References it_error, and next_name. Referenced by itpp::operator<<(). |
|
Write the data header for a variable, specifying the type, name, and size of the data to follow.
Definition at line 528 of file itfile.cpp. References exists(), itpp::bfstream_base::get_native_endianity(), itpp::it_ifile::read_data_header(), remove(), itpp::it_ifile::s, and write_data_header_here(). |
|
Write a binary value at the current file pointer position.
Definition at line 632 of file itfile.cpp. References itpp::it_ifile::s. Referenced by itpp::operator<<(). |
|
Write a short value at the current file pointer position.
Definition at line 637 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write an integer value at the current file pointer position.
Definition at line 642 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a float value at the current file pointer position.
Definition at line 647 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a double value at the current file pointer position.
Definition at line 652 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a float complex value at the current file pointer position.
Definition at line 657 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a double complex value at the current file pointer position.
Definition at line 663 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a vec at the current file pointer position.
Definition at line 669 of file itfile.cpp. References get_low_precision(), and itpp::it_ifile::s. |
|
Write an ivec at the current file pointer position.
Definition at line 683 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a bvec at the current file pointer position.
Definition at line 690 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a cvec at the current file pointer position.
Definition at line 697 of file itfile.cpp. References get_low_precision(), itpp::real(), and itpp::it_ifile::s. |
|
Write a string at the current file pointer position.
Definition at line 715 of file itfile.cpp. References itpp::it_ifile::s, and itpp::size(). |
|
Write a mat at the current file pointer position.
Definition at line 724 of file itfile.cpp. References itpp::Mat< Num_T >::cols(), get_low_precision(), itpp::Mat< Num_T >::rows(), and itpp::it_ifile::s. |
|
Write a imat at the current file pointer position.
Definition at line 742 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a bmat at the current file pointer position.
Definition at line 752 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a cmat at the current file pointer position.
Definition at line 762 of file itfile.cpp. References get_low_precision(), itpp::real(), and itpp::it_ifile::s. |
|
Write a float Array at the current file pointer position.
Definition at line 785 of file itfile.cpp. References itpp::it_ifile::s, and itpp::Array< T >::size(). |
|
Write a double Array at the current file pointer position.
Definition at line 792 of file itfile.cpp. References get_low_precision(), itpp::it_ifile::s, and itpp::Array< T >::size(). |
|
Write a integer Array at the current file pointer position.
Definition at line 806 of file itfile.cpp. References itpp::it_ifile::s, and itpp::Array< T >::size(). |
|
Write a bin Array at the current file pointer position.
Definition at line 813 of file itfile.cpp. References itpp::it_ifile::s, and itpp::Array< T >::size(). |
|
Write a float complex Array at the current file pointer position.
Definition at line 820 of file itfile.cpp. References itpp::it_ifile::s. |
|
Write a double complex Array at the current file pointer position.
Definition at line 829 of file itfile.cpp. References get_low_precision(), itpp::real(), and itpp::it_ifile::s. |
|
ACTTION: ADD DOCUMENTATION FOR THIS MEMBER !!!!!!!!
|
|
Removes the variable
Definition at line 597 of file itfile.cpp. References remove(), and itpp::it_ifile::seek(). |
|
Returns true if the variable
Definition at line 619 of file itfile.cpp. References itpp::it_ifile::seek(). Referenced by write_data_header(). |
|
Remove slack space from the file.
Definition at line 627 of file itfile.cpp. References it_warning. |
|
ACTION: Add documenation for this protected member.
Definition at line 603 of file itfile.cpp. References itpp::it_ifile::read_data_header(), itpp::it_ifile::s, and write_data_header_here(). Referenced by remove(), and write_data_header(). |
|
ACTION: Add documenation for this protected member.
Definition at line 591 of file itfile.cpp. References itpp::bfstream_base::endianity, itpp::it_ifile::s, and itpp::bfstream_base::set_endianity(). Referenced by remove(), and write_data_header(). |
|
Open a file. The file must exist.
Definition at line 51 of file itfile.cpp. References itpp::exist(), it_error, itpp::bfstream::open_readonly(), itpp::it_ifile::read_check_file_header(), and itpp::it_ifile::s. Referenced by itpp::it_ifile::it_ifile(). |
|
Reads and checks the file data header. Returns true if the header is valid and false otherwise.
Definition at line 129 of file itfile.cpp. References itpp::it_file_base::file_magic, itpp::it_file_base::file_version, and itpp::it_ifile::s. Referenced by open(), and itpp::it_ifile::open(). |
|
Read the data header and return the result in the variable
Definition at line 139 of file itfile.cpp. References itpp::bfstream_base::endianity, itpp::it_ifile::s, and itpp::bfstream_base::set_endianity(). Referenced by itpp::it_ifile::info(), itpp::operator>>(), remove(), itpp::it_ifile::seek(), and write_data_header(). |
|
Read a binary value at the current file pointer position.
Definition at line 157 of file itfile.cpp. References itpp::it_ifile::s. Referenced by itpp::operator>>(). |
|
Read a short value at the current file pointer position.
Definition at line 162 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read an integer value at the current file pointer position.
Definition at line 167 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a float value at the current file pointer position.
Definition at line 179 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a double value at the current file pointer position.
Definition at line 184 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a float complex value at the current file pointer position.
Definition at line 189 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a double complex value at the current file pointer position.
Definition at line 197 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a vector of integer values at the current file pointer position.
Definition at line 231 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a vector of binary values at the current file pointer position.
Definition at line 241 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a string at the current file pointer position.
Definition at line 279 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a matrix of integer values at the current file pointer position.
Definition at line 321 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a matrix of binary values at the current file pointer position.
Definition at line 332 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read an Array of integer values at the current file pointer position.
Definition at line 413 of file itfile.cpp. References itpp::it_ifile::s, itpp::Array< T >::set_size(), and itpp::Array< T >::size(). |
|
Read an Array of binary values at the current file pointer position.
Definition at line 423 of file itfile.cpp. References itpp::it_ifile::s, itpp::Array< T >::set_size(), and itpp::Array< T >::size(). |
|
Read a vector of float values at the current file pointer position.
Definition at line 205 of file itfile.cpp. References itpp::it_ifile::s. Referenced by itpp::operator>>(). |
|
Read a vector of float complex values at the current file pointer position.
Definition at line 251 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a matrix of float values at the current file pointer position.
Definition at line 293 of file itfile.cpp. References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::rows(), itpp::it_ifile::s, and itpp::Mat< Num_T >::set_size(). |
|
Read a matrix of float complex values at the current file pointer position.
Definition at line 343 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read an Array of float values at the current file pointer position.
Definition at line 374 of file itfile.cpp. References itpp::it_ifile::s, itpp::Array< T >::set_size(), and itpp::Array< T >::size(). |
|
Read an Array of float values at the current file pointer position.
Definition at line 387 of file itfile.cpp. References itpp::it_ifile::s, itpp::Array< T >::set_size(), and itpp::Array< T >::size(). |
|
Read an Array of float complex values at the current file pointer position.
Definition at line 433 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read an Array of float complex values at the current file pointer position.
Definition at line 447 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a vector of double values at the current file pointer position.
Definition at line 218 of file itfile.cpp. References itpp::it_ifile::s. Referenced by itpp::operator>>(). |
|
Read a vector of double complex values at the current file pointer position.
Definition at line 265 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read a matrix of double values at the current file pointer position.
Definition at line 307 of file itfile.cpp. References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::rows(), itpp::it_ifile::s, and itpp::Mat< Num_T >::set_size(). |
|
Read a matrix of double complex values at the current file pointer position.
Definition at line 358 of file itfile.cpp. References itpp::it_ifile::s. |
|
Read an Array of double values at the current file pointer position.
Definition at line 400 of file itfile.cpp. References itpp::it_ifile::s, itpp::Array< T >::set_size(), and itpp::Array< T >::size(). |
|
Read an Array of double complex values at the current file pointer position.
Definition at line 461 of file itfile.cpp. References itpp::it_ifile::s. |
|
Find the variable
Definition at line 70 of file itfile.cpp. References itpp::it_ifile::read_data_header(), and itpp::it_ifile::s. Referenced by exists(), itpp::it_load_var_as(), itpp::operator>>(), and remove(). |
|
Find the variable number
Definition at line 95 of file itfile.cpp. References itpp::it_ifile::read_data_header(), and itpp::it_ifile::s. |
|
Get information about the current variable.
Definition at line 116 of file itfile.cpp. References itpp::it_ifile::read_data_header(), and itpp::it_ifile::s. |
|
ACTION: Add documenation for this protected member.
Definition at line 339 of file itfile.h. Referenced by get_low_precision(), it_file(), and set_low_precision(). |
|
ACTION: Add documenation for this protected member.
Definition at line 341 of file itfile.h. Referenced by it_file(), set_next_name(), and write_data_header(). |
|
Protected binary file stream.
Definition at line 210 of file itfile.h. Referenced by close(), itpp::it_ifile::close(), flush(), itpp::it_ifile::info(), low_level(), itpp::it_ifile::low_level(), itpp::it_ifile::low_level_read(), itpp::it_ifile::low_level_read_hi(), itpp::it_ifile::low_level_read_lo(), low_level_write(), open(), itpp::it_ifile::open(), itpp::it_ifile::read_check_file_header(), itpp::it_ifile::read_data_header(), remove(), itpp::it_ifile::seek(), write_data_header(), write_data_header_here(), and write_file_header(). |
|
ACTION: Add documentation.
Definition at line 105 of file itfile.h. Referenced by itpp::it_ifile::read_check_file_header(), and write_file_header(). |
|
ACTION: Add documentation.
Definition at line 107 of file itfile.h. Referenced by itpp::it_ifile::read_check_file_header(), and write_file_header(). |
Generated on Thu Apr 19 14:20:01 2007 for IT++ by Doxygen 1.4.6