QXPMacFileParser.h Source File documentation

QXPMacFileParser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libqxp project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef QXPMACSTREAM_H_INCLUDED
11 #define QXPMACSTREAM_H_INCLUDED
12
13 #include <memory>
14 #include <string>
15
16 #include <librevenge-stream/librevenge-stream.h>
17
18 namespace libqxp
19 {
20
21 class QXPMacFileParser
22 {
23 public:
24 QXPMacFileParser(std::shared_ptr<librevenge::RVNGInputStream> &dataFork, std::string &type, std::string &creator);
25
26 bool parse(const std::shared_ptr<librevenge::RVNGInputStream> &input);
27
28 private:
29 std::shared_ptr<librevenge::RVNGInputStream> &m_dataFork;
30 std::string &m_type;
31 std::string &m_creator;
32 };
33
34 }
35
36 #endif
37
38 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libqxp::MWAWInputStream::m_prevLimits
std::vector< long > m_prevLimits
list of previous limits
Definition: QXPMacFileParser.cpp:230
libqxp::MWAWInputStream::input
std::shared_ptr< librevenge::RVNGInputStream > input()
returns the basic librevenge::RVNGInputStream
Definition: QXPMacFileParser.cpp:51
libqxp::MWAWInputStream::readDouble10
bool readDouble10(double &res, bool &isNotANumber)
try to read a double of size 10: 2 bytes exponent, 8 bytes mantisse
Definition: QXPMacFileParser.cpp:493
libqxp::MWAWInputStream::hasResourceFork
bool hasResourceFork() const
returns true if the resource fork block exists
Definition: QXPMacFileParser.cpp:187
libqxp::FileAccessError
Definition: libqxp_utils.h:138
libqxp::MWAWInputStream::updateStreamSize
void updateStreamSize()
update the stream size ( must be called in the constructor )
Definition: QXPMacFileParser.cpp:306
libqxp::MWAWInputStream::unBinHex
bool unBinHex()
unbinhex the data in the file is a BinHex 4.0 file of a mac file
Definition: QXPMacFileParser.cpp:593
libqxp::QXPMacFileParser::m_dataFork
std::shared_ptr< librevenge::RVNGInputStream > & m_dataFork
Definition: QXPMacFileParser.h:29
libqxp::QXPMacFileParser::m_creator
std::string & m_creator
Definition: QXPMacFileParser.h:31
libqxp::QXPMacFileParser
Definition: QXPMacFileParser.h:21
libqxp::QXPMacFileParser::parse
bool parse(const std::shared_ptr< librevenge::RVNGInputStream > &input)
Definition: QXPMacFileParser.cpp:1240
libqxp::MWAWInputStream::readLong
long readLong(int num)
return a int8, int16, int32 readed from actualPos
Definition: QXPMacFileParser.cpp:415
libqxp::MWAWInputStream::m_resourceFork
std::shared_ptr< MWAWInputStream > m_resourceFork
the resource fork
Definition: QXPMacFileParser.cpp:237
libqxp::MWAWInputStream::readDoubleReverted8
bool readDoubleReverted8(double &res, bool &isNotANumber)
try to read a double of size 8: 6.5 bytes mantisse, 1.5 bytes exponent
Definition: QXPMacFileParser.cpp:539
libqxp::MWAWInputStream::isStructured
bool isStructured()
return true if the stream is ole
Definition: QXPMacFileParser.cpp:1117
libqxp::MWAWInputStream::hasDataFork
bool hasDataFork() const
returns true if the data fork block exists
Definition: QXPMacFileParser.cpp:182
libqxp
Definition: libqxp_utils.cpp:24
libqxp::MWAWInputStream::unzipStream
bool unzipStream()
unzip the data in the file is a zip file of a mac file
Definition: QXPMacFileParser.cpp:888
libqxp::MWAWInputStream::m_streamSize
long m_streamSize
the stream size
Definition: QXPMacFileParser.cpp:225
libqxp::MWAWInputStream::unsplitInternalMergeStream
bool unsplitInternalMergeStream()
check if a stream is an internal merge stream
Definition: QXPMacFileParser.cpp:804
libqxp::QXPMacFileParser::QXPMacFileParser
QXPMacFileParser(std::shared_ptr< librevenge::RVNGInputStream > &dataFork, std::string &type, std::string &creator)
Definition: QXPMacFileParser.cpp:1233
libqxp::MWAWInputStream::getFinderInfo
bool getFinderInfo(std::string &type, std::string &creator) const
returns the finder info type and creator (if known)
Definition: QXPMacFileParser.cpp:165
libqxp::MWAWInputStream::readU8
static uint8_t readU8(librevenge::RVNGInputStream *stream)
internal function used to read a byte
Definition: QXPMacFileParser.cpp:434
libqxp::MWAWInputStream::~MWAWInputStream
~MWAWInputStream()
destructor
Definition: QXPMacFileParser.cpp:280
libqxp::MWAWInputStream::setReadInverted
void setReadInverted(bool newVal)
sets the endian mode
Definition: QXPMacFileParser.cpp:64
libqxp::MWAWInputStream::subStreamCount
unsigned subStreamCount()
returns the number of substream
Definition: QXPMacFileParser.cpp:1126
libqxp::MWAWInputStream::isEnd
bool isEnd()
returns true if we are at the end of the section/file
Definition: QXPMacFileParser.cpp:357
libqxp::MWAWInputStream::readInverted
bool readInverted() const
returns the endian mode (see constructor)
Definition: QXPMacFileParser.cpp:59
libqxp_utils.h
QXPMemoryStream.h
libqxp::MWAWInputStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
seeks to a offset position, from actual, beginning or ending position
Definition: QXPMacFileParser.cpp:333
libqxp::MWAWInputStream::size
long size() const
returns the stream size
Definition: QXPMacFileParser.cpp:80
libqxp::MWAWInputStream::readDouble8
bool readDouble8(double &res, bool &isNotANumber)
try to read a double of size 8: 1.5 bytes exponent, 6.5 bytes mantisse
Definition: QXPMacFileParser.cpp:447
libqxp::MWAWInputStream::checkPosition
bool checkPosition(long pos) const
checks if a position is or not a valid file position
Definition: QXPMacFileParser.cpp:85
libqxp::MWAWInputStream::getSubStreamById
std::shared_ptr< MWAWInputStream > getSubStreamById(unsigned id)
return a new stream for a ole zone
Definition: QXPMacFileParser.cpp:1173
libqxp::MWAWInputStream::tell
long tell()
returns actual offset position
Definition: QXPMacFileParser.cpp:326
QXP_DEBUG_MSG
#define QXP_DEBUG_MSG(M)
Definition: libqxp_utils.h:53
libqxp::MWAWInputStream::get
static std::shared_ptr< MWAWInputStream > get(librevenge::RVNGBinaryData const &data, bool inverted)
returns a new input stream corresponding to a librevenge::RVNGBinaryData
Definition: QXPMacFileParser.cpp:284
libqxp::MWAWInputStream::m_fInfoType
std::string m_fInfoType
finder info type
Definition: QXPMacFileParser.cpp:233
libqxp::MWAWInputStream::m_stream
std::shared_ptr< librevenge::RVNGInputStream > m_stream
the initial input
Definition: QXPMacFileParser.cpp:223
QXPMacFileParser.h
libqxp::QXPDummyDeleter
Definition: libqxp_utils.h:62
libqxp::MWAWInputStream::getResourceForkStream
std::shared_ptr< MWAWInputStream > getResourceForkStream()
returns the resource fork if find
Definition: QXPMacFileParser.cpp:192
libqxp::MWAWInputStream::readEndDataBlock
bool readEndDataBlock(librevenge::RVNGBinaryData &data)
reads a librevenge::RVNGBinaryData from actPos to the end of the section/file
Definition: QXPMacFileParser.cpp:1219
libqxp::MWAWInputStream::popLimit
void popLimit()
pops a section defined by pushLimit
Definition: QXPMacFileParser.cpp:103
libqxp::MWAWInputStream::readDataBlock
bool readDataBlock(long size, librevenge::RVNGBinaryData &data)
reads a librevenge::RVNGBinaryData with a given size in the actual section/file
Definition: QXPMacFileParser.cpp:1200
libqxp::MWAWInputStream::MWAWInputStream
MWAWInputStream(std::shared_ptr< librevenge::RVNGInputStream > input, bool inverted)
creates a stream with given endian
Definition: QXPMacFileParser.cpp:242
libqxp::MWAWInputStream::subStreamName
std::string subStreamName(unsigned id)
returns the name of the i^th substream
Definition: QXPMacFileParser.cpp:1136
libqxp::MWAWInputStream::getSubStreamByName
std::shared_ptr< MWAWInputStream > getSubStreamByName(std::string const &name)
return a new stream for a ole zone
Definition: QXPMacFileParser.cpp:1152
libqxp::QXPMemoryStream
Definition: QXPMemoryStream.h:20
libqxp::MWAWInputStream
Internal class used to read the file stream Internal class used to read the file stream,...
Definition: QXPMacFileParser.cpp:33
libqxp::MWAWInputStream::m_fInfoCreator
std::string m_fInfoCreator
finder info type
Definition: QXPMacFileParser.cpp:235
libqxp::MWAWInputStream::operator=
MWAWInputStream & operator=(MWAWInputStream const &orig)=delete
libqxp::MWAWInputStream::read
const uint8_t * read(size_t numBytes, unsigned long &numBytesRead)
! reads numbytes data, WITHOUT using any endian or section consideration
Definition: QXPMacFileParser.cpp:319
libqxp::MWAWInputStream::pushLimit
void pushLimit(long newLimit)
defines a new section in the file (from actualPos to newLimit) next call of seek, tell,...
Definition: QXPMacFileParser.cpp:97
libqxp::QXPMacFileParser::m_type
std::string & m_type
Definition: QXPMacFileParser.h:30
libqxp::MWAWInputStream::readULong
unsigned long readULong(int num)
returns a uint8, uint16, uint32 readed from actualPos
Definition: QXPMacFileParser.cpp:118
libqxp::MWAWInputStream::m_inverseRead
bool m_inverseRead
big or normal endian
Definition: QXPMacFileParser.cpp:239
libqxp::MWAWInputStream::unMacMIME
bool unMacMIME()
check if some stream are in MacMIME format, if so de MacMIME
Definition: QXPMacFileParser.cpp:936
libqxp::MWAWInputStream::m_readLimit
long m_readLimit
actual section limit (-1 if no limit)
Definition: QXPMacFileParser.cpp:228