Simpatico
v1.10
|
Loading archive for text istream.
Definition at line 30 of file TextFileIArchive.h.
#include <TextFileIArchive.h>
Public Member Functions | |
TextFileIArchive () | |
Constructor. More... | |
TextFileIArchive (std::string filename) | |
Constructor. More... | |
TextFileIArchive (std::ifstream &file) | |
Constructor. More... | |
virtual | ~TextFileIArchive () |
Destructor. More... | |
std::ifstream & | file () |
Get the underlying ifstream by reference. More... | |
template<typename T > | |
TextFileIArchive & | operator& (T &data) |
Load one object. More... | |
template<typename T > | |
TextFileIArchive & | operator>> (T &data) |
Load one object. More... | |
template<typename T > | |
void | unpack (T &data) |
Load a single T object. More... | |
template<typename T > | |
void | unpack (T *array, int n) |
Load a C-array of T objects. More... | |
template<typename T > | |
void | unpack (T *array, int m, int n, int np) |
Load a 2D C array. More... | |
Static Public Member Functions | |
static bool | is_saving () |
Returns true;. More... | |
static bool | is_loading () |
Returns false;. More... | |
Util::TextFileIArchive::TextFileIArchive | ( | ) |
Constructor.
Definition at line 18 of file TextFileIArchive.cpp.
Util::TextFileIArchive::TextFileIArchive | ( | std::string | filename | ) |
Constructor.
filename | name of file to open for reading. |
Definition at line 27 of file TextFileIArchive.cpp.
Util::TextFileIArchive::TextFileIArchive | ( | std::ifstream & | file | ) |
Constructor.
file | output file |
Definition at line 37 of file TextFileIArchive.cpp.
References UTIL_THROW.
|
virtual |
Destructor.
Definition at line 51 of file TextFileIArchive.cpp.
|
inlinestatic |
Returns true;.
Definition at line 125 of file TextFileIArchive.h.
|
inlinestatic |
Returns false;.
Definition at line 128 of file TextFileIArchive.h.
std::ifstream & Util::TextFileIArchive::file | ( | ) |
Get the underlying ifstream by reference.
Definition at line 61 of file TextFileIArchive.cpp.
References unpack().
|
inline |
Load one object.
Definition at line 137 of file TextFileIArchive.h.
|
inline |
Load one object.
Definition at line 147 of file TextFileIArchive.h.
|
inline |
Load a single T object.
data | object to be loaded from this archive. |
Definition at line 159 of file TextFileIArchive.h.
|
inline |
Load a C-array of T objects.
array | pointer to array of T objecs. |
n | number of elements in array |
Definition at line 166 of file TextFileIArchive.h.
void Util::TextFileIArchive::unpack | ( | T * | array, |
int | m, | ||
int | n, | ||
int | np | ||
) |
Load a 2D C array.
array | pointer to first row or element |
m | logical number of rows |
n | logical number of columns |
np | physical number of columns (elements allocated per row) |
Definition at line 177 of file TextFileIArchive.h.
References unpack().