STOFFHeader Class Reference documentation

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
STOFFHeader Class Reference

a function used by STOFFDocument to store the version of document More...

`#include <STOFFHeader.hxx>`

## Public Types
typedef enum STOFFDocument::Kind | Kind

## Public Member Functions
| STOFFHeader (int version=0, STOFFDocument::Kind kind=STOFFDocument::STOFF_K_TEXT)
| constructor given the input More...
virtual | ~STOFFHeader ()
| destructor More...
void | reset (int vers, Kind kind=STOFFDocument::STOFF_K_TEXT)
| resets the data More...
int | getVersion () const
| returns the major version More...
void | setVersion (int version)
| sets the major version More...
Kind | getKind () const
| returns the document kind More...
void | setKind (Kind kind)
| sets the document kind More...
bool | isEncrypted () const
| returns true if the file is encypted More...
void | setEncrypted (bool encrypted)
| set the encryption mode More...

## Static Public Member Functions
static std::vector< STOFFHeader > | constructHeader (STOFFInputStreamPtr input)
| tests the input file and returns a header if the file looks like a STOFF document ( trying first to use the resource parsed if it exists ) More...

## Private Attributes
int | m_version
| the document version More...
Kind | m_docKind
| the document kind More...
bool | m_isEncrypted
| flag to know if the file is encrypted More...

## Detailed Description

a function used by STOFFDocument to store the version of document

This class is responsible for finding a list of potential formats corresponding to a file, this list will latter be checked by calling the corresponding parser's function checkHeader via STOFFDocument.

This class also allows to store the document type, king and version.

## Member Typedef Documentation

typedef enum STOFFDocument::Kind STOFFHeader::Kind

## Constructor & Destructor Documentation

STOFFHeader::STOFFHeader | ( | int | version = `0`,
|  | STOFFDocument::Kind | kind = `STOFFDocument::STOFF_K_TEXT`
| ) |  |

constructor given the input

Parameters

  version | the file version
  kind | the document kind (default word processing document)

Referenced by constructHeader().

STOFFHeader::~STOFFHeader | ( |  | ) |
| virtual

destructor

## Member Function Documentation

std::vector< STOFFHeader > STOFFHeader::constructHeader | ( | STOFFInputStreamPtr | input | ) |
| static

tests the input file and returns a header if the file looks like a STOFF document ( trying first to use the resource parsed if it exists )

So far, we have identified.

Note
  this check phase can only be partial ; ie. we only test the first bytes of the file and/or the existence of some oles. This explains that STOFFDocument implements a more complete test to recognize the difference Mac Files which share the same type of header...

Referenced by STOFFDocumentInternal::getHeader().

Kind STOFFHeader::getKind | ( |  | ) | const
| inline

returns the document kind

Referenced by STOFFDocumentInternal::getGraphicParserFromHeader(), STOFFDocumentInternal::getSpreadsheetParserFromHeader(), STOFFDocumentInternal::getTextParserFromHeader(), and STOFFParserState::STOFFParserState().

int STOFFHeader::getVersion | ( |  | ) | const
| inline

returns the major version

Referenced by STOFFParserState::STOFFParserState().

bool STOFFHeader::isEncrypted | ( |  | ) | const
| inline

returns true if the file is encypted

void STOFFHeader::reset | ( | int | vers,
|  | Kind | kind = `STOFFDocument::STOFF_K_TEXT`
| ) |  |
| inline

resets the data

Referenced by SDAParser::checkHeader(), SDWParser::checkHeader(), SDGParser::checkHeader(), and SDCParser::checkHeader().

void STOFFHeader::setEncrypted | ( | bool | encrypted | ) |
| inline

set the encryption mode

Referenced by SDAParser::checkHeader(), and SDCParser::checkHeader().

void STOFFHeader::setKind | ( | Kind | kind | ) |
| inline

sets the document kind

void STOFFHeader::setVersion | ( | int | version | ) |
| inline

sets the major version

## Member Data Documentation

Kind STOFFHeader::m_docKind
| private

the document kind

Referenced by getKind(), reset(), and setKind().

bool STOFFHeader::m_isEncrypted
| private

flag to know if the file is encrypted

Referenced by isEncrypted(), and setEncrypted().

int STOFFHeader::m_version
| private

the document version

Referenced by getVersion(), reset(), and setVersion().

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

- STOFFHeader.hxx
- STOFFHeader.cxx