libwps::WPSDocument Class Reference

This class provides all the functions an application would need to parse Works documents. More...

`#include <WPSDocument.h>`

## Static Public Member Functions
static WPSLIB WPSConfidence | isFileFormatSupported (librevenge::RVNGInputStream *input, WPSKind &kind, WPSCreator &creator, bool &needCharSetEncoding)
| Analyzes the content of an input stream to see if it can be parsed.
static WPSLIB WPSResult | parse (librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, char const *password="", char const *encoding="")
| Parses the input stream content.
static WPSLIB WPSResult | parse (librevenge::RVNGInputStream *input, librevenge::RVNGSpreadsheetInterface *documentInterface, char const *password="", char const *encoding="")
| Parses the input stream content.

## Detailed Description

This class provides all the functions an application would need to parse Works documents.

## Member Function Documentation

## ◆ isFileFormatSupported()

WPSLIB WPSConfidence WPSDocument::isFileFormatSupported | ( | librevenge::RVNGInputStream * | input,
|  | WPSKind & | kind,
|  | WPSCreator & | creator,
|  | bool & | needCharSetEncoding )
| static

Analyzes the content of an input stream to see if it can be parsed.

Parameters

  input | The input stream
  kind | The document kind
  creator | The document creator
  needCharSetEncoding | A flag set to true if we need the character set encoding

Returns
  A confidence value which represents the likelyhood that the content from the input stream can be parsed:
  - WPS_CONFIDENCE_NONE if the file is not supported,
  - WPS_CONFIDENCE_EXCELLENT if the file is supported,
  - WPS_CONFIDENCE_SUPPORTED_ENCRYTION if the file is supported but we need to have the password

Note
  - as Dos/Windows 3 File does not seems to contain the char set encoding, the function can accept the following hint encoding CP424, CP437, CP737, CP775, CP850, CP852, CP855, CP856, CP857, CP860, CP861, CP862, CP863, CP864, CP865, CP866, CP869, CP874, CP932, CP950, CP1006, CP1250, CP1251, CP1252, CP1253, CP1254, CP1255, CP1256, CP1257, CP1258.
  - If no encoding is given, CP850 or CP1250 will be used.

## ◆ parse() [1/2]

WPSLIB WPSResult WPSDocument::parse | ( | librevenge::RVNGInputStream * | input,
|  | librevenge::RVNGSpreadsheetInterface * | documentInterface,
|  | char const * | password = "",
|  | char const * | encoding = "" )
| static

Parses the input stream content.

It will make callbacks to the functions provided by a librevenge::RVNGSpreadsheetInterface class implementation when needed. This is often commonly called the 'main parsing routine'.

Parameters

  input | The input stream
  documentInterface | A librevenge::RVNGSpreadsheetInterface implementation
  password | the file password
  encoding | the encoding

## ◆ parse() [2/2]

WPSLIB WPSResult WPSDocument::parse | ( | librevenge::RVNGInputStream * | input,
|  | librevenge::RVNGTextInterface * | documentInterface,
|  | char const * | password = "",
|  | char const * | encoding = "" )
| static

Parses the input stream content.

It will make callbacks to the functions provided by a librevenge::RVNGTextInterface class implementation when needed. This is often commonly called the 'main parsing routine'.

Parameters

  input | The input stream
  documentInterface | A librevenge::RVNGTextInterface implementation
  password | the file password
  encoding | the encoding

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

- WPSDocument.h
- WPSDocument.cpp