Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
WPSOLEParser 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 <WPSOLEParser.h>`

## Public Member Functions
| WPSOLEParser (const std::string &mainName, libwps_tools_win::Font::Type fontType, std::function< int(std::string const &)> const &dirToIdFunc=getIdFromDirectory)
| constructor More...
| ~WPSOLEParser ()
| destructor More...
bool | parse (RVNGInputStreamPtr fileInput)
| tries to parse basic OLE (excepted mainName) More...
void | updateMetaData (librevenge::RVNGPropertyList &metaData) const
| update the meta data, using information find in SummaryInformation More...
std::vector< std::string > const & | getNotParse () const
| returns the list of unknown ole More...
std::map< int, WPSEmbeddedObject > const & | getObjectsMap () const
| returns the list of data positions which have been read More...

## Protected Member Functions
bool | readSummaryInformation (RVNGInputStreamPtr input, std::string const &oleName, librevenge::RVNGPropertyList &pList, libwps::DebugFile &ascii) const
| the summary information and the doc summary information More...
bool | readSummaryProperty (RVNGInputStreamPtr input, long endPos, int type, libwps::DebugFile &ascii, libwps::DebugStream &f) const
| try to read a summary property More...
bool | readSummaryPropertyString (RVNGInputStreamPtr input, long endPos, int type, librevenge::RVNGString &string, libwps::DebugStream &f) const
| try to read a summary property: type 1e More...
bool | readSummaryPropertyLong (RVNGInputStreamPtr input, long endPos, int type, long &value, libwps::DebugStream &f) const
| try to read a summary property: type 2,3,9,12, More...
bool | readCompObj (RVNGInputStreamPtr &ip, std::string const &oleName, libwps::DebugFile &ascii)
| the "CompObj" contains : UserType,ClipName,ProgIdName More...

## Static Protected Member Functions
static bool | readOle (RVNGInputStreamPtr &ip, std::string const &oleName, libwps::DebugFile &ascii)
| the "Ole" small structure : unknown contain More...
static bool | readMM (RVNGInputStreamPtr &input, std::string const &oleName, libwps::DebugFile &ascii)
| the "MM" small structure : seems to contain the file versions More...
static bool | readObjInfo (RVNGInputStreamPtr &input, std::string const &oleName, libwps::DebugFile &ascii)
| the "ObjInfo" small structure : seems to contain 3 ints=0,3,4 More...
static bool | isOlePres (RVNGInputStreamPtr &ip, std::string const &oleName)
| the OlePres001 seems to contain standart picture file and size More...
static bool | readOlePres (RVNGInputStreamPtr &ip, WPSEmbeddedObject &obj, libwps::DebugFile &ascii)
| extracts the picture of OlePres001 if it is possible More...
static bool | isOle10Native (RVNGInputStreamPtr &ip, std::string const &oleName)
| theOle10Native : basic Windows' picture, with no size More...
static bool | readOle10Native (RVNGInputStreamPtr &ip, WPSEmbeddedObject &obj, libwps::DebugFile &ascii)
| extracts the picture if it is possible More...
static bool | readContents (RVNGInputStreamPtr &input, std::string const &oleName, WPSEmbeddedObject &obj, 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 More...
static bool | readCONTENTS (RVNGInputStreamPtr &input, std::string const &oleName, WPSEmbeddedObject &obj, libwps::DebugFile &ascii)
| the CONTENTS : seems to store a header size, the header and then a object in EMF (with the same header)... More...
static bool | readMN0AndCheckWKS (RVNGInputStreamPtr &input, std::string const &oleName, WPSEmbeddedObject &obj, libwps::DebugFile &ascii)
| the "MN0" small structure : can contains a WKS file... More...
static int | getIdFromDirectory (std::string const &dirName)
| the default function which uses the last integer of dirName to return the final id, ie. More...

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

## 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

## ◆ WPSOLEParser()

WPSOLEParser::WPSOLEParser | ( | const std::string & | mainName,
|  | libwps_tools_win::Font::Type | fontType,
|  | std::function< int(std::string const &)> const & | dirToIdFunc = `getIdFromDirectory`
| ) |  |

constructor

Parameters

  mainName | name of the main ole, we must avoid to parse

## ◆ ~WPSOLEParser()

WPSOLEParser::~WPSOLEParser | ( |  | ) |

destructor

## Member Function Documentation

## ◆ getIdFromDirectory()

int WPSOLEParser::getIdFromDirectory | ( | std::string const & | dirName | ) |
| static protected

the default function which uses the last integer of dirName to return the final id, ie.

it converts "MatOST/MatadorObject1", "Object 1" in 1

## ◆ getNotParse()

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

returns the list of unknown ole

Referenced by WPS8Parser::createOLEStructures(), and WPS4Parser::createOLEStructures().

## ◆ getObjectsMap()

std::map< int, WPSEmbeddedObject > const & WPSOLEParser::getObjectsMap | ( |  | ) | const

returns the list of data positions which have been read

Referenced by WPS8Parser::createOLEStructures(), and WPS4Parser::createOLEStructures().

## ◆ isOle10Native()

bool WPSOLEParser::isOle10Native | ( | RVNGInputStreamPtr & | ip,
|  | std::string const & | oleName
| ) |  |
| static protected

theOle10Native : basic Windows' picture, with no size

Referenced by parse(), and readOle10Native().

## ◆ isOlePres()

bool WPSOLEParser::isOlePres | ( | RVNGInputStreamPtr & | ip,
|  | std::string const & | oleName
| ) |  |
| static protected

the OlePres001 seems to contain standart picture file and size

Referenced by parse(), and readOlePres().

## ◆ parse()

bool WPSOLEParser::parse | ( | RVNGInputStreamPtr | fileInput | ) |

tries to parse basic OLE (excepted mainName)

Returns
  false if fileInput is not an Ole file

Referenced by WPS8Parser::createOLEStructures(), WPS4Parser::createOLEStructures(), QuattroParser::parseOLEStream(), and Quattro9Parser::parseOLEStream().

## ◆ readCompObj()

bool WPSOLEParser::readCompObj | ( | RVNGInputStreamPtr & | ip,
|  | std::string const & | oleName,
|  | libwps::DebugFile & | ascii
| ) |  |
| protected

the "CompObj" contains : UserType,ClipName,ProgIdName

Referenced by parse().

## ◆ readContents()

bool WPSOLEParser::readContents | ( | RVNGInputStreamPtr & | input,
|  | std::string const & | oleName,
|  | WPSEmbeddedObject & | obj,
|  | libwps::DebugFile & | ascii
| ) |  |
| static 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().

## ◆ readCONTENTS()

bool WPSOLEParser::readCONTENTS | ( | RVNGInputStreamPtr & | input,
|  | std::string const & | oleName,
|  | WPSEmbeddedObject & | obj,
|  | libwps::DebugFile & | ascii
| ) |  |
| static 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 WPSOLEParser::readMM | ( | RVNGInputStreamPtr & | input,
|  | std::string const & | oleName,
|  | libwps::DebugFile & | ascii
| ) |  |
| static protected

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

Referenced by parse().

## ◆ readMN0AndCheckWKS()

bool WPSOLEParser::readMN0AndCheckWKS | ( | RVNGInputStreamPtr & | input,
|  | std::string const & | oleName,
|  | WPSEmbeddedObject & | obj,
|  | libwps::DebugFile & | ascii
| ) |  |
| static protected

the "MN0" small structure : can contains a WKS file...

Referenced by parse().

## ◆ readObjInfo()

bool WPSOLEParser::readObjInfo | ( | RVNGInputStreamPtr & | input,
|  | std::string const & | oleName,
|  | libwps::DebugFile & | ascii
| ) |  |
| static protected

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

Referenced by parse().

## ◆ readOle()

bool WPSOLEParser::readOle | ( | RVNGInputStreamPtr & | ip,
|  | std::string const & | oleName,
|  | libwps::DebugFile & | ascii
| ) |  |
| static protected

the "Ole" small structure : unknown contain

Referenced by parse().

## ◆ readOle10Native()

bool WPSOLEParser::readOle10Native | ( | RVNGInputStreamPtr & | ip,
|  | WPSEmbeddedObject & | obj,
|  | libwps::DebugFile & | ascii
| ) |  |
| static protected

extracts the picture if it is possible

Referenced by parse().

## ◆ readOlePres()

bool WPSOLEParser::readOlePres | ( | RVNGInputStreamPtr & | ip,
|  | WPSEmbeddedObject & | obj,
|  | libwps::DebugFile & | ascii
| ) |  |
| static protected

extracts the picture of OlePres001 if it is possible

Referenced by parse().

## ◆ readSummaryInformation()

bool WPSOLEParser::readSummaryInformation | ( | RVNGInputStreamPtr | input,
|  | std::string const & | oleName,
|  | librevenge::RVNGPropertyList & | pList,
|  | libwps::DebugFile & | ascii
| ) |  | const
| protected

the summary information and the doc summary information

Referenced by parse().

## ◆ readSummaryProperty()

bool WPSOLEParser::readSummaryProperty | ( | RVNGInputStreamPtr | input,
|  | long | endPos,
|  | int | type,
|  | libwps::DebugFile & | ascii,
|  | libwps::DebugStream & | f
| ) |  | const
| protected

try to read a summary property

Referenced by readSummaryInformation().

## ◆ readSummaryPropertyLong()

bool WPSOLEParser::readSummaryPropertyLong | ( | RVNGInputStreamPtr | input,
|  | long | endPos,
|  | int | type,
|  | long & | value,
|  | libwps::DebugStream & | f
| ) |  | const
| protected

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

Referenced by readSummaryInformation().

## ◆ readSummaryPropertyString()

bool WPSOLEParser::readSummaryPropertyString | ( | RVNGInputStreamPtr | input,
|  | long | endPos,
|  | int | type,
|  | librevenge::RVNGString & | string,
|  | libwps::DebugStream & | f
| ) |  | const
| protected

try to read a summary property: type 1e

Referenced by readSummaryInformation(), and readSummaryProperty().

## ◆ updateMetaData()

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

update the meta data, using information find in SummaryInformation

## Member Data Documentation

## ◆ m_avoidOLE

std::string WPSOLEParser::m_avoidOLE
| protected

if filled, does not parse content with this name

Referenced by parse().

## ◆ m_state

std::shared_ptr<WPSOLEParserInternal::State> WPSOLEParser::m_state
| protected

the main state

Referenced by getNotParse(), getObjectsMap(), parse(), readCompObj(), readSummaryPropertyString(), and updateMetaData().

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

- WPSOLEParser.h
- WPSOLEParser.cpp