libemf 1.0.9
EMF::DATASTREAM Class Reference

Support different endian modes when reading and writing the metafile. More...

#include <libemf.h>

Public Member Functions

 DATASTREAM (::FILE *fp=0)
 
void setStream (::FILE *fp)
 
DATASTREAMoperator<< (const BYTE &byte)
 
DATASTREAMoperator>> (BYTE &byte)
 
DATASTREAMoperator<< (const WORD &word)
 
DATASTREAMoperator>> (WORD &word)
 
DATASTREAMoperator<< (const INT16 &word)
 
DATASTREAMoperator>> (INT16 &word)
 
DATASTREAMoperator<< (const DWORD &dword)
 
DATASTREAMoperator>> (DWORD &dword)
 
DATASTREAMoperator<< (const LONG &long_)
 
DATASTREAMoperator>> (LONG &long_)
 
DATASTREAMoperator<< (const INT &int_)
 
DATASTREAMoperator>> (INT &int_)
 
DATASTREAMoperator<< (const UINT &uint)
 
DATASTREAMoperator>> (UINT &uint)
 
DATASTREAMoperator<< (const FLOAT &float_)
 
DATASTREAMoperator>> (FLOAT &float_)
 
DATASTREAMoperator<< (const PADDING &padding)
 
DATASTREAMoperator<< (const RECTL &rectl)
 
DATASTREAMoperator>> (RECTL &rectl)
 
DATASTREAMoperator<< (const SIZEL &sizel)
 
DATASTREAMoperator>> (SIZEL &sizel)
 
DATASTREAMoperator<< (const WCHARSTR &wcharstr)
 
DATASTREAMoperator>> (WCHARSTR &wcharstr)
 
DATASTREAMoperator<< (const CHARSTR &charstr)
 
DATASTREAMoperator>> (CHARSTR &charstr)
 
DATASTREAMoperator<< (const ::EMR &emr)
 
DATASTREAMoperator>> (::EMR &emr)
 
DATASTREAMoperator<< (const POINT &point)
 
DATASTREAMoperator>> (POINT &point)
 
DATASTREAMoperator<< (const POINTL &pointl)
 
DATASTREAMoperator>> (POINTL &pointl)
 
DATASTREAMoperator<< (const POINT16 &point)
 
DATASTREAMoperator>> (POINT16 &point)
 
DATASTREAMoperator<< (const XFORM &xform)
 
DATASTREAMoperator>> (XFORM &xform)
 
DATASTREAMoperator<< (const BYTEARRAY &array)
 
DATASTREAMoperator>> (BYTEARRAY &array)
 
DATASTREAMoperator<< (const POINTLARRAY &array)
 
DATASTREAMoperator>> (POINTLARRAY &array)
 
DATASTREAMoperator<< (const POINT16ARRAY &array)
 
DATASTREAMoperator>> (POINT16ARRAY &array)
 
DATASTREAMoperator<< (const INTARRAY &array)
 
DATASTREAMoperator>> (INTARRAY &array)
 
DATASTREAMoperator<< (const DWORDARRAY &array)
 
DATASTREAMoperator>> (DWORDARRAY &array)
 
DATASTREAMoperator<< (const ::EMRTEXT &text)
 
DATASTREAMoperator>> (::EMRTEXT &text)
 
DATASTREAMoperator<< (const LOGPEN &pen)
 
DATASTREAMoperator>> (LOGPEN &pen)
 
DATASTREAMoperator<< (const EXTLOGPEN &pen)
 
DATASTREAMoperator>> (EXTLOGPEN &pen)
 
DATASTREAMoperator<< (const LOGBRUSH &brush)
 
DATASTREAMoperator>> (LOGBRUSH &brush)
 
DATASTREAMoperator<< (const LOGFONTW &font)
 
DATASTREAMoperator>> (LOGFONTW &font)
 
DATASTREAMoperator<< (const PANOSE &panose)
 
DATASTREAMoperator>> (PANOSE &panose)
 
DATASTREAMoperator<< (const EXTLOGFONTW &font)
 
DATASTREAMoperator>> (EXTLOGFONTW &font)
 
DATASTREAMoperator<< (const LOGPALETTE &palette)
 
DATASTREAMoperator>> (LOGPALETTE &palette)
 

Detailed Description

Support different endian modes when reading and writing the metafile.

To support different endian modes, rather than just writing the structures directly to a file via fwrite( &emr, ...), we have to write each element of the structure separately, swapping bytes as necessary. datastream supports this. Remarkably similar to the QDataStream class from Qt. So, too, for reading.

Constructor & Destructor Documentation

◆ DATASTREAM()

EMF::DATASTREAM::DATASTREAM ( ::FILE * fp = 0)
inline

Constructor for DATASTREAM.

Parameters
fpoptional file pointer (but must be assigned before any output occurs.)

Member Function Documentation

◆ operator<<() [1/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const ::EMR & emr)
inline

Output an Enhanced Metafile Record header.

Parameters
emrEnhanced Metafile Record header to output.

◆ operator<<() [2/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const ::EMRTEXT & text)
inline

Output an Enhanced Metafile Text Record.

Parameters
textEnhanced Metafile Text Record to output.

◆ operator<<() [3/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const BYTE & byte)
inline

Output a byte to the stream (not swabbed or anything).

Parameters
bytebyte to output.

◆ operator<<() [4/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const BYTEARRAY & array)
inline

Output an array of BYTEs.

Parameters
arrayarray of BYTEs to output.

References EMF::BYTEARRAY::array_, and EMF::BYTEARRAY::n_.

◆ operator<<() [5/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const CHARSTR & charstr)
inline

Output a single byte character string.

Parameters
charstrstructure to output.

References EMF::CHARSTR::length_, and EMF::CHARSTR::string_.

◆ operator<<() [6/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const DWORD & dword)
inline

Output a double word (long) to the stream (swabbed).

Parameters
dworddouble word (long) to output.

◆ operator<<() [7/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const DWORDARRAY & array)
inline

Output an array of double words (longs).

Parameters
arrayarray of double words (longs) to output.

References EMF::DWORDARRAY::dwords_, and EMF::DWORDARRAY::n_.

◆ operator<<() [8/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const EXTLOGFONTW & font)
inline

Output an Extended Logical Font definition (using WCHAR strings).

Parameters
fontExtended Logical Font definition to output.

◆ operator<<() [9/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const EXTLOGPEN & pen)
inline

Output an Extended Logical Pen definition.

Parameters
penExtended Logical Pen definition to output.

◆ operator<<() [10/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const FLOAT & float_)
inline

Output a single precision float to the stream (swabbed).

Parameters
float_single precision float to output.

◆ operator<<() [11/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const INT & int_)
inline

Output a (long) int to the stream (swabbed).

Parameters
int_(long) int to output.

◆ operator<<() [12/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const INT16 & word)
inline

Output a (short, 16-bit) word to the stream (swabbed).

Parameters
word(short, 16-bit) word to output.

◆ operator<<() [13/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const INTARRAY & array)
inline

Output an array of (long) ints.

Parameters
arrayarray of (long) ints to output.

References EMF::INTARRAY::ints_, and EMF::INTARRAY::n_.

◆ operator<<() [14/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const LOGBRUSH & brush)
inline

Output a Logical Brush definition.

Parameters
brushLogical Brush definition to output.

◆ operator<<() [15/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const LOGFONTW & font)
inline

Output a Logical Font definition (using WCHAR strings).

Parameters
fontLogical Font definition to output.

◆ operator<<() [16/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const LOGPALETTE & palette)
inline

Output a Logical Palette.

Parameters
paletteLogical Palette to output.

◆ operator<<() [17/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const LOGPEN & pen)
inline

Output a Logical Pen definition.

Parameters
penLogical Pen definition to output.

◆ operator<<() [18/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const LONG & long_)
inline

Output a long int to the stream (swabbed).

Parameters
long_long int to output.

◆ operator<<() [19/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const PADDING & padding)
inline

Output a series of '\0's to pad out a record.

Parameters
paddingsimple padding structure (length and number of nulls).

References EMF::PADDING::padding_, and EMF::PADDING::size_.

◆ operator<<() [20/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const PANOSE & panose)
inline

Output a Panose structure.

Parameters
panosePanose structure to output.

◆ operator<<() [21/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const POINT & point)
inline

Output a POINT structure.

Parameters
pointPOINT to output.

◆ operator<<() [22/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const POINT16 & point)
inline

Output a POINT16 structure.

Parameters
pointPOINT16 to output.

◆ operator<<() [23/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const POINT16ARRAY & array)
inline

Output an array of POINT16s.

Parameters
arrayarray of POINT16s to output.

References EMF::POINT16ARRAY::n_, and EMF::POINT16ARRAY::points_.

◆ operator<<() [24/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const POINTL & pointl)
inline

Output a POINTL structure.

Parameters
pointlPOINTL to output.

◆ operator<<() [25/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const POINTLARRAY & array)
inline

Output an array of POINTLs.

Parameters
arrayarray of POINTLs to output.

References EMF::POINTLARRAY::n_, and EMF::POINTLARRAY::points_.

◆ operator<<() [26/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const RECTL & rectl)
inline

Output a RECTL structure.

Parameters
rectlstructure to output.

◆ operator<<() [27/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const SIZEL & sizel)
inline

Output a SIZEL structure.

Parameters
sizelstructure to output.

◆ operator<<() [28/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const UINT & uint)
inline

Output a (long) unsigned int to the stream (swabbed).

Parameters
uint(long) unsigned int to output.

◆ operator<<() [29/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const WCHARSTR & wcharstr)
inline

Output a WCHAR string (note: the individual characters are swabbed).

Parameters
wcharstrstructure to output.

References EMF::WCHARSTR::length_, and EMF::WCHARSTR::string_.

◆ operator<<() [30/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const WORD & word)
inline

Output a (short) word to the stream (swabbed).

Parameters
word(short) word to output.

◆ operator<<() [31/31]

DATASTREAM & EMF::DATASTREAM::operator<< ( const XFORM & xform)
inline

Output an XFORM structure.

Parameters
xformXFORM to output.

◆ operator>>() [1/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( ::EMR & emr)
inline

Input an Enhanced Metafile Record header.

Parameters
emrdestination of Enhanced Metafile Record header.

◆ operator>>() [2/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( ::EMRTEXT & text)
inline

Input an Enhanced Metafile Text Record.

Parameters
textdestination of Enhanced Metafile Text Record.

◆ operator>>() [3/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( BYTE & byte)
inline

Input a byte from the stream (not swabbed or anything).

Parameters
bytedestination for input byte.

◆ operator>>() [4/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( BYTEARRAY & array)
inline

Input an array of BYTEs.

Parameters
arraydestination of array of input BYTEs.

References EMF::BYTEARRAY::array_, and EMF::BYTEARRAY::n_.

◆ operator>>() [5/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( CHARSTR & charstr)
inline

Input a single byte character string.

Parameters
charstrdestination of input CHAR string.

References EMF::CHARSTR::length_, and EMF::CHARSTR::string_.

◆ operator>>() [6/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( DWORD & dword)
inline

Input a double word (long) from the stream (swabbed).

Parameters
dworddestination for double word (long).

◆ operator>>() [7/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( DWORDARRAY & array)
inline

Input an array of double words (longs).

Parameters
arraydestination of array of input double words (longs).

References EMF::DWORDARRAY::dwords_, and EMF::DWORDARRAY::n_.

◆ operator>>() [8/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( EXTLOGFONTW & font)
inline

Input an Extended Logical Font definition (using WCHAR strings).

Parameters
fontdestination of Extended Logical Font definition.

◆ operator>>() [9/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( EXTLOGPEN & pen)
inline

Input an Extended Logical Pen definition.

Parameters
pendestination of Extended Logical Pen definition.

◆ operator>>() [10/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( FLOAT & float_)
inline

Input a single precision float from the stream (swabbed).

Parameters
float_destination for single precision float.

◆ operator>>() [11/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( INT & int_)
inline

Input a (long) int from the stream (swabbed).

Parameters
int_destination for (long) int.

◆ operator>>() [12/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( INT16 & word)
inline

Input a (short, 16-bit) word from the stream (swabbed).

Parameters
worddestination for (short, 16-bit) word.

◆ operator>>() [13/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( INTARRAY & array)
inline

Input an array of (long) ints.

Parameters
arraydestination of array of input (long) ints.

References EMF::INTARRAY::ints_, and EMF::INTARRAY::n_.

◆ operator>>() [14/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( LOGBRUSH & brush)
inline

Input a Logical Brush definition.

Parameters
brushdestination of Logical Brush definition.

◆ operator>>() [15/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( LOGFONTW & font)
inline

Input a Logical Font definition (using WCHAR strings).

Parameters
fontdestination of Logical Font definition.

◆ operator>>() [16/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( LOGPALETTE & palette)
inline

Input a Logical Palette.

Parameters
palettedestination of input Logical Palette.

◆ operator>>() [17/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( LOGPEN & pen)
inline

Input a Logical Pen definition.

Parameters
pendestination of Logical Pen definition.

◆ operator>>() [18/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( LONG & long_)
inline

Input a long int from the stream (swabbed).

Parameters
long_destination for long int.

◆ operator>>() [19/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( PANOSE & panose)
inline

Input a Panose structure.

Parameters
panosedestinatino of input Panose structure.

◆ operator>>() [20/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( POINT & point)
inline

Input a POINT structure.

Parameters
pointdestination of input POINT.

◆ operator>>() [21/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( POINT16 & point)
inline

Input a POINT16 structure.

Parameters
pointdestination of input POINT16.

◆ operator>>() [22/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( POINT16ARRAY & array)
inline

Input an array of POINT16s.

Parameters
arraydestination of array of input POINT16s.

References EMF::POINT16ARRAY::n_, and EMF::POINT16ARRAY::points_.

◆ operator>>() [23/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( POINTL & pointl)
inline

Input a POINTL structure.

Parameters
pointldestination of input POINTL.

◆ operator>>() [24/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( POINTLARRAY & array)
inline

Input an array of POINTLs.

Parameters
arraydestination of array of input POINTLs.

References EMF::POINTLARRAY::n_, and EMF::POINTLARRAY::points_.

◆ operator>>() [25/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( RECTL & rectl)
inline

Input a RECTL structure.

Parameters
rectldestination of input RECTL.

◆ operator>>() [26/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( SIZEL & sizel)
inline

Input a SIZEL structure.

Parameters
sizeldestination of input SIZEL.

◆ operator>>() [27/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( UINT & uint)
inline

Input a (long) unsigned int from the stream (swabbed).

Parameters
uintdestination for (long) unsigned int.

◆ operator>>() [28/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( WCHARSTR & wcharstr)
inline

Input a WCHAR string (note: the individual characters are swabbed.)

Parameters
wcharstrdestination of input WCHAR string.

References EMF::WCHARSTR::length_, and EMF::WCHARSTR::string_.

◆ operator>>() [29/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( WORD & word)
inline

Input a (short) word from the stream (swabbed).

Parameters
worddestination for (short) word.

◆ operator>>() [30/30]

DATASTREAM & EMF::DATASTREAM::operator>> ( XFORM & xform)
inline

Input an XFORM structure.

Parameters
xformdestination of input XFORM.

◆ setStream()

void EMF::DATASTREAM::setStream ( ::FILE * fp)
inline

Use the given FILE stream as the input/output destination.

Parameters
fpfile point for i/o.

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