a class used to parse some basic oles Tries to read the different ole parts and stores their contents in form of picture. More...
#include <WPSOLEParser.h>
Public Member Functions | |
WPSOLEParser (const std::string &mainName) | |
constructor | |
~WPSOLEParser () | |
destructor | |
bool | parse (shared_ptr< libwps::Storage > fileInput) |
tries to parse basic OLE (excepted mainName) | |
std::vector< std::string > const & | getNotParse () const |
returns the list of unknown ole | |
std::vector< int > const & | getObjectsId () const |
returns the list of id for which we have find a representation | |
std::vector< WPSPosition > const & | getObjectsPosition () const |
returns the list of data positions which have been read | |
std::vector< WPXBinaryData > const & | getObjects () const |
returns the list of data which have been read | |
bool | getObject (int id, WPXBinaryData &obj, WPSPosition &pos) const |
returns the picture corresponding to an id | |
void | setObject (int id, WPXBinaryData const &obj, WPSPosition const &pos) |
sets an object just in case, the external parsing find another representation | |
Protected Member Functions | |
bool | readOle (WPXInputStreamPtr &ip, std::string const &oleName, libwps::DebugFile &ascii) |
the "Ole" small structure : unknown contain | |
bool | readMM (WPXInputStreamPtr &input, std::string const &oleName, libwps::DebugFile &ascii) |
the "MM" small structure : seems to contain the file versions | |
bool | readObjInfo (WPXInputStreamPtr &input, std::string const &oleName, libwps::DebugFile &ascii) |
the "ObjInfo" small structure : seems to contain 3 ints=0,3,4 | |
bool | readCompObj (WPXInputStreamPtr &ip, std::string const &oleName, libwps::DebugFile &ascii) |
the "CompObj" contains : UserType,ClipName,ProgIdName | |
bool | isOlePres (WPXInputStreamPtr &ip, std::string const &oleName) |
the OlePres001 seems to contain standart picture file and size | |
bool | readOlePres (WPXInputStreamPtr &ip, WPXBinaryData &data, WPSPosition &pos, libwps::DebugFile &ascii) |
extracts the picture of OlePres001 if it is possible | |
bool | isOle10Native (WPXInputStreamPtr &ip, std::string const &oleName) |
theOle10Native : basic Windows© picture, with no size | |
bool | readOle10Native (WPXInputStreamPtr &ip, WPXBinaryData &data, libwps::DebugFile &ascii) |
extracts the picture if it is possible | |
bool | readContents (WPXInputStreamPtr &input, std::string const &oleName, WPXBinaryData &pict, WPSPosition &pos, libwps::DebugFile &ascii) |
the Contents : in general a picture : a PNG, an JPEG, a basic metafile, I find also a Word art picture, which are not sucefully read | |
bool | readCONTENTS (WPXInputStreamPtr &input, std::string const &oleName, WPXBinaryData &pict, WPSPosition &pos, libwps::DebugFile &ascii) |
the CONTENTS : seems to store a header size, the header and then a object in EMF (with the same header)... | |
Protected Attributes | |
std::string | m_avoidOLE |
if filled, does not parse content with this name | |
std::vector< std::string > | m_unknownOLEs |
list of ole which can not be parsed | |
std::vector< WPXBinaryData > | m_objects |
list of pictures read | |
std::vector< WPSPosition > | m_objectsPosition |
list of picture size ( if known) | |
std::vector< int > | m_objectsId |
list of pictures id | |
shared_ptr < WPSOLEParserInternal::CompObj > | m_compObjIdName |
a smart ptr used to stored the list of compobj id->name |
a class used to parse some basic oles Tries to read the different ole parts and stores their contents in form of picture.
WPSOLEParser::WPSOLEParser | ( | const std::string & | mainName | ) |
constructor
mainName,: | name of the main ole, we must avoid to parse |
destructor
std::vector<std::string> const& WPSOLEParser::getNotParse | ( | ) | const [inline] |
returns the list of unknown ole
Referenced by WPS4Parser::createOLEStructures().
bool WPSOLEParser::getObject | ( | int | id, |
WPXBinaryData & | obj, | ||
WPSPosition & | pos | ||
) | const |
returns the picture corresponding to an id
std::vector<WPXBinaryData> const& WPSOLEParser::getObjects | ( | ) | const [inline] |
returns the list of data which have been read
Referenced by WPS4Parser::createOLEStructures().
std::vector<int> const& WPSOLEParser::getObjectsId | ( | ) | const [inline] |
returns the list of id for which we have find a representation
Referenced by WPS4Parser::createOLEStructures().
std::vector<WPSPosition> const& WPSOLEParser::getObjectsPosition | ( | ) | const [inline] |
returns the list of data positions which have been read
Referenced by WPS4Parser::createOLEStructures().
bool WPSOLEParser::isOle10Native | ( | WPXInputStreamPtr & | ip, |
std::string const & | oleName | ||
) | [protected] |
theOle10Native : basic Windows© picture, with no size
Referenced by parse(), and readOle10Native().
bool WPSOLEParser::isOlePres | ( | WPXInputStreamPtr & | ip, |
std::string const & | oleName | ||
) | [protected] |
the OlePres001 seems to contain standart picture file and size
Referenced by parse(), and readOlePres().
bool WPSOLEParser::parse | ( | shared_ptr< libwps::Storage > | fileInput | ) |
tries to parse basic OLE (excepted mainName)
Referenced by WPS4Parser::createOLEStructures().
bool WPSOLEParser::readCompObj | ( | WPXInputStreamPtr & | ip, |
std::string const & | oleName, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
the "CompObj" contains : UserType,ClipName,ProgIdName
Referenced by parse().
bool WPSOLEParser::readContents | ( | WPXInputStreamPtr & | input, |
std::string const & | oleName, | ||
WPXBinaryData & | pict, | ||
WPSPosition & | pos, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
the Contents : in general a picture : a PNG, an JPEG, a basic metafile, I find also a Word art picture, which are not sucefully read
Referenced by parse().
bool WPSOLEParser::readCONTENTS | ( | WPXInputStreamPtr & | input, |
std::string const & | oleName, | ||
WPXBinaryData & | pict, | ||
WPSPosition & | pos, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
the CONTENTS : seems to store a header size, the header and then a object in EMF (with the same header)...
Referenced by parse().
bool WPSOLEParser::readMM | ( | WPXInputStreamPtr & | input, |
std::string const & | oleName, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
the "MM" small structure : seems to contain the file versions
Referenced by parse().
bool WPSOLEParser::readObjInfo | ( | WPXInputStreamPtr & | input, |
std::string const & | oleName, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
the "ObjInfo" small structure : seems to contain 3 ints=0,3,4
Referenced by parse().
bool WPSOLEParser::readOle | ( | WPXInputStreamPtr & | ip, |
std::string const & | oleName, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
the "Ole" small structure : unknown contain
Referenced by parse().
bool WPSOLEParser::readOle10Native | ( | WPXInputStreamPtr & | ip, |
WPXBinaryData & | data, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
extracts the picture if it is possible
Referenced by parse().
bool WPSOLEParser::readOlePres | ( | WPXInputStreamPtr & | ip, |
WPXBinaryData & | data, | ||
WPSPosition & | pos, | ||
libwps::DebugFile & | ascii | ||
) | [protected] |
extracts the picture of OlePres001 if it is possible
Referenced by parse().
void WPSOLEParser::setObject | ( | int | id, |
WPXBinaryData const & | obj, | ||
WPSPosition const & | pos | ||
) |
sets an object just in case, the external parsing find another representation
std::string WPSOLEParser::m_avoidOLE [protected] |
if filled, does not parse content with this name
Referenced by parse().
shared_ptr<WPSOLEParserInternal::CompObj> WPSOLEParser::m_compObjIdName [protected] |
a smart ptr used to stored the list of compobj id->name
Referenced by parse(), and readCompObj().
std::vector<WPXBinaryData> WPSOLEParser::m_objects [protected] |
list of pictures read
Referenced by getObject(), getObjects(), parse(), and setObject().
std::vector<int> WPSOLEParser::m_objectsId [protected] |
list of pictures id
Referenced by getObject(), getObjectsId(), parse(), and setObject().
std::vector<WPSPosition> WPSOLEParser::m_objectsPosition [protected] |
list of picture size ( if known)
Referenced by getObject(), getObjectsPosition(), parse(), and setObject().
std::vector<std::string> WPSOLEParser::m_unknownOLEs [protected] |
list of ole which can not be parsed
Referenced by getNotParse(), and parse().