This class parses Microsoft Works spreadsheet or a database file. More...
#include <WKS4.h>
Public Member Functions | |
WKS4Parser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN, char const *password=nullptr) | |
constructor | |
~WKS4Parser () 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) | |
bool | readCString (librevenge::RVNGString &string, long maxSize) |
try to read a basic C string, knowing the maximum size | |
![]() | |
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 | |
int | version () const |
return the file version | |
libwps::WPSCreator | creator () const |
return the file creator | |
libwps_tools_win::Font::Type | getDefaultFontType () const |
returns the default font type, ie. | |
libwps::WPSCreator | getCreator () const |
returns the creator | |
bool | getColor (int id, WPSColor &color) const |
returns the color corresponding to an id | |
bool | getFont (int id, WPSFont &font, libwps_tools_win::Font::Type &type) const |
returns the font corresponding to an id | |
librevenge::RVNGString | getSheetName (int id) const |
returns the name of the id's spreadsheet | |
std::shared_ptr< WKSContentListener > | createListener (librevenge::RVNGSpreadsheetInterface *interface) |
creates the main listener | |
void | sendHeaderFooter (bool header) |
send the header/footer | |
bool | parseFormatStream () |
check for the existence of a format stream, if it exists, parse it | |
void | resetMainInput (RVNGInputStreamPtr newInput) |
reset the main input | |
bool | readZones () |
finds the different zones (spreadsheet, chart, print, ...) | |
bool | readZone () |
reads a zone | |
bool | readZoneQuattro () |
reads a Quattro Pro zone | |
bool | readFont () |
reads a mswork font | |
bool | readPrnt () |
reads a printer data ? | |
bool | readPrn2 () |
reads another printer data. Seem simillar to ZZPrnt | |
bool | readHeaderFooter (bool header) |
reads the header/footer | |
bool | readFieldName () |
read a list of field name + ... | |
bool | readWindowRecord () |
reads windows record 0:7|0:9 | |
bool | readUnknown1 () |
reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a | |
![]() | |
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 | |
Static Protected Member Functions | |
static RVNGInputStreamPtr | decodeStream (RVNGInputStreamPtr input, long endPos, std::vector< uint8_t > const &key) |
try to decode a stream, if successful, replace the stream'input by the new one | |
Protected Attributes | |
std::shared_ptr< WKSContentListener > | m_listener |
std::shared_ptr< WKS4ParserInternal::State > | m_state |
the listener (if set) | |
std::shared_ptr< WKS4Chart > | m_chartParser |
the chart manager | |
std::shared_ptr< WKS4Spreadsheet > | m_spreadsheetParser |
the spreadsheet manager | |
Friends | |
class | WKS4ParserInternal::SubDocument |
class | WKS4Chart |
class | WKS4Spreadsheet |
This class parses Microsoft Works spreadsheet or a database file.
WKS4Parser::WKS4Parser | ( | RVNGInputStreamPtr & | input, |
WPSHeaderPtr & | header, | ||
libwps_tools_win::Font::Type | encoding = libwps_tools_win::Font::UNKNOWN, | ||
char const * | password = nullptr ) |
constructor
|
override |
destructor
return true if the pos is in the file, update the file size if need
Referenced by checkHeader(), readCString(), readZone(), readZoneQuattro(), and readZones().
checks if the document header is correct (or not)
Referenced by libwps::WPSDocument::isFileFormatSupported(), and parse().
|
protected |
creates the main listener
Referenced by parse().
|
protected |
return the file creator
Referenced by WKS4Spreadsheet::readCell(), and WKS4Chart::updateChart().
|
staticprotected |
try to decode a stream, if successful, replace the stream'input by the new one
Referenced by readZone().
returns the color corresponding to an id
Referenced by WKS4Spreadsheet::readMsWorksDOSCellExtraProperty(), and WKS4Spreadsheet::readMsWorksStyle().
|
protected |
returns the creator
|
protected |
returns the default font type, ie.
the encoding given by the constructor if given or the encoding deduiced from the version.
Referenced by WKS4Spreadsheet::readCell(), readCString(), readFont(), WKS4Spreadsheet::readMsWorksDOSCellExtraProperty(), WKS4Spreadsheet::readMsWorksDOSCellProperty(), WKS4Spreadsheet::readMsWorksDOSFieldProperty(), WKS4Spreadsheet::readMsWorksStyle(), WKS4Spreadsheet::sendCellContent(), and WKS4Chart::sendText().
|
protected |
returns the font corresponding to an id
Referenced by WKS4Spreadsheet::readMsWorksStyle().
|
protected |
returns the name of the id's spreadsheet
Referenced by WKS4Chart::readChart(), and WKS4Chart::readChartSeries().
|
finalvirtual |
called by WPSDocument to parse the file
Implements WKSParser.
|
protected |
check for the existence of a format stream, if it exists, parse it
Referenced by parse().
try to read a basic C string, knowing the maximum size
Referenced by WKS4Spreadsheet::readCellFormulaResult(), WKS4Chart::readChart(), WKS4Chart::readChart2Font(), WKS4Chart::readChartAxis(), WKS4Chart::readChartFont(), WKS4Chart::readChartName(), readFieldName(), readHeaderFooter(), WKS4Spreadsheet::readReportOpen(), and readZone().
|
protected |
read a list of field name + ...
Referenced by readZone().
|
protected |
reads a mswork font
Referenced by readZone().
reads the header/footer
Referenced by readZone().
|
protected |
reads another printer data. Seem simillar to ZZPrnt
Referenced by readZone().
|
protected |
reads a printer data ?
Referenced by readZone().
|
protected |
reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a
Referenced by readZone().
|
protected |
reads windows record 0:7|0:9
Referenced by readZone().
|
protected |
reads a zone
Referenced by checkHeader(), and readZones().
|
protected |
reads a Quattro Pro zone
Referenced by readZones().
|
protected |
finds the different zones (spreadsheet, chart, print, ...)
Referenced by parse().
|
protected |
reset the main input
Referenced by readZone().
|
protected |
return the file version
Referenced by readZones(), WKS4Chart::version(), and WKS4Spreadsheet::version().
|
friend |
|
protected |
the chart manager
Referenced by parse(), readZone(), and resetMainInput().
|
protected |
Referenced by parse(), and sendHeaderFooter().
|
protected |
the spreadsheet manager
Referenced by getSheetName(), parse(), readZone(), readZones(), and resetMainInput().
|
protected |
the listener (if set)
the internal state
Referenced by checkFilePosition(), checkHeader(), createListener(), creator(), getColor(), getCreator(), getDefaultFontType(), getFont(), parse(), parseFormatStream(), readFieldName(), readFont(), readHeaderFooter(), readPrnt(), readZone(), readZones(), sendHeaderFooter(), and version().