![]() |
PhoenixPresentation
2.0.0
Set of cmake function to automate presentation generation
|
Deal with binary stream. More...
#include <PStream.h>
Public Member Functions | |
void | close () |
Close the stream. More... | |
bool | isOpen () const |
Say if the stream is opened. More... | |
bool | open (const PPath &fileName, const PString &mode="r") |
Open the current stream. More... | |
template<typename T > | |
PStream & | operator<< (const T &value) |
Flux operator for stream. More... | |
template<typename T > | |
PStream & | operator>> (T &value) |
Flux operator for stream. More... | |
PStream () | |
Default constructor of PStream. More... | |
template<typename T > | |
bool | read (T &value) |
Read a value from the stream. More... | |
template<typename T > | |
bool | read (T *tabValue, size_t nbRow, size_t nbCol, size_t padding=0lu) |
Read a table values from the stream. More... | |
template<typename T > | |
bool | read (T *tabValue, size_t nbValue) |
Read a value from the stream. More... | |
template<typename T > | |
bool | write (const T &value) |
Write a value into the stream. More... | |
template<typename T > | |
bool | write (const T *tabValue, size_t nbRow, size_t nbCol, size_t padding=0lu) |
Write a table values into the stream. More... | |
template<typename T > | |
bool | write (const T *tabValue, size_t nbValue) |
Write a table values into the stream. More... | |
virtual | ~PStream () |
Destructor of PStream. More... | |
Private Member Functions | |
void | initialisationPStream () |
Initialisation function of the class PStream. More... | |
Private Attributes | |
FILE * | p_fp |
Pointer to the main stream. More... | |
PStream::PStream | ( | ) |
Default constructor of PStream.
Definition at line 11 of file PStream.cpp.
References initialisationPStream().
|
virtual |
Destructor of PStream.
Definition at line 16 of file PStream.cpp.
References close().
void PStream::close | ( | ) |
Close the stream.
Definition at line 32 of file PStream.cpp.
References isOpen(), and p_fp.
Referenced by open(), testPStream(), testPStreamMatrix(), testPStreamTable(), and ~PStream().
|
private |
bool PStream::isOpen | ( | ) | const |
Open the current stream.
fileName | : name of the file to be used |
mode | : open mode, r : read only, write : write only, etc |
Definition at line 25 of file PStream.cpp.
References close(), isOpen(), and p_fp.
Referenced by testPStream(), testPStreamMatrix(), and testPStreamTable().
PStream & PStream::operator<< | ( | const T & | value | ) |
Flux operator for stream.
value | : value to be put in the stream |
Definition at line 17 of file PStream_impl.h.
References write().
PStream & PStream::operator>> | ( | T & | value | ) |
Flux operator for stream.
value | : value to be read from the stream |
Definition at line 27 of file PStream_impl.h.
References read().
bool PStream::read | ( | T & | value | ) |
Read a value from the stream.
value | : value to be read from the stream |
Definition at line 73 of file PStream_impl.h.
References p_fp.
Referenced by operator>>(), read(), testPStreamMatrix(), and testPStreamTable().
bool PStream::read | ( | T * | tabValue, |
size_t | nbRow, | ||
size_t | nbCol, | ||
size_t | padding = 0lu |
||
) |
Read a table values from the stream.
tabValue | : table of values to be read from the stream |
nbRow | : number of rows of the matrix |
nbCol | : number of columns of the matrix |
padding | : padding of the rows |
Definition at line 94 of file PStream_impl.h.
References read().
bool PStream::read | ( | T * | tabValue, |
size_t | nbValue | ||
) |
Read a value from the stream.
tabValue | : table of values to be read from the stream |
nbValue | : number of values of the table |
Definition at line 82 of file PStream_impl.h.
References p_fp.
bool PStream::write | ( | const T & | value | ) |
Write a value into the stream.
value | : value to be written into the stream |
Definition at line 37 of file PStream_impl.h.
References p_fp.
Referenced by operator<<(), testPStreamMatrix(), testPStreamTable(), and write().
bool PStream::write | ( | const T * | tabValue, |
size_t | nbRow, | ||
size_t | nbCol, | ||
size_t | padding = 0lu |
||
) |
Write a table values into the stream.
tabValue | : table of values to be written into the stream |
nbRow | : number of rows of the matrix |
nbCol | : number of columns of the matrix |
padding | : padding of the rows |
Definition at line 59 of file PStream_impl.h.
References write().
bool PStream::write | ( | const T * | tabValue, |
size_t | nbValue | ||
) |
Write a table values into the stream.
tabValue | : table of values to be written into the stream |
nbValue | : number of values of the table |
Definition at line 47 of file PStream_impl.h.
References p_fp.
|
private |