libwps::PocketExcelParser Class Referencefinal

This class parses Microsoft PocketExcel spreadsheet 1.0, 1.1. More...

#include <PocketExcel.h>

Inheritance diagram for libwps::PocketExcelParser:
WKSParser

Public Member Functions

 PocketExcelParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
 constructor
 ~PocketExcelParser () override
 destructor
void parse (librevenge::RVNGSpreadsheetInterface *documentInterface) final
 called by WPSDocument to parse the file
bool checkHeader (WPSHeader *header, bool strict=false)
 checks if the document header is correct (or not)
Public Member Functions inherited from WKSParser
 WKSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
virtual ~WKSParser ()

Protected Member Functions

bool checkFilePosition (long pos)
 return true if the pos is in the file, update the file size if need
std::shared_ptr< WKSContentListener > createListener (librevenge::RVNGSpreadsheetInterface *interface)
 creates the main listener
bool readZones (librevenge::RVNGSpreadsheetInterface *documentInterface)
 finds the different zones (spreadsheet, chart, print, ...)
bool readZone (librevenge::RVNGSpreadsheetInterface *documentInterface)
 tries to read a zone.
bool readBeginZone ()
 tries to read the begining of a block: 09
bool readSheetName ()
 tries to read the sheet name zone: 85
bool readCell ()
 tries to read a cell: 1: blank, 3: number, 4: label
bool readDefColInfo ()
 tries to read the default column info: 55
bool readColInfo ()
 tries to read the column information: 7d
bool readFontDescription ()
 tries to read a font description: 32
bool readCellFormat ()
 tries to read a cellule format : e0
bool readName ()
 tries to read a defined name: 8
bool readNumberFormat ()
 tries to read a format zone: 1e
bool readPaneInfo ()
 tries to read the pane information: 41
bool readDefRowHeight ()
 tries to read the default row heights: 25
bool readRowHeight ()
 tries to read a row height: 8
bool readSelection ()
 tries to read the current selection: 1d
bool readSheetInfo ()
 tries to read the sheet window info: 3e
void updateFmtWithUserFormat (WPSCellFormat &fmt, librevenge::RVNGString const &format)
 try to update a cell format using the custom string
librevenge::RVNGString readString (int N)
 try to read a string, ie. N unicode characters
bool updateCell (int row, int col, int relPos, Vec2i const &actPos, WKSContentListener::FormulaInstruction &instr, int which=0)
 try to update a cell position
bool readFormula (long endPos, Vec2i const &cellPos, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &extra)
 try to read a formula
bool sendSheet (PocketExcelParserInternal::Sheet const &sheet, int id)
 try to send a sheet
void sendCellContent (PocketExcelParserInternal::Cell const &cell, Vec2i const &pos)
 send the cell data
Protected Member Functions inherited from WKSParser
RVNGInputStreamPtr & getInput ()
void resetInput (RVNGInputStreamPtr const &newInput)
RVNGInputStreamPtr getFileInput ()
WPSHeaderPtr & getHeader ()
int version () const
void setVersion (int vers)
libwps::DebugFile & ascii ()
 a DebugFile used to write what we recognize when we parse the document

Protected Attributes

std::shared_ptr< WKSContentListener > m_listener
std::shared_ptr< PocketExcelParserInternal::State > m_state
 the listener (if set)

Detailed Description

This class parses Microsoft PocketExcel spreadsheet 1.0, 1.1.

Constructor & Destructor Documentation

◆ PocketExcelParser()

libwps::PocketExcelParser::PocketExcelParser ( RVNGInputStreamPtr & input,
WPSHeaderPtr & header )

constructor

◆ ~PocketExcelParser()

libwps::PocketExcelParser::~PocketExcelParser ( )
override

destructor

Member Function Documentation

◆ checkFilePosition()

bool libwps::PocketExcelParser::checkFilePosition ( long pos)
protected

◆ checkHeader()

bool libwps::PocketExcelParser::checkHeader ( WPSHeader * header,
bool strict = false )

checks if the document header is correct (or not)

Referenced by libwps::WPSDocument::isFileFormatSupported(), and parse().

◆ createListener()

std::shared_ptr< WKSContentListener > libwps::PocketExcelParser::createListener ( librevenge::RVNGSpreadsheetInterface * interface)
protected

creates the main listener

Referenced by readZone().

◆ parse()

void libwps::PocketExcelParser::parse ( librevenge::RVNGSpreadsheetInterface * documentInterface)
finalvirtual

called by WPSDocument to parse the file

Implements WKSParser.

◆ readBeginZone()

bool libwps::PocketExcelParser::readBeginZone ( )
protected

tries to read the begining of a block: 09

Referenced by readZone().

◆ readCell()

bool libwps::PocketExcelParser::readCell ( )
protected

tries to read a cell: 1: blank, 3: number, 4: label

Referenced by readZone().

◆ readCellFormat()

bool libwps::PocketExcelParser::readCellFormat ( )
protected

tries to read a cellule format : e0

Referenced by readZone().

◆ readColInfo()

bool libwps::PocketExcelParser::readColInfo ( )
protected

tries to read the column information: 7d

Referenced by readZone().

◆ readDefColInfo()

bool libwps::PocketExcelParser::readDefColInfo ( )
protected

tries to read the default column info: 55

Referenced by readZone().

◆ readDefRowHeight()

bool libwps::PocketExcelParser::readDefRowHeight ( )
protected

tries to read the default row heights: 25

Referenced by readZone().

◆ readFontDescription()

bool libwps::PocketExcelParser::readFontDescription ( )
protected

tries to read a font description: 32

Referenced by readZone().

◆ readFormula()

bool libwps::PocketExcelParser::readFormula ( long endPos,
Vec2i const & cellPos,
std::vector< WKSContentListener::FormulaInstruction > & formula,
std::string & extra )
protected

try to read a formula

Referenced by readCell().

◆ readName()

bool libwps::PocketExcelParser::readName ( )
protected

tries to read a defined name: 8

Referenced by readZone().

◆ readNumberFormat()

bool libwps::PocketExcelParser::readNumberFormat ( )
protected

tries to read a format zone: 1e

Referenced by readZone().

◆ readPaneInfo()

bool libwps::PocketExcelParser::readPaneInfo ( )
protected

tries to read the pane information: 41

Referenced by readZone().

◆ readRowHeight()

bool libwps::PocketExcelParser::readRowHeight ( )
protected

tries to read a row height: 8

Referenced by readZone().

◆ readSelection()

bool libwps::PocketExcelParser::readSelection ( )
protected

tries to read the current selection: 1d

Referenced by readZone().

◆ readSheetInfo()

bool libwps::PocketExcelParser::readSheetInfo ( )
protected

tries to read the sheet window info: 3e

Referenced by readZone().

◆ readSheetName()

bool libwps::PocketExcelParser::readSheetName ( )
protected

tries to read the sheet name zone: 85

Referenced by readZone().

◆ readString()

librevenge::RVNGString libwps::PocketExcelParser::readString ( int N)
protected

try to read a string, ie. N unicode characters

Referenced by readCell(), readFontDescription(), readFormula(), readName(), readNumberFormat(), and readSheetName().

◆ readZone()

bool libwps::PocketExcelParser::readZone ( librevenge::RVNGSpreadsheetInterface * documentInterface)
protected

tries to read a zone.

Referenced by checkHeader(), and readZones().

◆ readZones()

bool libwps::PocketExcelParser::readZones ( librevenge::RVNGSpreadsheetInterface * documentInterface)
protected

finds the different zones (spreadsheet, chart, print, ...)

Referenced by parse().

◆ sendCellContent()

void libwps::PocketExcelParser::sendCellContent ( PocketExcelParserInternal::Cell const & cell,
Vec2i const & pos )
protected

send the cell data

Referenced by sendSheet().

◆ sendSheet()

bool libwps::PocketExcelParser::sendSheet ( PocketExcelParserInternal::Sheet const & sheet,
int id )
protected

try to send a sheet

Referenced by readZone().

◆ updateCell()

bool libwps::PocketExcelParser::updateCell ( int row,
int col,
int relPos,
Vec2i const & actPos,
WKSContentListener::FormulaInstruction & instr,
int which = 0 )
protected

try to update a cell position

Referenced by readFormula().

◆ updateFmtWithUserFormat()

void libwps::PocketExcelParser::updateFmtWithUserFormat ( WPSCellFormat & fmt,
librevenge::RVNGString const & format )
protected

try to update a cell format using the custom string

Referenced by readNumberFormat().

Member Data Documentation

◆ m_listener

std::shared_ptr<WKSContentListener> libwps::PocketExcelParser::m_listener
protected

◆ m_state


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

Generated on for libwps by doxygen 1.17.0