MWAWOLEParser Class Reference documentation

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
MWAWOLEParser Class Reference

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 <MWAWOLEParser.hxx>`

## Public Member Functions
| MWAWOLEParser (std::string const &mainName, MWAWFontConverterPtr const &fontConverter, int fontId)
| constructor
| ~MWAWOLEParser ()
| destructor
bool | parse (MWAWInputStreamPtr fileInput)
| tries to parse basic OLE (excepted mainName)
void | updateMetaData (librevenge::RVNGPropertyList &metaData) const
| update the meta data, using information find in SummaryInformation
int | getFontEncoding () const
| returns the font encoding find in SummaryInformation or -1
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< MWAWPosition > const & | getObjectsPosition () const
| returns the list of data positions which have been read
std::vector< librevenge::RVNGBinaryData > const & | getObjects () const
| returns the list of data which have been read
std::vector< std::string > const & | getObjectsType () const
| returns the list of data type
bool | getObject (int id, librevenge::RVNGBinaryData &obj, MWAWPosition &pos, std::string &type) const
| returns the picture corresponding to an id
void | setObject (int id, librevenge::RVNGBinaryData const &obj, MWAWPosition const &pos, std::string const &type)
| sets an object just in case, the external parsing find another representation
bool | readSummaryInformation (MWAWInputStreamPtr input, std::string const &oleName, int &encoding, librevenge::RVNGPropertyList &pList, libmwaw::DebugFile &ascii, long endPos=-1) const
| the summary information and the doc summary information

## Protected Member Functions
bool | readSummaryProperty (MWAWInputStreamPtr input, long endPos, int type, libmwaw::DebugFile &ascii, libmwaw::DebugStream &f) const
| try to read a summary property
bool | readSummaryPropertyString (MWAWInputStreamPtr input, long endPos, int type, librevenge::RVNGString &string, libmwaw::DebugStream &f) const
| try to read a summary property: type 1e
bool | readSummaryPropertyLong (MWAWInputStreamPtr input, long endPos, int type, long &value, libmwaw::DebugStream &f) const
| try to read a summary property: type 2,3,9,12,
bool | readCompObj (MWAWInputStreamPtr ip, std::string const &oleName, libmwaw::DebugFile &ascii)
| the "CompObj" contains : UserType,ClipName,ProgIdName
bool | readContents (MWAWInputStreamPtr input, std::string const &oleName, librevenge::RVNGBinaryData &pict, MWAWPosition &pos, libmwaw::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 sucefull read
bool | readCONTENTS (MWAWInputStreamPtr input, std::string const &oleName, librevenge::RVNGBinaryData &pict, MWAWPosition &pos, libmwaw::DebugFile &ascii)
| the CONTENTS : seems to store a header size, the header and then a object in EMF (with the same header)...

## Static Protected Member Functions
static bool | readOle (MWAWInputStreamPtr ip, std::string const &oleName, libmwaw::DebugFile &ascii)
| the "Ole" small structure : unknown contain
static bool | readMM (MWAWInputStreamPtr input, std::string const &oleName, libmwaw::DebugFile &ascii)
| the "MM" small structure : seems to contain the file versions
static bool | readObjInfo (MWAWInputStreamPtr input, std::string const &oleName, libmwaw::DebugFile &ascii)
| the "ObjInfo" small structure : seems to contain 3 ints=0,3,4
static bool | isOlePres (MWAWInputStreamPtr ip, std::string const &oleName)
| the OlePres001 seems to contain standart picture file and size
static bool | readOlePres (MWAWInputStreamPtr ip, librevenge::RVNGBinaryData &data, MWAWPosition &pos, libmwaw::DebugFile &ascii)
| extracts the picture of OlePres001 if it is possible
static bool | isOle10Native (MWAWInputStreamPtr ip, std::string const &oleName)
| theOle10Native : basic Windows© picture, with no size
static bool | readOle10Native (MWAWInputStreamPtr ip, librevenge::RVNGBinaryData &data, libmwaw::DebugFile &ascii)
| extracts the picture if it is possible

## Protected Attributes
std::string | m_avoidOLE
| if filled, does not parse content with this name
std::shared_ptr< MWAWOLEParserInternal::State > | m_state
| the main state

## Detailed Description

a class used to parse some basic oles Tries to read the different ole parts and stores their contents in form of picture.

## Constructor & Destructor Documentation

## ◆ MWAWOLEParser()

MWAWOLEParser::MWAWOLEParser | ( | std::string const & | mainName,
|  | MWAWFontConverterPtr const & | fontConverter,
|  | int | fontId )
| explicit

constructor

Parameters

  mainName | name of the main ole, we must avoid to parse
  fontConverter | the font converter used to read string
  fontId | the font id used to read string

## ◆ ~MWAWOLEParser()

MWAWOLEParser::~MWAWOLEParser | ( |  | ) |

destructor

## Member Function Documentation

## ◆ getFontEncoding()

int MWAWOLEParser::getFontEncoding | ( |  | ) | const

returns the font encoding find in SummaryInformation or -1

## ◆ getNotParse()

std::vector< std::string > const & MWAWOLEParser::getNotParse | ( |  | ) | const

returns the list of unknown ole

## ◆ getObject()

bool MWAWOLEParser::getObject | ( | int | id,
|  | librevenge::RVNGBinaryData & | obj,
|  | MWAWPosition & | pos,
|  | std::string & | type ) const

returns the picture corresponding to an id

## ◆ getObjects()

std::vector< librevenge::RVNGBinaryData > const & MWAWOLEParser::getObjects | ( |  | ) | const

returns the list of data which have been read

## ◆ getObjectsId()

std::vector< int > const & MWAWOLEParser::getObjectsId | ( |  | ) | const

returns the list of id for which we have find a representation

## ◆ getObjectsPosition()

std::vector< MWAWPosition > const & MWAWOLEParser::getObjectsPosition | ( |  | ) | const

returns the list of data positions which have been read

## ◆ getObjectsType()

std::vector< std::string > const & MWAWOLEParser::getObjectsType | ( |  | ) | const

returns the list of data type

## ◆ isOle10Native()

bool MWAWOLEParser::isOle10Native | ( | MWAWInputStreamPtr | ip,
|  | std::string const & | oleName )
| staticprotected

theOle10Native : basic Windows© picture, with no size

Referenced by parse(), and readOle10Native().

## ◆ isOlePres()

bool MWAWOLEParser::isOlePres | ( | MWAWInputStreamPtr | ip,
|  | std::string const & | oleName )
| staticprotected

the OlePres001 seems to contain standart picture file and size

Referenced by parse(), and readOlePres().

## ◆ parse()

bool MWAWOLEParser::parse | ( | MWAWInputStreamPtr | fileInput | ) |

tries to parse basic OLE (excepted mainName)

Returns
  false if fileInput is not an Ole file

first check if this is a mac pict as other oles may not be understand by openOffice, ...

## ◆ readCompObj()

bool MWAWOLEParser::readCompObj | ( | MWAWInputStreamPtr | ip,
|  | std::string const & | oleName,
|  | libmwaw::DebugFile & | ascii )
| protected

the "CompObj" contains : UserType,ClipName,ProgIdName

Referenced by parse().

## ◆ readContents()

bool MWAWOLEParser::readContents | ( | MWAWInputStreamPtr | input,
|  | std::string const & | oleName,
|  | librevenge::RVNGBinaryData & | pict,
|  | MWAWPosition & | pos,
|  | libmwaw::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 sucefull read

Referenced by parse().

## ◆ readCONTENTS()

bool MWAWOLEParser::readCONTENTS | ( | MWAWInputStreamPtr | input,
|  | std::string const & | oleName,
|  | librevenge::RVNGBinaryData & | pict,
|  | MWAWPosition & | pos,
|  | libmwaw::DebugFile & | ascii )
| protected

the CONTENTS : seems to store a header size, the header and then a object in EMF (with the same header)...

Note
  I only find such lib in 2 files, so the parsing may be incomplete and many such Ole rejected

Referenced by parse().

## ◆ readMM()

bool MWAWOLEParser::readMM | ( | MWAWInputStreamPtr | input,
|  | std::string const & | oleName,
|  | libmwaw::DebugFile & | ascii )
| staticprotected

the "MM" small structure : seems to contain the file versions

Referenced by parse().

## ◆ readObjInfo()

bool MWAWOLEParser::readObjInfo | ( | MWAWInputStreamPtr | input,
|  | std::string const & | oleName,
|  | libmwaw::DebugFile & | ascii )
| staticprotected

the "ObjInfo" small structure : seems to contain 3 ints=0,3,4

Referenced by parse().

## ◆ readOle()

bool MWAWOLEParser::readOle | ( | MWAWInputStreamPtr | ip,
|  | std::string const & | oleName,
|  | libmwaw::DebugFile & | ascii )
| staticprotected

the "Ole" small structure : unknown contain

Referenced by parse().

## ◆ readOle10Native()

bool MWAWOLEParser::readOle10Native | ( | MWAWInputStreamPtr | ip,
|  | librevenge::RVNGBinaryData & | data,
|  | libmwaw::DebugFile & | ascii )
| staticprotected

extracts the picture if it is possible

Referenced by parse().

## ◆ readOlePres()

bool MWAWOLEParser::readOlePres | ( | MWAWInputStreamPtr | ip,
|  | librevenge::RVNGBinaryData & | data,
|  | MWAWPosition & | pos,
|  | libmwaw::DebugFile & | ascii )
| staticprotected

extracts the picture of OlePres001 if it is possible

Referenced by parse().

## ◆ readSummaryInformation()

bool MWAWOLEParser::readSummaryInformation | ( | MWAWInputStreamPtr | input,
|  | std::string const & | oleName,
|  | int & | encoding,
|  | librevenge::RVNGPropertyList & | pList,
|  | libmwaw::DebugFile & | ascii,
|  | long | endPos = -1 ) const

the summary information and the doc summary information

Note
  if endPos==-1, this function assume that the summary file begin at position 0

Referenced by parse(), and Canvas5Parser::readSI200().

## ◆ readSummaryProperty()

bool MWAWOLEParser::readSummaryProperty | ( | MWAWInputStreamPtr | input,
|  | long | endPos,
|  | int | type,
|  | libmwaw::DebugFile & | ascii,
|  | libmwaw::DebugStream & | f ) const
| protected

try to read a summary property

Referenced by readSummaryInformation(), and readSummaryProperty().

## ◆ readSummaryPropertyLong()

bool MWAWOLEParser::readSummaryPropertyLong | ( | MWAWInputStreamPtr | input,
|  | long | endPos,
|  | int | type,
|  | long & | value,
|  | libmwaw::DebugStream & | f ) const
| protected

try to read a summary property: type 2,3,9,12,

Referenced by readSummaryInformation().

## ◆ readSummaryPropertyString()

bool MWAWOLEParser::readSummaryPropertyString | ( | MWAWInputStreamPtr | input,
|  | long | endPos,
|  | int | type,
|  | librevenge::RVNGString & | string,
|  | libmwaw::DebugStream & | f ) const
| protected

try to read a summary property: type 1e

Referenced by readSummaryInformation(), and readSummaryProperty().

## ◆ setObject()

void MWAWOLEParser::setObject | ( | int | id,
|  | librevenge::RVNGBinaryData const & | obj,
|  | MWAWPosition const & | pos,
|  | std::string const & | type )

sets an object just in case, the external parsing find another representation

## ◆ updateMetaData()

void MWAWOLEParser::updateMetaData | ( | librevenge::RVNGPropertyList & | metaData | ) | const

update the meta data, using information find in SummaryInformation

## Member Data Documentation

## ◆ m_avoidOLE

std::string MWAWOLEParser::m_avoidOLE
| protected

if filled, does not parse content with this name

Referenced by parse().

## ◆ m_state

std::shared_ptr<MWAWOLEParserInternal::State> MWAWOLEParser::m_state
| protected

the main state

Referenced by getFontEncoding(), getNotParse(), getObject(), getObjects(), getObjectsId(), getObjectsPosition(), getObjectsType(), parse(), readCompObj(), readSummaryPropertyString(), setObject(), and updateMetaData().

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

- MWAWOLEParser.hxx
- MWAWOLEParser.cxx