NisusWrtParser Class Reference documentation

NisusWrtParser Class Referencefinal

the main class to read a Nisus Writer file More...

`#include <NisusWrtParser.hxx>`

Inheritance diagram for NisusWrtParser:

## Public Member Functions
| NisusWrtParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor
| ~NisusWrtParser () final
| destructor
bool | checkHeader (MWAWHeader *header, bool strict=false) final
| checks if the document header is correct (or not)
void | parse (librevenge::RVNGTextInterface *documentInterface) final
| virtual function used to parse the input
Public Member Functions inherited from MWAWTextParser
| ~MWAWTextParser () override
| destructor
Public Member Functions inherited from MWAWParser
virtual | ~MWAWParser ()
| virtual destructor
int | version () const
| returns the works version
MWAWParserStatePtr | getParserState ()
| returns the parser state
MWAWHeader * | getHeader ()
| returns the header
MWAWInputStreamPtr & | getInput ()
| returns the actual input
MWAWListenerPtr | getMainListener ()
| returns the main listener
MWAWGraphicListenerPtr & | getGraphicListener ()
| returns the graphic listener
MWAWPresentationListenerPtr & | getPresentationListener ()
| returns the presentation listener
MWAWSpreadsheetListenerPtr & | getSpreadsheetListener ()
| returns the spreadsheet listener
MWAWTextListenerPtr & | getTextListener ()
| returns the text listener
MWAWFontConverterPtr & | getFontConverter ()
| returns the font converter
MWAWFontManagerPtr & | getFontManager ()
| returns the font manager
MWAWPageSpan const & | getPageSpan () const
| returns the actual page dimension
MWAWPageSpan & | getPageSpan ()
| returns the actual page dimension
double | getFormLength () const
| returns the form length
double | getFormWidth () const
| returns the form width
double | getPageLength () const
| returns the page length (form length without margin )
double | getPageWidth () const
| returns the page width (form width without margin )
MWAWRSRCParserPtr & | getRSRCParser ()
| returns the rsrc parser
libmwaw::DebugFile & | ascii ()
| a DebugFile used to write what we recognize when we parse the document

## Protected Member Functions
void | init ()
| inits all internal variables
void | createDocument (librevenge::RVNGTextInterface *documentInterface)
| creates the listener which will be associated to the document
MWAWVec2f | getPageLeftTop () const
| returns the page left top point ( in inches)
void | getColumnInfo (int &numColumns, float &colSep) const
| returns the columns information
void | getFootnoteInfo (NisusWrtStruct::FootnoteInfo &fInfo) const
| returns the footnote information
void | newPage (int number)
| adds a new page
std::string | getDateFormat (NisusWrtStruct::ZoneType zoneId, int vId) const
| returns the date format corresponding to a variable id or ""
bool | getReferenceData (NisusWrtStruct::ZoneType zoneId, int vId, MWAWField::Type &fType, std::string &content, std::vector< int > &number) const
| returns the fieldtype or a string corresponding to a variable
bool | sendPicture (int pictId, MWAWPosition const &pictPos)
| try to send a picture
bool | createZones ()
| finds the different objects zones
bool | readPrintInfo (MWAWEntry const &entry)
| read the print info zone ( id=128 )
bool | readCPRC (MWAWEntry const &entry)
| read the CPRC info zone ( id=128 ), an unknown zone
bool | readPageLimit (MWAWEntry const &entry)
| read the PGLY info zone ( id=128 )
bool | readStringsList (MWAWEntry const &entry, std::vector< std::string > &list, bool simpleList)
| read a list of strings
bool | readINFO (MWAWEntry const &entry)
| read the INFO info zone, an unknown zone of size 0x23a: to doo
bool | readReference (NisusWrtStruct::RecursifData const &data)
| parse the MRK7 resource
bool | readVariable (NisusWrtStruct::RecursifData const &data)
| parse the DSPL/VARI/VRS resource: numbering definition, variable or variable ?
bool | readCNTR (MWAWEntry const &entry, int zoneId)
| read the CNTR resource: a list of version controler ?
bool | readNumberingReset (MWAWEntry const &entry, int zoneId)
| parse the DPND resource: numbering reset ( one by zone ) : related to CNTR and VRS ?
bool | readSGP1 (NisusWrtStruct::RecursifData const &data)
| parse the SGP1 resource: a unknown resource
bool | readABBR (MWAWEntry const &entry)
| parse the ABBR resource: a list of abreviation?
bool | readFTA2 (MWAWEntry const &entry)
| parse the FTA2 resource: a list of ? find in v6 document
bool | readFnSc (MWAWEntry const &entry)
| parse the FnSc resource: a unknown resource, find in v6 document
MWAWInputStreamPtr | rsrcInput ()
| return the input input
libmwaw::DebugFile & | rsrcAscii ()
| a DebugFile used to write what we recognize when we parse the document in rsrc
Protected Member Functions inherited from MWAWTextParser
| MWAWTextParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor (protected)
| MWAWTextParser (MWAWParserStatePtr const &state)
| constructor using a state
Protected Member Functions inherited from MWAWParser
| MWAWParser (MWAWParserState::Type type, MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor (protected)
| MWAWParser (MWAWParserStatePtr const &state)
| constructor using a state
void | setVersion (int vers)
| sets the document's version
void | setGraphicListener (MWAWGraphicListenerPtr &listener)
| sets the graphic listener
void | resetGraphicListener ()
| resets the listener
void | setPresentationListener (MWAWPresentationListenerPtr &listener)
| sets the presentation listener
void | resetPresentationListener ()
| resets the listener
void | setSpreadsheetListener (MWAWSpreadsheetListenerPtr &listener)
| sets the spreadsheet listener
void | resetSpreadsheetListener ()
| resets the listener
void | setTextListener (MWAWTextListenerPtr &listener)
| sets the text listener
void | resetTextListener ()
| resets the listener
void | setAsciiName (char const *name)
| Debugging: change the default ascii file.
std::string const & | asciiName () const
| return the ascii file name

## Protected Attributes
std::shared_ptr< NisusWrtParserInternal::State > | m_state
| the state
std::shared_ptr< NisusWrtGraph > | m_graphParser
| the graph parser
std::shared_ptr< NisusWrtText > | m_textParser
| the text parser

## Friends
struct | NisusWrtStruct::RecursifData
class | NisusWrtGraph
class | NisusWrtText

## Detailed Description

the main class to read a Nisus Writer file

## Constructor & Destructor Documentation

## ◆ NisusWrtParser()

NisusWrtParser::NisusWrtParser | ( | MWAWInputStreamPtr const & | input,
|  | MWAWRSRCParserPtr const & | rsrcParser,
|  | MWAWHeader * | header )

constructor

## ◆ ~NisusWrtParser()

NisusWrtParser::~NisusWrtParser | ( |  | ) |
| final

destructor

## Member Function Documentation

## ◆ checkHeader()

bool NisusWrtParser::checkHeader | ( | MWAWHeader * | header,
|  | bool | strict = false )
| finalvirtual

checks if the document header is correct (or not)

no data fork, may be ok, but this means that the file contains no text and no picture, so...

Implements MWAWParser.

Referenced by NisusWrtText, and parse().

## ◆ createDocument()

void NisusWrtParser::createDocument | ( | librevenge::RVNGTextInterface * | documentInterface | ) |
| protected

creates the listener which will be associated to the document

Referenced by NisusWrtText, and parse().

## ◆ createZones()

bool NisusWrtParser::createZones | ( |  | ) |
| protected

finds the different objects zones

find also the resources :

- alis: seems to contains data and some strings
- OPEN: seems to contains one string: author? (size 0x20)
- INF2: seems to contain some colors and some data (size 0x222)
- sect: in two files: 010[1|a]0000acc0015f0000000[1|6]000... (size 0x24)

Referenced by NisusWrtText, and parse().

## ◆ getColumnInfo()

void NisusWrtParser::getColumnInfo | ( | int & | numColumns,
|  | float & | colSep ) const
| protected

returns the columns information

Referenced by NisusWrtText.

## ◆ getDateFormat()

std::string NisusWrtParser::getDateFormat | ( | NisusWrtStruct::ZoneType | zoneId,
|  | int | vId ) const
| protected

returns the date format corresponding to a variable id or ""

Referenced by NisusWrtText.

## ◆ getFootnoteInfo()

void NisusWrtParser::getFootnoteInfo | ( | NisusWrtStruct::FootnoteInfo & | fInfo | ) | const
| protected

returns the footnote information

Referenced by NisusWrtText.

## ◆ getPageLeftTop()

MWAWVec2f NisusWrtParser::getPageLeftTop | ( |  | ) | const
| protected

returns the page left top point ( in inches)

Referenced by NisusWrtText.

## ◆ getReferenceData()

bool NisusWrtParser::getReferenceData | ( | NisusWrtStruct::ZoneType | zoneId,
|  | int | vId,
|  | MWAWField::Type & | fType,
|  | std::string & | content,
|  | std::vector< int > & | number ) const
| protected

returns the fieldtype or a string corresponding to a variable

Referenced by NisusWrtText.

## ◆ init()

void NisusWrtParser::init | ( |  | ) |
| protected

inits all internal variables

Referenced by NisusWrtParser(), and NisusWrtText.

## ◆ newPage()

void NisusWrtParser::newPage | ( | int | number | ) |
| protected

adds a new page

Referenced by NisusWrtText.

## ◆ parse()

void NisusWrtParser::parse | ( | librevenge::RVNGTextInterface * | documentInterface | ) |
| finalvirtual

virtual function used to parse the input

Implements MWAWTextParser.

Referenced by NisusWrtText.

## ◆ readABBR()

bool NisusWrtParser::readABBR | ( | MWAWEntry const & | entry | ) |
| protected

parse the ABBR resource: a list of abreviation?

read the ABBR resource: a list of abreviation ?

Referenced by createZones(), and NisusWrtText.

## ◆ readCNTR()

bool NisusWrtParser::readCNTR | ( | MWAWEntry const & | entry,
|  | int | zoneId )
| protected

read the CNTR resource: a list of version controler ?

Referenced by createZones(), and NisusWrtText.

## ◆ readCPRC()

bool NisusWrtParser::readCPRC | ( | MWAWEntry const & | entry | ) |
| protected

read the CPRC info zone ( id=128 ), an unknown zone

find only 0... except one time f0=1[id?], f4=1900 f6=206c [2pos?]

Referenced by createZones(), and NisusWrtText.

## ◆ readFnSc()

bool NisusWrtParser::readFnSc | ( | MWAWEntry const & | entry | ) |
| protected

parse the FnSc resource: a unknown resource, find in v6 document

read the FnSc resource: a list of ?

Referenced by createZones(), and NisusWrtText.

## ◆ readFTA2()

bool NisusWrtParser::readFTA2 | ( | MWAWEntry const & | entry | ) |
| protected

parse the FTA2 resource: a list of ? find in v6 document

read the FTA2 resource: a list of ?

Referenced by createZones(), and NisusWrtText.

## ◆ readINFO()

bool NisusWrtParser::readINFO | ( | MWAWEntry const & | entry | ) |
| protected

read the INFO info zone, an unknown zone of size 0x23a: to doo

read the INFO resource: a unknown zone

Referenced by createZones(), and NisusWrtText.

## ◆ readNumberingReset()

bool NisusWrtParser::readNumberingReset | ( | MWAWEntry const & | entry,
|  | int | zoneId )
| protected

parse the DPND resource: numbering reset ( one by zone ) : related to CNTR and VRS ?

Referenced by createZones(), and NisusWrtText.

## ◆ readPageLimit()

bool NisusWrtParser::readPageLimit | ( | MWAWEntry const & | entry | ) |
| protected

read the PGLY info zone ( id=128 )

Referenced by createZones(), and NisusWrtText.

## ◆ readPrintInfo()

bool NisusWrtParser::readPrintInfo | ( | MWAWEntry const & | entry | ) |
| protected

read the print info zone ( id=128 )

Referenced by createZones(), and NisusWrtText.

## ◆ readReference()

bool NisusWrtParser::readReference | ( | NisusWrtStruct::RecursifData const & | data | ) |
| protected

parse the MRK7 resource

Referenced by createZones(), and NisusWrtText.

## ◆ readSGP1()

bool NisusWrtParser::readSGP1 | ( | NisusWrtStruct::RecursifData const & | data | ) |
| protected

parse the SGP1 resource: a unknown resource

Referenced by createZones(), and NisusWrtText.

## ◆ readStringsList()

bool NisusWrtParser::readStringsList | ( | MWAWEntry const & | entry,
|  | std::vector< std::string > & | list,
|  | bool | simpleList )
| protected

read a list of strings

Referenced by createZones(), and NisusWrtText.

## ◆ readVariable()

bool NisusWrtParser::readVariable | ( | NisusWrtStruct::RecursifData const & | data | ) |
| protected

parse the DSPL/VARI/VRS resource: numbering definition, variable or variable ?

Referenced by createZones(), and NisusWrtText.

## ◆ rsrcAscii()

libmwaw::DebugFile & NisusWrtParser::rsrcAscii | ( |  | ) |
| protected

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

Referenced by NisusWrtText, NisusWrtStruct::RecursifData::read(), readABBR(), readCNTR(), readCPRC(), readFnSc(), readFTA2(), readINFO(), readNumberingReset(), readPageLimit(), readPrintInfo(), readReference(), readSGP1(), readStringsList(), and readVariable().

## ◆ rsrcInput()

MWAWInputStreamPtr NisusWrtParser::rsrcInput | ( |  | ) |
| protected

return the input input

Referenced by NisusWrtText, NisusWrtStruct::RecursifData::read(), readABBR(), readCNTR(), readCPRC(), readFnSc(), readFTA2(), readINFO(), readNumberingReset(), readPageLimit(), readPrintInfo(), readReference(), readSGP1(), readStringsList(), readVariable(), and sendPicture().

## ◆ sendPicture()

bool NisusWrtParser::sendPicture | ( | int | pictId,
|  | MWAWPosition const & | pictPos )
| protected

try to send a picture

Referenced by NisusWrtText.

## Friends And Related Symbol Documentation

## ◆ NisusWrtGraph

friend class NisusWrtGraph
| friend

Referenced by init(), and NisusWrtGraph.

## ◆ NisusWrtStruct::RecursifData

friend struct NisusWrtStruct::RecursifData
| friend

Referenced by NisusWrtText.

## ◆ NisusWrtText

friend class NisusWrtText
| friend

Referenced by init(), and NisusWrtText.

## Member Data Documentation

## ◆ m_graphParser

std::shared_ptr<NisusWrtGraph> NisusWrtParser::m_graphParser
| protected

the graph parser

Referenced by createDocument(), createZones(), init(), NisusWrtParser(), parse(), and sendPicture().

## ◆ m_state

std::shared_ptr<NisusWrtParserInternal::State> NisusWrtParser::m_state
| protected

the state

Referenced by checkHeader(), createDocument(), createZones(), getColumnInfo(), getDateFormat(), getFootnoteInfo(), getReferenceData(), init(), newPage(), NisusWrtParser(), readINFO(), readNumberingReset(), readPageLimit(), readReference(), and readVariable().

## ◆ m_textParser

std::shared_ptr<NisusWrtText> NisusWrtParser::m_textParser
| protected

the text parser

Referenced by createDocument(), createZones(), init(), NisusWrtParser(), and parse().

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

- NisusWrtParser.hxx
- NisusWrtParser.cxx