Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
WPSTextParser Class Reference

class used to defined the ancestor of parser which manages the text data More...

`#include <WPSTextParser.h>`

Inheritance diagram for WPSTextParser:

## Classes
struct | DataFOD
| structure which retrieves data information which correspond to a text position More...

## Public Member Functions
virtual | ~WPSTextParser ()
| virtual destructor More...
int | version () const
| returns the file version More...
RVNGInputStreamPtr & | getInput ()
| returns the actual input More...

## Protected Types
typedef bool(WPSTextParser::* | FDPParser) (long endPos, int &id, std::string &mess)
| callback when a new attribute is found in an FDPP/FDPC entry More...

## Protected Member Functions
| WPSTextParser (WPSParser &parser, RVNGInputStreamPtr &input)
| constructor More...
std::multimap< std::string, WPSEntry > & | getNameEntryMap ()
| returns the map type->entry More...
std::multimap< std::string, WPSEntry > const & | getNameEntryMap () const
| returns the map type->entry More...
std::vector< DataFOD > | mergeSortedFODLists (std::vector< DataFOD > const &lst1, std::vector< DataFOD > const &lst2) const
| function which takes two sorted list of attribute (by text position). More...
bool | readFDP (WPSEntry const &entry, std::vector< DataFOD > &fods, FDPParser parser)
| parses a FDPP or a FDPC entry (which contains a list of ATTR_TEXT/ATTR_PARAG with their definition ) and adds found data in listFODs More...
libwps::DebugFile & | ascii ()
| a DebugFile used to write what we recognize when we parse the document More...

## Protected Attributes
int | m_version
| the file version More...
RVNGInputStreamPtr | m_input
| the main input More...
WPSParser & | m_mainParser
| pointer to the main zone parser; More...
WPSEntry | m_textPositions
| an entry which corresponds to the complete text zone More...
std::vector< DataFOD > | m_FODList
| the list of a FOD More...
libwps::DebugFile & | m_asciiFile
| the ascii file More...

## Private Member Functions
| WPSTextParser (WPSTextParser const &parser)=delete
| private copy constructor: forbidden More...
WPSTextParser & | operator= (WPSTextParser const &parser)=delete
| private copy operator: forbidden More...

## Detailed Description

class used to defined the ancestor of parser which manages the text data

## Member Typedef Documentation

## ◆ FDPParser

typedef bool(WPSTextParser::* WPSTextParser::FDPParser) (long endPos, int &id, std::string &mess)
| protected

callback when a new attribute is found in an FDPP/FDPC entry

Parameters

  endPos | define the end of the data's zone
  mess | can be used to add a message in debugFile

Returns
  true and filled id if this attribute can be parsed

## Constructor & Destructor Documentation

## ◆ ~WPSTextParser()

WPSTextParser::~WPSTextParser | ( |  | ) |
| virtual

virtual destructor

## ◆ WPSTextParser() [1/2]

WPSTextParser::WPSTextParser | ( | WPSParser & | parser,
|  | RVNGInputStreamPtr & | input
| ) |  |
| protected

constructor

## ◆ WPSTextParser() [2/2]

WPSTextParser::WPSTextParser | ( | WPSTextParser const & | parser | ) |
| private delete

private copy constructor: forbidden

## Member Function Documentation

## ◆ ascii()

libwps::DebugFile& WPSTextParser::ascii | ( |  | ) |
| inline protected

a DebugFile used to write what we recognize when we parse the document

Referenced by WPS8Text::bmktEndDataParser(), WPS4Text::readDosLink(), WPS4Text::readEntries(), readFDP(), WPS4Text::readFontNames(), WPS8Text::readNotes(), WPS8Text::readStructures(), WPS8Text::readText(), WPS4Text::readText(), and WPS8Text::tokenEndDataParser().

## ◆ getInput()

RVNGInputStreamPtr& WPSTextParser::getInput | ( |  | ) |
| inline

returns the actual input

Referenced by WPS8Text::bmktEndDataParser(), WPS8Text::getFooterEntry(), WPS8Text::getHeaderEntry(), readFDP(), WPS8Text::readNotes(), WPS8Text::readText(), and WPS8Text::tokenEndDataParser().

## ◆ getNameEntryMap() [1/2]

WPSParser::NameMultiMap & WPSTextParser::getNameEntryMap | ( |  | ) |
| protected

returns the map type->entry

Referenced by WPS8TextStyle::findFDPStructures(), WPS4Text::findFDPStructures(), WPS8TextStyle::findFDPStructuresByHand(), WPS4Text::getFooterEntry(), WPS4Text::getHeaderEntry(), WPS4Text::readEntries(), WPS8TextStyle::readStructures(), WPS8Text::readStructures(), and WPS4Text::readStructures().

## ◆ getNameEntryMap() [2/2]

WPSParser::NameMultiMap const & WPSTextParser::getNameEntryMap | ( |  | ) | const
| protected

returns the map type->entry

## ◆ mergeSortedFODLists()

std::vector< WPSTextParser::DataFOD > WPSTextParser::mergeSortedFODLists | ( | std::vector< DataFOD > const & | lst1,
|  | std::vector< DataFOD > const & | lst2
| ) |  | const
| protected

function which takes two sorted list of attribute (by text position).

Returns
  a list of attribute

Referenced by WPS8Text::bmktEndDataParser(), WPS8TextStyle::readStructures(), WPS4Text::readStructures(), and WPS8Text::tokenEndDataParser().

## ◆ operator=()

WPSTextParser& WPSTextParser::operator= | ( | WPSTextParser const & | parser | ) |
| private delete

private copy operator: forbidden

## ◆ readFDP()

bool WPSTextParser::readFDP | ( | WPSEntry const & | entry,
|  | std::vector< DataFOD > & | fods,
|  | WPSTextParser::FDPParser | parser
| ) |  |
| protected

parses a FDPP or a FDPC entry (which contains a list of ATTR_TEXT/ATTR_PARAG with their definition ) and adds found data in listFODs

Referenced by WPS8TextStyle::readStructures(), and WPS4Text::readStructures().

## ◆ version()

int WPSTextParser::version | ( |  | ) | const

returns the file version

Referenced by WPS4Text::getDefaultFont(), readFDP(), WPS4Text::readFont(), WPS4Text::readParagraph(), and WPS4Text::readText().

## Member Data Documentation

## ◆ m_asciiFile

libwps::DebugFile& WPSTextParser::m_asciiFile
| protected

the ascii file

Referenced by ascii().

## ◆ m_FODList

std::vector<DataFOD> WPSTextParser::m_FODList
| protected

the list of a FOD

Referenced by WPS8Text::bmktEndDataParser(), WPS8TextStyle::readStructures(), WPS4Text::readStructures(), WPS8Text::readText(), WPS4Text::readText(), and WPS8Text::tokenEndDataParser().

## ◆ m_input

RVNGInputStreamPtr WPSTextParser::m_input
| protected

the main input

Referenced by WPS4Text::bkmkDataParser(), WPS4Text::defDataParser(), WPS4Text::dttmDataParser(), WPS4Text::findFDPStructuresByHand(), WPS4Text::footNotesDataParser(), getInput(), WPS8Text::numPages(), WPS4Text::numPages(), WPS4Text::objectDataParser(), WPS4Text::readDosLink(), WPS4Text::readEntries(), readFDP(), WPS4Text::readFont(), WPS4Text::readFontNames(), WPS4Text::readParagraph(), and WPS4Text::readText().

## ◆ m_mainParser

WPSParser& WPSTextParser::m_mainParser
| protected

pointer to the main zone parser;

Referenced by getNameEntryMap(), WPS4Text::mainParser(), WPS8Text::mainParser(), and version().

## ◆ m_textPositions

WPSEntry WPSTextParser::m_textPositions
| protected

an entry which corresponds to the complete text zone

Referenced by WPS4Text::findFDPStructuresByHand(), WPS8Text::numPages(), WPS4Text::numPages(), WPS4Text::readEntries(), readFDP(), WPS8Text::readNotes(), and WPS8Text::readStructures().

## ◆ m_version

int WPSTextParser::m_version
| mutable protected

the file version

Referenced by version().

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

- WPSTextParser.h
- WPSTextParser.cpp