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 | |
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 | |
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 | |
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 |
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
|
protected |
return true if the pos is in the file, update the file size if need
Referenced by checkHeader(), readCString(), readZone(), readZoneQuattro(), and readZones().
bool WKS4Parser::checkHeader | ( | WPSHeader * | header, |
bool | strict = false ) |
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
|
staticprotected |
try to decode a stream, if successful, replace the stream'input by the new one
Referenced by readZone().
|
protected |
returns the color corresponding to an id
|
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 readCString(), and readFont().
|
protected |
returns the font corresponding to an id
|
protected |
returns the name of the id's spreadsheet
|
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().
bool WKS4Parser::readCString | ( | librevenge::RVNGString & | string, |
long | maxSize ) |
try to read a basic C string, knowing the maximum size
Referenced by readFieldName(), readHeaderFooter(), and readZone().
|
protected |
read a list of field name + ...
Referenced by readZone().
|
protected |
reads a mswork font
Referenced by readZone().
|
protected |
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 |
send the header/footer
Referenced by WKS4ParserInternal::SubDocument::parse().
|
protected |
return the file version
Referenced by readZones().
|
friend |
Referenced by WKS4Chart, and WKS4Parser().
|
friend |
|
friend |
Referenced by WKS4Parser(), and WKS4Spreadsheet.
|
protected |
the chart manager
Referenced by parse(), readZone(), resetMainInput(), and WKS4Parser().
|
protected |
Referenced by parse(), sendHeaderFooter(), and WKS4Parser().
|
protected |
the spreadsheet manager
Referenced by getSheetName(), parse(), readZone(), readZones(), resetMainInput(), and WKS4Parser().
|
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(), version(), and WKS4Parser().