Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

DWFToolkit::DWFPackageReader Class Reference
[DWF Package API]

#include "dwf/package/reader/PackageReader.h"

Inheritance diagram for DWFToolkit::DWFPackageReader:

Inheritance graph
[legend]
Collaboration diagram for DWFToolkit::DWFPackageReader:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class is used to process DWF package files.
Since:
7.0.1.

Note:
This class is built specifically for handling DWF 6 (and higher) packages. Please be sure to check the type with getPackageInfo() or GetPackageInfo() and handle single graphics streams separately with the appropriate toolkits.
Warning:
This object uses an implementation of the zip library that is not thread-safe. This implies that this class is not re-entrant and data should be extracted completely in-whole.

Todo:
Provide a thread-safe reader implementation.
Examples:

DWFGoogleDesktopCrawl/DWFCrawlHandler.cpp, ObjectDefinitionReader/ObjectDefinitionReader.cpp, SimpleEnumReader/SimpleEnumReader.cpp, SimpleW3DStreamProcessor/SimpleW3DStreamProcessor.cpp, and TimedXMLReader/TimedXMLReader.cpp.

Definition at line 86 of file PackageReader.h.

Public Types

enum  tePackageType {
  eDWFPackage, eDWFPackageEncrypted, eW2DStream, eDWFStream,
  eZIPFile, eUnknown
}
 Enumerations for known data file types. More...

Public Member Functions

_DWFTK_API DWFPackageReader (const DWFFile &zDWFPackageFile, const DWFString &zDWFPackagePassword=L"") throw ()
_DWFTK_API DWFPackageReader (DWFInputStream &rDWFPackageStream, const DWFString &zDWFPackagePassword=L"") throw ()
virtual _DWFTK_API ~DWFPackageReader () throw ()
_DWFTK_API void setPackagePassword (const DWFString &zDWFPackagePassword) throw ()
_DWFTK_API void getPackageInfo (tPackageInfo &rInfo) throw ( DWFException )
_DWFTK_API DWFManifestgetManifest (DWFManifestReader *pFilter=NULL) throw ( DWFException )
_DWFTK_API void getManifest (DWFManifestReader &rManifestReader) throw ( DWFException )
virtual _DWFTK_API DWFInputStreamextract (const DWFString &zFilename, bool bCache=false) throw ( DWFException )
DWFSectionBuildergetSectionBuilder () throw ( DWFException )

Static Public Member Functions

static void XMLCALL StartElementHandler (void *pCallback, const char *zName, const char **ppAttributeList) throw ()
static void XMLCALL EndElementHandler (void *pCallback, const char *zName) throw ()
static void XMLCALL StartNamespaceDeclHandler (void *pCallback, const char *zPrefix, const char *zURI) throw ()
static void XMLCALL EndNamespaceDeclHandler (void *pCallback, const char *zPrefix) throw ()
static void XMLCALL CharacterDataHandler (void *pCallback, const char *zCData, int nLength) throw ()
static _DWFTK_API void GetPackageInfo (const unsigned char *pBuffer, tPackageInfo &rInfo) throw ( DWFException )

Protected Member Functions

_DWFTK_API DWFPackageReader () throw ()
virtual void _open () throw ( DWFException )

Protected Attributes

DWFStringKeySkipList< DWFTempFile * > _oLocalFileCache


Member Enumeration Documentation

enum DWFToolkit::DWFPackageReader::tePackageType
 

Enumerations for known data file types.

Enumeration values:
eDWFPackage  DWF 6 (and higher) zip package format.
eDWFPackageEncrypted  Password protected DWF 6 (and higher) zip package format.
eW2DStream  2D graphics stream/file resource.
eDWFStream  Legacy DWF 0.55 (or lower) data and graphics stream.
eZIPFile  A non-DWF zip package format.
eUnknown  Unknown format.

Definition at line 94 of file PackageReader.h.


Constructor & Destructor Documentation

_DWFTK_API DWFToolkit::DWFPackageReader::DWFPackageReader const DWFFile zDWFPackageFile,
const DWFString zDWFPackagePassword = L""
throw ()
 

Constructor

Use this constructor for a file-based read configuration.

Parameters:
zDWFPackageFile The DWF file to open and process.
zDWFPackagePassword An optional password for encrypted files.
Exceptions:
None 

_DWFTK_API DWFToolkit::DWFPackageReader::DWFPackageReader DWFInputStream rDWFPackageStream,
const DWFString zDWFPackagePassword = L""
throw ()
 

Constructor

Use this constructor for a stream-based read configuration.

Parameters:
rDWFPackageStream The DWF stream to open and process.
zDWFPackagePassword An optional password for encrypted files.
Exceptions:
None 

virtual _DWFTK_API DWFToolkit::DWFPackageReader::~DWFPackageReader  )  throw () [virtual]
 

Destructor

Exceptions:
None 

_DWFTK_API DWFToolkit::DWFPackageReader::DWFPackageReader  )  throw () [protected]
 

Constructor

Exceptions:
None 


Member Function Documentation

virtual void DWFToolkit::DWFPackageReader::_open  )  throw ( DWFException ) [protected, virtual]
 

Opens the package file and configures the descriptor or stream for reading.

Exceptions:
DWFException 

static void XMLCALL DWFToolkit::DWFPackageReader::CharacterDataHandler void *  pCallback,
const char *  zCData,
int  nLength
throw () [static]
 

Expat callback handler.

This method acts only as a router for pCallback which is required to implement DWFXMLCallback::notifyCharacterData().

Parameters:
pCallback An implementation of DWFXMLCallback.
zCData A non-null-terminated string of CDATA.
nLength The number of characters in zCData.
Exceptions:
None 

static void XMLCALL DWFToolkit::DWFPackageReader::EndElementHandler void *  pCallback,
const char *  zName
throw () [static]
 

Expat callback handler.

This method acts only as a router for pCallback which is required to implement DWFXMLCallback::notifyEndElement().

Parameters:
pCallback An implementation of DWFXMLCallback.
zName The name of the element (includes any namespace prefix)
Exceptions:
None 

static void XMLCALL DWFToolkit::DWFPackageReader::EndNamespaceDeclHandler void *  pCallback,
const char *  zPrefix
throw () [static]
 

Expat callback handler.

This method acts only as a router for pCallback which is required to implement DWFXMLCallback::notifyEndNamespace().

Parameters:
pCallback An implementation of DWFXMLCallback.
zPrefix The namespace prefix.
Exceptions:
None 

virtual _DWFTK_API DWFInputStream* DWFToolkit::DWFPackageReader::extract const DWFString zFilename,
bool  bCache = false
throw ( DWFException ) [virtual]
 

Returns a stream for reading the archived file.

Parameters:
zFilename The full path of the file in the package.
bCache If true, a local copy of the file contents will be generated and cached until this package reader object is destroyed.
Returns:
A stream from which the file contents can be read. The caller must delete this pointer with the DWFCORE_FREE_OBJECT macro.
Exceptions:
None 
Examples:
DWFGoogleDesktopCrawl/DWFCrawlHandler.cpp.

_DWFTK_API void DWFToolkit::DWFPackageReader::getManifest DWFManifestReader rManifestReader  )  throw ( DWFException )
 

Processes the package manifest using the reader callback provided.

This allows the user to participate directly in the parsing process. No in-memory data representation will be created nor cached by the DWFPackageReader implicitly.

Parameters:
rManifestReader The reader implementation for the manifest.
Exceptions:
DWFException 

_DWFTK_API DWFManifest& DWFToolkit::DWFPackageReader::getManifest DWFManifestReader pFilter = NULL  )  throw ( DWFException )
 

Processes the package manifest, assembles and returns an in-memory data structure representation.

Parameters:
pFilter Another reader may be provided as a filter for parsing and construction of the DWFManifest. See DWFManifestReader::setFilter() for details.
Exceptions:
DWFException 
Examples:
DWFGoogleDesktopCrawl/DWFCrawlHandler.cpp.

static _DWFTK_API void DWFToolkit::DWFPackageReader::GetPackageInfo const unsigned char *  pBuffer,
tPackageInfo &  rInfo
throw ( DWFException ) [static]
 

Returns the DWF package information as read from the buffer provided which is expected to contain the DWF file header in the first 12 bytes.

Parameters:
pBuffer The memory buffer from which the DWF header can be extracted.
rInfo The package information from the DWF header.
Exceptions:
DWFException 

_DWFTK_API void DWFToolkit::DWFPackageReader::getPackageInfo tPackageInfo &  rInfo  )  throw ( DWFException )
 

Returns the DWF package information.

Parameters:
rInfo The package information from the DWF header.
Exceptions:
DWFException 
Examples:
DWFGoogleDesktopCrawl/DWFCrawlHandler.cpp.

DWFSectionBuilder& DWFToolkit::DWFPackageReader::getSectionBuilder  )  throw ( DWFException )
 

Returns a builder for creating new sections.

The section builder is made available to the various document reader implementations (particularly the DWFManifestReader) so that strongly typed section objects can be instantiated as needed. See the DWFSectionBuilder interface for details.

Returns:
The section builder.
Exceptions:
DWFException 

_DWFTK_API void DWFToolkit::DWFPackageReader::setPackagePassword const DWFString zDWFPackagePassword  )  throw ()
 

Set the DWF package password (if unknown at construction time).

Parameters:
zDWFPackagePassword An optional password for encrypted files.
Exceptions:
None 

static void XMLCALL DWFToolkit::DWFPackageReader::StartElementHandler void *  pCallback,
const char *  zName,
const char **  ppAttributeList
throw () [static]
 

Expat callback handler.

This method acts only as a router for pCallback which is required to implement DWFXMLCallback::notifyStartElement().

Parameters:
pCallback An implementation of DWFXMLCallback.
zName The name of the element (includes any namespace prefix)
ppAttributeList An array of null-terminated atribute name, value string pairs. The array itself is zero-terminated.
Exceptions:
None 

static void XMLCALL DWFToolkit::DWFPackageReader::StartNamespaceDeclHandler void *  pCallback,
const char *  zPrefix,
const char *  zURI
throw () [static]
 

Expat callback handler.

This method acts only as a router for pCallback which is required to implement DWFXMLCallback::notifyStartNamespace().

Parameters:
pCallback An implementation of DWFXMLCallback.
zPrefix The namespace prefix.
zURI The namespace URI (may be NULL).
Exceptions:
None 


Member Data Documentation

DWFStringKeySkipList<DWFTempFile*> DWFToolkit::DWFPackageReader::_oLocalFileCache [protected]
 

Files that have been extracted and requested to be cached are stored in temporary files. These files are tracked by this collection.

Definition at line 391 of file PackageReader.h.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:39:06 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1