Pointwise Plugin SDK
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
PwpFileWriter Class Reference

The abstract PwpFileWriter class. More...

#include <PwpFileWriter.h>

+ Inheritance diagram for PwpFileWriter:
+ Collaboration diagram for PwpFileWriter:

Public Member Functions

virtual FormatType getFmtType () const
 default implementation. More...
 
 PwpFileWriter (PwpFile &file)
 PwpFile constructor. More...
 
virtual void setFmtType (FormatType type)
 default implementation. More...
 
virtual ~PwpFileWriter ()
 Destructor. More...
 
virtual void setFmtFieldSingle (const int width, const int prec)
 default implementation. More...
 
virtual void getFmtFieldSingle (int &width, int &prec) const
 default implementation. More...
 
virtual void setFmtFieldDouble (const int width, const int prec)
 default implementation. More...
 
virtual void getFmtFieldDouble (int &width, int &prec) const
 default implementation. More...
 
virtual bool beginRecord ()
 NOP default implementation. More...
 
virtual bool beginRecord (PWP_UINT32, PWP_UINT32=1)
 NOP default implementation. More...
 
virtual bool endRecord ()
 NOP default implementation. More...
 
- Public Member Functions inherited from PwpWriterInterface
virtual bool write (const char *val, PWP_INT size=-1, char pad=0)=0
 Writes a string value. More...
 
virtual bool write (PWP_FLOAT val, const char *suffix=0, const char *prefix=0)=0
 Writes a floating point value with proper precision, encoding and byte order. More...
 
virtual bool write (PWP_INT16 val, const char *suffix=0, const char *prefix=0)=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)=0
 Writes a integer value with proper encoding and byte order. More...
 
virtual bool write (PWP_INT64 val, const char *suffix=0, const char *prefix=0)=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)=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)=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)=0
 Writes a integer value with proper encoding and byte order. More...
 
virtual bool write (PWP_UINT32 val, const char *suffix=0, const char *prefix=0)=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)=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)=0
 Writes a integer value with proper encoding and byte order. More...
 
bool writef (const char *fmt,...)
 Writes a formatted string value. More...
 
bool writef (PWP_INT size, char pad, const char *fmt,...)
 Writes a formatted string value. More...
 
virtual ~PwpWriterInterface ()
 Destructor. More...
 

Protected Attributes

PwpFilefile_
 The file being written. More...
 
int fmtFieldWdDouble_
 Double precision format field width. More...
 
int fmtFieldWdSingle_
 Single precision format field width. More...
 
int fmtPrecDouble_
 Double precision format decimals. More...
 
int fmtPrecSingle_
 Single precision format decimals. More...
 
FormatType fmtType_
 Formatting flags. More...
 

Private Member Functions

PwpFileWriteroperator= (const PwpFileWriter &)=delete
 

Additional Inherited Members

- Public Types inherited from PwpWriterInterface
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...
 
- Protected Types inherited from PwpWriterInterface
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...
 

Detailed Description

The abstract PwpFileWriter class.

Inherited by subclasses that implement the PwpWriterInterface for writing to PwpFile objects.

Definition at line 377 of file PwpFileWriter.h.

Constructor & Destructor Documentation

◆ PwpFileWriter()

PwpFileWriter::PwpFileWriter ( PwpFile file)
inline

PwpFile constructor.

Constructs a file writer object bound to the specified file.

Parameters
fileThe PwpFile object.

Definition at line 384 of file PwpFileWriter.h.

◆ ~PwpFileWriter()

virtual PwpFileWriter::~PwpFileWriter ( )
inlinevirtual

Destructor.

Definition at line 395 of file PwpFileWriter.h.

Member Function Documentation

◆ beginRecord() [1/2]

virtual bool PwpFileWriter::beginRecord ( )
inlinevirtual

NOP default implementation.

Only FORTRAN unformatted files use records. The PwpUnformattedWriter subclass will reimplement this method as needed.

Implements PwpWriterInterface.

Reimplemented in PwpUnformattedWriter.

Definition at line 448 of file PwpFileWriter.h.

Referenced by PwpFile::beginRecord().

◆ beginRecord() [2/2]

virtual bool PwpFileWriter::beginRecord ( PWP_UINT32  ,
PWP_UINT32  = 1 
)
inlinevirtual

NOP default implementation.

Only FORTRAN unformatted files use records. The PwpUnformattedWriter subclass will reimplement this method as needed.

Implements PwpWriterInterface.

Reimplemented in PwpUnformattedWriter.

Definition at line 452 of file PwpFileWriter.h.

◆ endRecord()

virtual bool PwpFileWriter::endRecord ( )
inlinevirtual

NOP default implementation.

Only FORTRAN unformatted files use records. The PwpUnformattedWriter subclass will reimplement this method as needed.

Implements PwpWriterInterface.

Reimplemented in PwpUnformattedWriter.

Definition at line 456 of file PwpFileWriter.h.

Referenced by PwpFile::endRecord().

◆ getFmtFieldDouble()

virtual void PwpFileWriter::getFmtFieldDouble ( int &  width,
int &  prec 
) const
inlinevirtual

default implementation.

Sets and gets the field width, and decimal precision.

Parameters
widthThe format field width.
precThe format field decimal places.
Note
Theses values are only used by the PwpAsciiWriter.

Implements PwpWriterInterface.

Definition at line 420 of file PwpFileWriter.h.

References fmtFieldWdDouble_, and fmtPrecDouble_.

Referenced by PwpFile::getFmtFieldDouble().

◆ getFmtFieldSingle()

virtual void PwpFileWriter::getFmtFieldSingle ( int &  width,
int &  prec 
) const
inlinevirtual

default implementation.

Sets and gets the field width, and decimal precision.

Parameters
widthThe format field width.
precThe format field decimal places.
Note
Theses values are only used by the PwpAsciiWriter.

Implements PwpWriterInterface.

Definition at line 412 of file PwpFileWriter.h.

References fmtFieldWdSingle_, and fmtPrecSingle_.

Referenced by PwpFile::getFmtFieldSingle().

◆ getFmtType()

virtual FormatType PwpFileWriter::getFmtType ( ) const
inlinevirtual

default implementation.

Gets the format type.

Implements PwpWriterInterface.

Definition at line 438 of file PwpFileWriter.h.

References fmtType_.

Referenced by PwpFile::getFmtType().

◆ operator=()

PwpFileWriter& PwpFileWriter::operator= ( const PwpFileWriter )
privatedelete

◆ setFmtFieldDouble()

virtual void PwpFileWriter::setFmtFieldDouble ( const int  width,
const int  prec 
)
inlinevirtual

default implementation.

Sets and gets the field width, and decimal precision.

Parameters
widthThe format field width.
precThe format field decimal places.
Note
Theses values are only used by the PwpAsciiWriter.

Implements PwpWriterInterface.

Definition at line 416 of file PwpFileWriter.h.

References fmtFieldWdDouble_, and fmtPrecDouble_.

Referenced by PwpFile::setFmtFieldDouble().

◆ setFmtFieldSingle()

virtual void PwpFileWriter::setFmtFieldSingle ( const int  width,
const int  prec 
)
inlinevirtual

default implementation.

Sets and gets the field width, and decimal precision.

Parameters
widthThe format field width.
precThe format field decimal places.
Note
Theses values are only used by the PwpAsciiWriter.

Implements PwpWriterInterface.

Definition at line 408 of file PwpFileWriter.h.

Referenced by PwpFile::setFmtFieldSingle().

◆ setFmtType()

virtual void PwpFileWriter::setFmtType ( FormatType  type)
inlinevirtual

default implementation.

Sets the format type.

Parameters
typeThe format type.
Note
This value is only used by the PwpAsciiWriter.

Implements PwpWriterInterface.

Definition at line 431 of file PwpFileWriter.h.

References fmtType_.

Referenced by PwpFile::setFmtType().

Member Data Documentation

◆ file_

PwpFile& PwpFileWriter::file_
protected

◆ fmtFieldWdDouble_

int PwpFileWriter::fmtFieldWdDouble_
protected

Double precision format field width.

Definition at line 472 of file PwpFileWriter.h.

Referenced by getFmtFieldDouble(), setFmtFieldDouble(), and PwpAsciiWriter::write().

◆ fmtFieldWdSingle_

int PwpFileWriter::fmtFieldWdSingle_
protected

Single precision format field width.

Definition at line 470 of file PwpFileWriter.h.

Referenced by getFmtFieldSingle(), and PwpAsciiWriter::write().

◆ fmtPrecDouble_

int PwpFileWriter::fmtPrecDouble_
protected

Double precision format decimals.

Definition at line 473 of file PwpFileWriter.h.

Referenced by getFmtFieldDouble(), setFmtFieldDouble(), and PwpAsciiWriter::write().

◆ fmtPrecSingle_

int PwpFileWriter::fmtPrecSingle_
protected

Single precision format decimals.

Definition at line 471 of file PwpFileWriter.h.

Referenced by getFmtFieldSingle(), and PwpAsciiWriter::write().

◆ fmtType_

FormatType PwpFileWriter::fmtType_
protected

Formatting flags.

Definition at line 469 of file PwpFileWriter.h.

Referenced by getFmtType(), setFmtType(), and PwpAsciiWriter::writeWdPrec().


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