MSWriteParser Class Reference

This class parses Microsoft Write 3.0 and 3.1. More...

#include <MSWrite.h>

Inheritance diagram for MSWriteParser:
WPSParser DosWordParser

Public Member Functions

 MSWriteParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::WIN3_WEUROPE)
 
 ~MSWriteParser () override
 
void parse (librevenge::RVNGTextInterface *documentInterface) override
 
- Public Member Functions inherited from WPSParser
 WPSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
 
virtual ~WPSParser ()
 
virtual void parse (librevenge::RVNGTextInterface *documentInterface)=0
 

Protected Member Functions

void readStructures ()
 
virtual libwps_tools_win::Font::Type getFileEncoding (libwps_tools_win::Font::Type hint)
 
void readFIB ()
 
virtual void readFFNTB ()
 
void readFOD (unsigned page, void(MSWriteParser::*parseFOD)(uint32_t fcFirst, uint32_t fcLim, unsigned size))
 
virtual void readPAP (uint32_t fcFirst, uint32_t fcLim, unsigned cch)
 
virtual void readCHP (uint32_t fcFirst, uint32_t fcLim, unsigned cch)
 
virtual void readSUMD ()
 
virtual void readFNTB ()
 
virtual void readSED ()
 
void readText (WPSEntry const &e, MSWriteParserInternal::Paragraph::Location location)
 
int numPages ()
 
void processObject (WPSPosition &pos, unsigned long lastPos)
 
bool processDDB (librevenge::RVNGBinaryData &bmpdata, WPSPosition &pos, unsigned width, unsigned height, unsigned byte_width, unsigned planes, unsigned bits_pixel, unsigned size)
 
bool processDIB (librevenge::RVNGBinaryData &bmpdata, unsigned size)
 
bool processWMF (librevenge::RVNGBinaryData &wmfdata, unsigned size)
 
void processEmbeddedOLE (WPSPosition &pos, unsigned long lastPos)
 
bool processStaticOLE (librevenge::RVNGBinaryData &, std::string &mimetype, WPSPosition &pos, unsigned long lastPos)
 
bool readString (std::string &res, unsigned long lastPos)
 
virtual void insertSpecial (uint8_t val, uint32_t fc, MSWriteParserInternal::Paragraph::Location location)
 
virtual void insertControl (uint8_t val, uint32_t fc)
 
void insertNote (bool annotation, uint32_t fcPos, librevenge::RVNGString const &label)
 
unsigned insertString (const unsigned char *str, unsigned size, libwps_tools_win::Font::Type type)
 
void getHeaderFooters (uint32_t first, MSWriteParserInternal::Section &sep, WPSPageSpan &pageSpan)
 
void startSection (MSWriteParserInternal::Section const &section)
 
bool checkFilePosition (uint32_t pos) const
 check if the file position is correct or not
 
- Protected Member Functions inherited from WPSParser
RVNGInputStreamPtrgetInput ()
 
RVNGInputStreamPtr getFileInput ()
 
WPSHeaderPtrgetHeader ()
 
int version () const
 
void setVersion (int vers)
 
libwps::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document
 
NameMultiMapgetNameEntryMap ()
 
NameMultiMap const & getNameEntryMap () const
 

Static Protected Member Functions

static void getPageStyle (MSWriteParserInternal::Section &sep, WPSPageSpan &pageSpan)
 

Protected Attributes

uint32_t m_fileLength
 the last file position
 
uint32_t m_fcMac
 
std::vector< MSWriteParserInternal::Paragraphm_paragraphList
 
std::vector< MSWriteParserInternal::Fontm_fontList
 
std::vector< MSWriteParserInternal::Footnotem_footnotes
 
std::vector< MSWriteParserInternal::Sectionm_sections
 
std::vector< librevenge::RVNGString > m_fonts
 
libwps_tools_win::Font::Type m_fontType
 
std::shared_ptr< WPSContentListenerm_listener
 
librevenge::RVNGPropertyList m_metaData
 

Private Member Functions

 MSWriteParser (const MSWriteParser &)=delete
 
MSWriteParseroperator= (const MSWriteParser &)=delete
 
std::shared_ptr< WPSContentListenercreateListener (librevenge::RVNGTextInterface *interface)
 

Friends

class MSWriteParserInternal::SubDocument
 
struct MSWriteParserInternal::Paragraph
 
struct MSWriteParserInternal::Font
 

Additional Inherited Members

- Public Types inherited from WPSParser
typedef std::multimap< std::string, WPSEntryNameMultiMap
 a map to retrieve a file entry by name
 

Detailed Description

This class parses Microsoft Write 3.0 and 3.1.

Constructor & Destructor Documentation

◆ MSWriteParser() [1/2]

MSWriteParser::MSWriteParser ( RVNGInputStreamPtr input,
WPSHeaderPtr header,
libwps_tools_win::Font::Type  encoding = libwps_tools_win::Font::WIN3_WEUROPE 
)

◆ ~MSWriteParser()

MSWriteParser::~MSWriteParser ( )
override

◆ MSWriteParser() [2/2]

MSWriteParser::MSWriteParser ( const MSWriteParser )
privatedelete

Member Function Documentation

◆ checkFilePosition()

bool MSWriteParser::checkFilePosition ( uint32_t  pos) const
inlineprotected

◆ createListener()

std::shared_ptr< WPSContentListener > MSWriteParser::createListener ( librevenge::RVNGTextInterface *  interface)
private

Referenced by parse().

◆ getFileEncoding()

libwps_tools_win::Font::Type MSWriteParser::getFileEncoding ( libwps_tools_win::Font::Type  hint)
protectedvirtual

Reimplemented in DosWordParser.

Referenced by MSWriteParser().

◆ getHeaderFooters()

void MSWriteParser::getHeaderFooters ( uint32_t  first,
MSWriteParserInternal::Section sep,
WPSPageSpan pageSpan 
)
protected

Referenced by createListener().

◆ getPageStyle()

void MSWriteParser::getPageStyle ( MSWriteParserInternal::Section sep,
WPSPageSpan pageSpan 
)
staticprotected

Referenced by createListener().

◆ insertControl()

void MSWriteParser::insertControl ( uint8_t  val,
uint32_t  fc 
)
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readText().

◆ insertNote()

void MSWriteParser::insertNote ( bool  annotation,
uint32_t  fcPos,
librevenge::RVNGString const &  label 
)
protected

◆ insertSpecial()

void MSWriteParser::insertSpecial ( uint8_t  val,
uint32_t  fc,
MSWriteParserInternal::Paragraph::Location  location 
)
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readText().

◆ insertString()

unsigned MSWriteParser::insertString ( const unsigned char *  str,
unsigned  size,
libwps_tools_win::Font::Type  type 
)
protected

Referenced by readText().

◆ numPages()

int MSWriteParser::numPages ( )
protected

◆ operator=()

MSWriteParser & MSWriteParser::operator= ( const MSWriteParser )
privatedelete

◆ parse()

void MSWriteParser::parse ( librevenge::RVNGTextInterface *  documentInterface)
overridevirtual

Implements WPSParser.

◆ processDDB()

bool MSWriteParser::processDDB ( librevenge::RVNGBinaryData &  bmpdata,
WPSPosition pos,
unsigned  width,
unsigned  height,
unsigned  byte_width,
unsigned  planes,
unsigned  bits_pixel,
unsigned  size 
)
protected

Referenced by processObject(), and processStaticOLE().

◆ processDIB()

bool MSWriteParser::processDIB ( librevenge::RVNGBinaryData &  bmpdata,
unsigned  size 
)
protected

Referenced by processStaticOLE().

◆ processEmbeddedOLE()

void MSWriteParser::processEmbeddedOLE ( WPSPosition pos,
unsigned long  lastPos 
)
protected

Referenced by processObject().

◆ processObject()

void MSWriteParser::processObject ( WPSPosition pos,
unsigned long  lastPos 
)
protected

Referenced by readText().

◆ processStaticOLE()

bool MSWriteParser::processStaticOLE ( librevenge::RVNGBinaryData &  b,
std::string &  mimetype,
WPSPosition pos,
unsigned long  lastPos 
)
protected

◆ processWMF()

bool MSWriteParser::processWMF ( librevenge::RVNGBinaryData &  wmfdata,
unsigned  size 
)
protected

Referenced by processObject(), and processStaticOLE().

◆ readCHP()

void MSWriteParser::readCHP ( uint32_t  fcFirst,
uint32_t  fcLim,
unsigned  cch 
)
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readStructures().

◆ readFFNTB()

void MSWriteParser::readFFNTB ( )
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readStructures().

◆ readFIB()

void MSWriteParser::readFIB ( )
protected

Referenced by readStructures().

◆ readFNTB()

void MSWriteParser::readFNTB ( )
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readStructures().

◆ readFOD()

void MSWriteParser::readFOD ( unsigned  page,
void(MSWriteParser::*)(uint32_t fcFirst, uint32_t fcLim, unsigned size)  parseFOD 
)
protected

Referenced by readStructures().

◆ readPAP()

void MSWriteParser::readPAP ( uint32_t  fcFirst,
uint32_t  fcLim,
unsigned  cch 
)
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readStructures().

◆ readSED()

void MSWriteParser::readSED ( )
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readStructures().

◆ readString()

bool MSWriteParser::readString ( std::string &  res,
unsigned long  lastPos 
)
protected

◆ readStructures()

void MSWriteParser::readStructures ( )
protected

Referenced by parse().

◆ readSUMD()

void MSWriteParser::readSUMD ( )
protectedvirtual

Reimplemented in DosWordParser.

Referenced by readStructures().

◆ readText()

void MSWriteParser::readText ( WPSEntry const &  e,
MSWriteParserInternal::Paragraph::Location  location 
)
protected

Referenced by parse().

◆ startSection()

void MSWriteParser::startSection ( MSWriteParserInternal::Section const &  section)
protected

Referenced by parse().

Friends And Related Symbol Documentation

◆ MSWriteParserInternal::Font

friend struct MSWriteParserInternal::Font
friend

◆ MSWriteParserInternal::Paragraph

friend struct MSWriteParserInternal::Paragraph
friend

◆ MSWriteParserInternal::SubDocument

Member Data Documentation

◆ m_fcMac

uint32_t MSWriteParser::m_fcMac
protected

◆ m_fileLength

uint32_t MSWriteParser::m_fileLength
protected

the last file position

Referenced by MSWriteParser(), and DosWordParser::readSED().

◆ m_fontList

std::vector<MSWriteParserInternal::Font> MSWriteParser::m_fontList
protected

◆ m_fonts

std::vector<librevenge::RVNGString> MSWriteParser::m_fonts
protected

Referenced by readCHP(), and readFFNTB().

◆ m_fontType

◆ m_footnotes

std::vector<MSWriteParserInternal::Footnote> MSWriteParser::m_footnotes
protected

◆ m_listener

◆ m_metaData

librevenge::RVNGPropertyList MSWriteParser::m_metaData
protected

Referenced by parse(), and DosWordParser::readSUMD().

◆ m_paragraphList

std::vector<MSWriteParserInternal::Paragraph> MSWriteParser::m_paragraphList
protected

◆ m_sections


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

Generated on Thu Jul 27 2023 11:31:48 for libwps by doxygen 1.9.7