Internal class used to read the file stream Internal class used to read the file stream, this class adds some usefull functions to the basic WPXInputStream: More...
#include <MWAWInputStream.hxx>
Public Member Functions | |
MWAWInputStream (shared_ptr< WPXInputStream > inp, bool inverted) | |
creates a stream with given endian from More... | |
MWAWInputStream (WPXInputStream *input, bool inverted, bool checkCompression=false) | |
creates a stream with given endian from an existing input More... | |
~MWAWInputStream () | |
destructor More... | |
shared_ptr< WPXInputStream > | input () |
returns the basic WPXInputStream More... | |
bool | readInverted () const |
returns the endian mode (see constructor) More... | |
void | setReadInverted (bool newVal) |
sets the endian mode More... | |
int | seek (long offset, WPX_SEEK_TYPE seekType) |
seeks to a offset position, from actual or beginning position More... | |
long | tell () |
returns actual offset position More... | |
long | size () const |
returns the stream size More... | |
bool | checkPosition (long pos) const |
checks if a position is or not a valid file position More... | |
bool | atEOS () |
returns true if we are at the end of the section/file More... | |
void | pushLimit (long newLimit) |
defines a new section in the file (from actualPos to newLimit) next call of seek, tell, atEos, ... will be restrained to this section More... | |
void | popLimit () |
pops a section defined by pushLimit More... | |
unsigned long | readULong (int num) |
returns a uint8, uint16, uint32 readed from actualPos More... | |
long | readLong (int num) |
return a int8, int16, int32 readed from actualPos More... | |
bool | readDouble (double &res, bool &isNotANumber) |
try to read a double (ppc) More... | |
const uint8_t * | read (size_t numBytes, unsigned long &numBytesRead) |
! reads numbytes data, WITHOUT using any endian or section consideration More... | |
bool | readDataBlock (long size, WPXBinaryData &data) |
reads a WPXBinaryData with a given size in the actual section/file More... | |
bool | readEndDataBlock (WPXBinaryData &data) |
reads a WPXBinaryData from actPos to the end of the section/file More... | |
bool | isOLEStream () |
return true if the stream is ole More... | |
std::vector< std::string > | getOLENames () |
return the list of all ole zone More... | |
shared_ptr< MWAWInputStream > | getDocumentOLEStream (std::string name) |
return a new stream for a ole zone More... | |
bool | getFinderInfo (std::string &type, std::string &creator) const |
returns the finder info type and creator (if known) More... | |
bool | hasDataFork () const |
returns true if the data fork block exists More... | |
bool | hasResourceFork () const |
returns true if the resource fork block exists More... | |
shared_ptr< MWAWInputStream > | getResourceForkStream () |
returns the resource fork if find More... | |
Static Public Member Functions | |
static shared_ptr < MWAWInputStream > | get (WPXBinaryData const &data, bool inverted) |
returns a new input stream corresponding to a WPXBinaryData More... | |
static unsigned long | readULong (WPXInputStream *stream, int num, unsigned long a, bool inverseRead) |
internal function used to read num byte, More... | |
Protected Member Functions | |
void | updateStreamSize () |
update the stream size ( must be called in the constructor ) More... | |
bool | createStorageOLE () |
creates a storage ole More... | |
bool | unBinHex () |
unbinhex the data in the file is a BinHex 4.0 file of a mac file More... | |
bool | unzipStream () |
unzip the data in the file is a zip file of a mac file More... | |
bool | unMacMIME () |
check if some stream are in MacMIME format, if so de MacMIME More... | |
bool | unMacMIME (MWAWInputStream *input, shared_ptr< WPXInputStream > &dataInput, shared_ptr< WPXInputStream > &rsrcInput) const |
de MacMIME an input stream More... | |
Static Protected Member Functions | |
static uint8_t | readU8 (WPXInputStream *stream) |
internal function used to read a byte More... | |
Protected Attributes | |
shared_ptr< WPXInputStream > | m_stream |
the initial input More... | |
long | m_streamSize |
the stream size More... | |
bool | m_inverseRead |
big or normal endian More... | |
long | m_readLimit |
actual section limit (-1 if no limit) More... | |
std::vector< long > | m_prevLimits |
list of previous limits More... | |
std::string | m_fInfoType |
finder info type More... | |
std::string | m_fInfoCreator |
finder info type More... | |
shared_ptr< MWAWInputStream > | m_resourceFork |
the resource fork More... | |
shared_ptr< libmwawOLE::Storage > | m_storageOLE |
the ole storage More... | |
Private Member Functions | |
MWAWInputStream (MWAWInputStream const &orig) | |
MWAWInputStream & | operator= (MWAWInputStream const &orig) |
Internal class used to read the file stream Internal class used to read the file stream, this class adds some usefull functions to the basic WPXInputStream:
MWAWInputStream::MWAWInputStream | ( | shared_ptr< WPXInputStream > | inp, |
bool | inverted | ||
) |
creates a stream with given endian from
inp | |
inverted | must be set to true for pc doc and ole part |
inverted | must be set to false for mac doc |
Referenced by get(), getDocumentOLEStream(), unBinHex(), unMacMIME(), and unzipStream().
MWAWInputStream::MWAWInputStream | ( | WPXInputStream * | input, |
bool | inverted, | ||
bool | checkCompression = false |
||
) |
creates a stream with given endian from an existing input
Note: this functions does not delete input
MWAWInputStream::~MWAWInputStream | ( | ) |
destructor
|
private |
bool MWAWInputStream::atEOS | ( | ) |
returns true if we are at the end of the section/file
Referenced by libmwaw_applepict1::Bitmap::read(), libmwaw_applepict1::Pixmap::read(), libmwaw_applepict1::Bitmap::readBitmapData(), WNText::readParagraph(), WNText::readTable(), WNText::readTokenV2(), unBinHex(), and unMacMIME().
|
inline |
checks if a position is or not a valid file position
|
protected |
creates a storage ole
Referenced by getDocumentOLEStream(), getOLENames(), and isOLEStream().
|
static |
returns a new input stream corresponding to a WPXBinaryData
Referenced by HMWJText::computeNumPages(), libmwaw_applepict1::PictParser::convertToPict2(), MCDParser::createZones(), MWProStructures::createZones(), MWProStructures::createZonesV2(), HMWKParser::decodeZone(), LWGraph::findJPEGSize(), MWAWOLEParser::parse(), MWProParser::parseDataZone(), MWAWPictMac::parsePict1(), MWAWPictMac::parsePict2(), WNText::send(), NSGraph::sendPageGraphics(), LWGraph::sendPICT(), MCDParser::sendPicture(), EDParser::sendPicture(), NSGraph::sendPicture(), TTParser::sendPicture(), DMParser::sendPicture(), MWProParser::sendPicture(), HMWJText::sendText(), and FWStruct::Entry::update().
shared_ptr< MWAWInputStream > MWAWInputStream::getDocumentOLEStream | ( | std::string | name | ) |
return a new stream for a ole zone
|
inline |
returns the finder info type and creator (if known)
std::vector< std::string > MWAWInputStream::getOLENames | ( | ) |
return the list of all ole zone
|
inline |
returns the resource fork if find
Referenced by unBinHex().
|
inline |
returns true if the data fork block exists
Referenced by atEOS(), createStorageOLE(), read(), readDataBlock(), readEndDataBlock(), seek(), tell(), unBinHex(), unMacMIME(), and unzipStream().
|
inline |
returns true if the resource fork block exists
|
inline |
returns the basic WPXInputStream
bool MWAWInputStream::isOLEStream | ( | ) |
return true if the stream is ole
|
private |
|
inline |
pops a section defined by pushLimit
|
inline |
defines a new section in the file (from actualPos to newLimit) next call of seek, tell, atEos, ... will be restrained to this section
const uint8_t * MWAWInputStream::read | ( | size_t | numBytes, |
unsigned long & | numBytesRead | ||
) |
! reads numbytes data, WITHOUT using any endian or section consideration
Referenced by libmwaw_applepict1::Bitmap::readBitmapData(), libmwaw_applepict1::Pixmap::readPixmapData(), unBinHex(), and unMacMIME().
bool MWAWInputStream::readDataBlock | ( | long | size, |
WPXBinaryData & | data | ||
) |
reads a WPXBinaryData with a given size in the actual section/file
Referenced by readEndDataBlock().
bool MWAWInputStream::readDouble | ( | double & | res, |
bool & | isNotANumber | ||
) |
try to read a double (ppc)
bool MWAWInputStream::readEndDataBlock | ( | WPXBinaryData & | data | ) |
reads a WPXBinaryData from actPos to the end of the section/file
|
inline |
returns the endian mode (see constructor)
long MWAWInputStream::readLong | ( | int | num | ) |
return a int8, int16, int32 readed from actualPos
Referenced by libmwaw_applepict1::Region::read(), libmwaw_applepict1::Bitmap::read(), libmwaw_applepict1::ColorTable::read(), libmwaw_applepict1::Pixmap::read(), WNText::readFont(), libmwaw_applepict1::OpCode::readInt(), WNText::readParagraph(), WNText::readTable(), WNText::readToken(), WNText::readTokenV2(), and unBinHex().
|
staticprotected |
internal function used to read a byte
Referenced by readULong(), and unBinHex().
|
inline |
returns a uint8, uint16, uint32 readed from actualPos
Referenced by libmwaw_applepict1::OpCode::getSize(), libmwaw_applepict1::Region::read(), libmwaw_applepict1::Bitmap::read(), libmwaw_applepict1::ColorTable::read(), libmwaw_applepict1::Pixmap::read(), libmwaw_applepict1::Pixpattern::read(), libmwaw_applepict1::Bitmap::readBitmapData(), libmwaw_applepict1::OpCode::readCColor(), libmwaw_applepict1::OpCode::readColor(), readDouble(), WNText::readFont(), libmwaw_applepict1::OpCode::readInt(), readLong(), CWGraph::readOLE(), WNText::readParagraph(), libmwaw_applepict1::OpCode::readPattern(), libmwaw_applepict1::Pixmap::readPixmapData(), WNText::readTable(), libmwaw_applepict1::OpCode::readText(), WNText::readToken(), readULong(), libmwaw_applepict1::OpCode::readValue(), unBinHex(), and unMacMIME().
|
static |
internal function used to read num byte,
int MWAWInputStream::seek | ( | long | offset, |
WPX_SEEK_TYPE | seekType | ||
) |
seeks to a offset position, from actual or beginning position
Referenced by libmwaw_applepict1::OpCode::computeSize(), createStorageOLE(), getDocumentOLEStream(), libmwaw_applepict1::OpCode::getSize(), MWAWInputStream(), libmwaw_applepict1::Region::read(), libmwaw_applepict1::ColorTable::read(), libmwaw_applepict1::Pixmap::read(), libmwaw_applepict1::OpCode::readData(), libmwaw_applepict2::OpCode::readData(), readDouble(), WNText::readFont(), WNText::readParagraph(), WNText::readTable(), WNText::readToken(), WNText::readTokenV2(), libmwaw_applepict1::OpCode::readValue(), unBinHex(), unMacMIME(), and unzipStream().
|
inline |
sets the endian mode
|
inline |
returns the stream size
Referenced by atEOS(), readDataBlock(), readEndDataBlock(), seek(), unBinHex(), and unMacMIME().
long MWAWInputStream::tell | ( | ) |
returns actual offset position
Referenced by libmwaw_applepict1::OpCode::computeSize(), createStorageOLE(), getDocumentOLEStream(), libmwaw_applepict1::OpCode::getSize(), libmwaw_applepict1::Region::read(), libmwaw_applepict1::ColorTable::read(), libmwaw_applepict1::OpCode::readCColor(), libmwaw_applepict1::OpCode::readColor(), libmwaw_applepict1::OpCode::readData(), libmwaw_applepict2::OpCode::readData(), readDataBlock(), readDouble(), readEndDataBlock(), WNText::readFont(), libmwaw_applepict1::OpCode::readInt(), WNText::readParagraph(), libmwaw_applepict1::OpCode::readPattern(), WNText::readTable(), libmwaw_applepict1::OpCode::readText(), WNText::readToken(), WNText::readTokenV2(), seek(), unMacMIME(), and updateStreamSize().
|
protected |
unbinhex the data in the file is a BinHex 4.0 file of a mac file
Referenced by MWAWInputStream().
|
protected |
check if some stream are in MacMIME format, if so de MacMIME
Referenced by MWAWInputStream().
|
protected |
de MacMIME an input stream
|
protected |
unzip the data in the file is a zip file of a mac file
Referenced by MWAWInputStream().
|
protected |
update the stream size ( must be called in the constructor )
Referenced by MWAWInputStream().
|
mutableprotected |
finder info type
Referenced by getFinderInfo(), unBinHex(), and unMacMIME().
|
mutableprotected |
finder info type
Referenced by getFinderInfo(), unBinHex(), and unMacMIME().
|
protected |
big or normal endian
Referenced by getDocumentOLEStream(), readInverted(), readULong(), and setReadInverted().
|
protected |
list of previous limits
Referenced by popLimit(), and pushLimit().
|
protected |
actual section limit (-1 if no limit)
Referenced by atEOS(), checkPosition(), popLimit(), pushLimit(), readDataBlock(), readDouble(), readEndDataBlock(), and seek().
|
protected |
the resource fork
Referenced by getResourceForkStream(), hasResourceFork(), MWAWInputStream(), unBinHex(), unMacMIME(), and unzipStream().
|
protected |
the ole storage
Referenced by createStorageOLE(), getDocumentOLEStream(), getOLENames(), and isOLEStream().
|
protected |
the initial input
Referenced by atEOS(), createStorageOLE(), hasDataFork(), input(), MWAWInputStream(), read(), readDataBlock(), readDouble(), readULong(), seek(), tell(), unBinHex(), unMacMIME(), unzipStream(), and updateStreamSize().
|
protected |
the stream size
Referenced by checkPosition(), pushLimit(), readDouble(), seek(), size(), and updateStreamSize().