Pointwise Plugin SDK
|
Manages FORTRAN unformatted file records. More...
#include <PwpFile.h>
Public Member Functions | |
virtual bool | beginRecord () |
Starts an unformatted record. More... | |
virtual bool | beginRecord (PWP_UINT32 bytes, PWP_UINT32 count=1) |
Starts a fixed size unformatted record. More... | |
virtual bool | endRecord () |
Ends an unformatted record. More... | |
PwpFile & | file () |
Get this record's file object. More... | |
const PwpFile & | file () const |
Get this record's file object. More... | |
virtual void | getFmtFieldDouble (int &width, int &prec) const |
virtual void | getFmtFieldSingle (int &width, int &prec) const |
virtual FormatType | getFmtType () const |
bool | getPos (sysFILEPOS &pos) const |
Get the current file position of this record's file object. More... | |
PwpFileRecord (PwpFile &file, bool doBeginRecord=true) | |
Constructor. More... | |
PwpFileRecord (PwpFile &file, PWP_UINT32 bytes, PWP_UINT32 count=1) | |
Constructor. More... | |
virtual void | setFmtFieldDouble (const int width, const int prec) |
virtual void | setFmtFieldSingle (const int width, const int prec) |
virtual void | setFmtType (FormatType type) |
virtual bool | write (PWP_UINT32 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
virtual bool | write (const char *val, PWP_INT size=-1, char pad=0) |
Writes a string value. More... | |
virtual bool | write (PWP_FLOAT val, const char *suffix=0, const char *prefix=0) |
Writes a floating point value with proper precision, encoding and byte order. More... | |
virtual bool | write (PWP_INT64 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
virtual bool | write (PWP_UINT8 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
virtual bool | write (PWP_INT32 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
virtual bool | write (PWP_INT16 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
virtual bool | write (PWP_INT8 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
virtual bool | write (PWP_REAL val, const char *suffix=0, const char *prefix=0) |
Writes a floating point value with proper precision, encoding and byte order. More... | |
virtual bool | write (PWP_UINT16 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
virtual bool | write (PWP_UINT64 val, const char *suffix=0, const char *prefix=0) |
Writes a integer value with proper encoding and byte order. More... | |
template<typename T > | |
bool | writeAt (sysFILEPOS pos, const T &val, const char *suffix=0, const char *prefix=0) |
Writes an endian enforced value directly at a given file position. More... | |
virtual | ~PwpFileRecord () |
Destructor. More... | |
![]() | |
bool | writef (PWP_INT size, char pad, const char *fmt,...) |
Writes a formatted string value. More... | |
bool | writef (const char *fmt,...) |
Writes a formatted string value. More... | |
virtual | ~PwpWriterInterface () |
Destructor. More... | |
Private Member Functions | |
PwpFileRecord & | operator= (const PwpFileRecord &) |
Private Attributes | |
PwpFile & | file_ |
Additional Inherited Members | |
![]() | |
enum | FormatType { FormatG = G_, FormatWdPrecG = G_ | Wd_ | Prec_, FormatWdG = G_ | Wd_, FormatPrecG = G_ | Prec_, FormatF = F_, FormatWdPrecF = F_ | Wd_ | Prec_, FormatWdF = F_ | Wd_, FormatPrecF = F_ | Prec_, FormatE = E_, FormatWdPrecE = E_ | Wd_ | Prec_, FormatWdE = E_ | Wd_, FormatPrecE = E_ | Prec_ } |
Formatted output types for floating point values. More... | |
![]() | |
enum | { G_ = 0x00, F_ = 0x01, E_ = 0x02, GFEMask_ = 0x0F, Wd_ = 0x10, Prec_ = 0x20, WdPrec_ = Wd_ | Prec_, WPMask_ = 0xF0 } |
Bit flags use to build public FormatX enums. More... | |
Manages FORTRAN unformatted file records.
The PwpFileRecord class manages all writes to pwpUnformatted records.
Record management is only performed for pwpUnformatted files. For all other modes, PwpFileRecord method calls are passed directly through to the underlying file object.
See PwpFile for usage.
PwpFileRecord::PwpFileRecord | ( | PwpFile & | file, |
bool | doBeginRecord = true |
||
) |
Constructor.
Constructs a PwpFileRecord object bound to the specified file.
file | A file object. |
doBeginRecord | If true, beginRecord() is called. |
Definition at line 1366 of file PwpFile.cxx.
References beginRecord().
PwpFileRecord::PwpFileRecord | ( | PwpFile & | file, |
PWP_UINT32 | bytes, | ||
PWP_UINT32 | count = 1 |
||
) |
Constructor.
Constructs a fixed size PwpFileRecord object bound to the specified file. See PwpWriterInterface::beginRecord(bytes, count) for important performance information. The call to endRecord() will fail if the number of bytes written to the record is not equal to (bytes * count).
file | A file object. |
bytes | data item size. |
count | number of data items. |
Definition at line 1375 of file PwpFile.cxx.
References beginRecord().
|
virtual |
Destructor.
Definition at line 1382 of file PwpFile.cxx.
References endRecord(), file_, and PwpFile::isOpen().
|
virtual |
Starts an unformatted record.
Starts an unformatted record. If a record is already active, it will be closed.
Implements PwpWriterInterface.
Definition at line 1391 of file PwpFile.cxx.
References PwpFile::beginRecord(), and file_.
Referenced by PwpFileRecord().
|
virtual |
Starts a fixed size unformatted record.
Starts a fixed size unformatted record. If a record is already active, it will be closed.
Fixed size record I/O is significantly faster than variable sized records. Fixed size records should be used, if possible, when there are large numbers (> ~1e6) of records written to an export file.
The call to endRecord() will fail if the number of bytes written to the record is not equal to (bytes * count).
Implements PwpWriterInterface.
Definition at line 1397 of file PwpFile.cxx.
References PwpFile::beginRecord(), and file_.
|
virtual |
Ends an unformatted record.
Ends an active record for files opened with pwpUnformatted mode.
Implements PwpWriterInterface.
Definition at line 1403 of file PwpFile.cxx.
References PwpFile::endRecord(), and file_.
Referenced by ~PwpFileRecord().
|
inline |
|
inline |
|
virtual |
Implements PwpWriterInterface.
Definition at line 1510 of file PwpFile.cxx.
References file_, and PwpFile::getFmtFieldDouble().
|
virtual |
Implements PwpWriterInterface.
Definition at line 1496 of file PwpFile.cxx.
References file_, and PwpFile::getFmtFieldSingle().
|
virtual |
Implements PwpWriterInterface.
Definition at line 1525 of file PwpFile.cxx.
References file_, and PwpFile::getFmtType().
|
inline |
Get the current file position of this record's file object.
Definition at line 954 of file PwpFile.h.
References file_, and PwpFile::getPos().
|
inlineprivate |
|
virtual |
Implements PwpWriterInterface.
Definition at line 1503 of file PwpFile.cxx.
References file_, and PwpFile::setFmtFieldDouble().
|
virtual |
Implements PwpWriterInterface.
Definition at line 1489 of file PwpFile.cxx.
References file_, and PwpFile::setFmtFieldSingle().
|
virtual |
Implements PwpWriterInterface.
Definition at line 1518 of file PwpFile.cxx.
References file_, and PwpFile::setFmtType().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1449 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a string value.
val | The string to write. |
size | The number of string characters to write. If -1, strlen(val) is used. |
pad | If size > strlen(val), the pad value will be used to fill the remaining characters. |
Implements PwpWriterInterface.
Definition at line 1532 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1433 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1425 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1457 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1465 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1441 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1417 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a integer value with proper encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1409 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a floating point value with proper precision, encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1473 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
virtual |
Writes a floating point value with proper precision, encoding and byte order.
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Implements PwpWriterInterface.
Definition at line 1481 of file PwpFile.cxx.
References file_, and PwpFile::write().
|
inline |
Writes an endian enforced value directly at a given file position.
The original file position is restored upon successful return.
pos | The file position from getPos(). |
val | The value to write. |
suffix | String written after val (pwpAscii mode only). |
prefix | String written before val (pwpAscii mode only). |
Definition at line 971 of file PwpFile.h.
References file_, and PwpFile::writeAt().
|
private |
Definition at line 987 of file PwpFile.h.
Referenced by beginRecord(), endRecord(), file(), getFmtFieldDouble(), getFmtFieldSingle(), getFmtType(), getPos(), setFmtFieldDouble(), setFmtFieldSingle(), setFmtType(), write(), writeAt(), and ~PwpFileRecord().