Go to the documentation of this file.
10 #ifndef _PWPFILEWRITER_H_
11 #define _PWPFILEWRITER_H_
25 #define PwpWriterInterface_METHODS(sfx) \
26 virtual bool beginRecord() sfx \
27 virtual bool beginRecord(PWP_UINT32 bytes, PWP_UINT32 count = 1) sfx \
28 virtual bool endRecord() sfx \
29 virtual bool write(PWP_INT64 val, const char * suffix = 0, \
30 const char * prefix = 0) sfx \
31 virtual bool write(PWP_INT32 val, const char * suffix = 0, \
32 const char * prefix = 0) sfx \
33 virtual bool write(PWP_INT16 val, const char * suffix = 0, \
34 const char * prefix = 0) sfx \
35 virtual bool write(PWP_INT8 val, const char * suffix = 0, \
36 const char * prefix = 0) sfx \
37 virtual bool write(PWP_UINT64 val, const char * suffix = 0, \
38 const char * prefix = 0) sfx \
39 virtual bool write(PWP_UINT32 val, const char * suffix = 0, \
40 const char * prefix = 0) sfx \
41 virtual bool write(PWP_UINT16 val, const char * suffix = 0, \
42 const char * prefix = 0) sfx \
43 virtual bool write(PWP_UINT8 val, const char * suffix = 0, \
44 const char * prefix = 0) sfx \
45 virtual bool write(PWP_FLOAT val, const char * suffix = 0, \
46 const char * prefix = 0) sfx \
47 virtual bool write(PWP_REAL val, const char * suffix = 0, \
48 const char * prefix = 0) sfx \
49 virtual void setFmtFieldSingle(const int width, const int prec) sfx \
50 virtual void getFmtFieldSingle(int &width, int &prec) const sfx \
51 virtual void setFmtFieldDouble(const int width, const int prec) sfx \
52 virtual void getFmtFieldDouble(int &width, int &prec) const sfx \
53 virtual void setFmtType(FormatType type) sfx \
54 virtual FormatType getFmtType() const sfx \
55 virtual bool write(const char * val, PWP_INT size = -1, char pad = 0) sfx
57 #define PwpWriterInterface_PUREVIRTUAL PwpWriterInterface_METHODS(=0;)
58 #define PwpWriterInterface_SUBCLASS PwpWriterInterface_METHODS(;)
364 int ret = vsnprintf(msg,
sizeof(msg), fmt, args);
365 return (0 < ret) && this->
write(msg, size, pad);
477 #endif // _PWPFILEWRITER_H_
@ FormatWdPrecF
Format "%*.*f".
virtual bool endRecord()
NOP default implementation.
virtual void getFmtFieldDouble(int &width, int &prec) const
default implementation.
PwpFileWriter(PwpFile &file)
PwpFile constructor.
int fmtFieldWdSingle_
Single precision format field width.
virtual ~PwpFileWriter()
Destructor.
bool writefImpl(PWP_INT size, char pad, const char *fmt, va_list &args)
Implementation to write a formatted string value.
virtual bool beginRecord()
NOP default implementation.
@ FormatWdPrecG
Format "%*.*g".
PwpFile & file_
The file being written.
virtual void setFmtFieldDouble(const int width, const int prec)
default implementation.
virtual FormatType getFmtType() const
default implementation.
#define PwpWriterInterface_PUREVIRTUAL
int fmtFieldWdDouble_
Double precision format field width.
@ FormatPrecG
Format "%.*g".
@ FormatPrecE
Format "%.*e".
@ FormatWdPrecE
Format "%*.*e".
The abstract PwpFileWriter class.
PwpFileWriter & operator=(const PwpFileWriter &)=delete
virtual void getFmtFieldSingle(int &width, int &prec) const
default implementation.
int fmtPrecSingle_
Single precision format decimals.
bool writef(PWP_INT size, char pad, const char *fmt,...)
Writes a formatted string value.
virtual ~PwpWriterInterface()
Destructor.
virtual void setFmtType(FormatType type)
default implementation.
int fmtPrecDouble_
Double precision format decimals.
FormatType fmtType_
Formatting flags.
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.
Pointwise Plugin API (PWP-API)
FormatType
Formatted output types for floating point values.
virtual void setFmtFieldSingle(const int width, const int prec)
default implementation.
@ FormatPrecF
Format "%.*f".
bool writef(const char *fmt,...)
Writes a formatted string value.
virtual bool beginRecord(PWP_UINT32, PWP_UINT32=1)
NOP default implementation.
The abstract PwpWriterInterface class.