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

DWFToolkit::DWFSection Class Reference
[DWF Package API]

#include "dwf/package/Section.h"

Inheritance diagram for DWFToolkit::DWFSection:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

This class contains the base functionality for all sections in a DWF package.
Since:
7.0.1.

Section Descriptors

While the package manifest outlines general section information, it is the section's descriptor that provides the details. The section classes in the toolkit are structured for highly efficient processing. As such, the descriptors are never automatically loaded. On-demand descriptor parsing allows for the most flexibility when processing an entire DWF package. That said, it is very strongly recommended that a section's descriptor is read into the DWFSection object before using it's data and resources; especially when copying or moving resources between sections.
Examples:

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

Definition at line 71 of file Section.h.

Public Types

typedef vector< DWFSection * > tList
 This type defines a list of DWFSection pointers.
typedef DWFWCharKeySkipList<
DWFSection * > 
tMap
 This type defines a mapped collection of DWFSection pointers.
typedef multimap< const wchar_t *,
DWFSection *, tDWFWCharCompareLess
tMultiMap
 This type defines a multi-value mapped collection of DWFSection pointers.

Public Member Functions

_DWFTK_API DWFSection (DWFPackageReader *pPackageReader) throw ()
_DWFTK_API DWFSection (const DWFString &zType, const DWFString &zName, const DWFString &zTitle, DWFPackageReader *pPackageReader) throw ()
_DWFTK_API DWFSection (const DWFString &zType, const DWFString &zTitle, const DWFString &zObjectID, double nVersion, double nPlotOrder, const DWFSource &rSource) throw ()
_DWFTK_API DWFSection (const DWFSection &rSection) throw ()
_DWFTK_API DWFSectionoperator= (const DWFSection &rSection) throw ()
virtual _DWFTK_API ~DWFSection () throw ()
_DWFTK_API const DWFStringname () const throw ()
virtual _DWFTK_API void rename (const DWFString &zName) throw ()
_DWFTK_API const DWFStringtype () const throw ()
_DWFTK_API const DWFStringtitle () const throw ()
_DWFTK_API const DWFSourcesource () const throw ()
_DWFTK_API void addSource (const DWFSource &rSource) throw ()
virtual _DWFTK_API DWFInterfacebuildInterface () throw ( DWFException )
_DWFTK_API const DWFStringobjectID () const throw ()
_DWFTK_API double version () const throw ()
_DWFTK_API double order () const throw ()
virtual _DWFTK_API void reorder (double nPlotOrder) throw ()
virtual _DWFTK_API const DWFResourcereadDescriptor (DWFSectionDescriptorReader *pSectionDescriptorReader=NULL) const throw ( DWFException )
virtual _DWFTK_API void readDescriptor (DWFSectionDescriptorReader &rSectionDescriptorReader, DWFResource &rResource) const throw ( DWFException )
virtual _DWFTK_API void readDescriptor (DWFSectionDescriptorReader &rSectionDescriptorReader, DWFInputStream &rSectionDescriptorStream) const throw ( DWFException )
virtual _DWFTK_API DWFObjectDefinitiongetObjectDefinition () const throw ( DWFException )
virtual _DWFTK_API void getObjectDefinition (DWFObjectDefinitionReader &rObjectDefinitionReader, DWFResource *pResource=NULL) const throw ( DWFException )
virtual _DWFTK_API void getObjectDefinition (DWFObjectDefinitionReader &rObjectDefinitionReader, DWFInputStream &rObjectDefinitionStream) const throw ( DWFException )
virtual _DWFTK_API void parseAttributeList (const char **ppAttributeList) throw ( DWFException )
virtual _DWFTK_API void serializeXML (DWFXMLSerializer &rSerializer, unsigned int nFlags) throw ( DWFException )

Protected Member Functions

virtual DWFResourcebuildResource (const char **ppAttributeList, DWFPackageReader *pPackageReader) throw ( DWFException )
virtual DWFFontResourcebuildFontResource (const char **ppAttributeList, DWFPackageReader *pPackageReader) throw ( DWFException )
virtual DWFImageResourcebuildImageResource (const char **ppAttributeList, DWFPackageReader *pPackageReader) throw ( DWFException )
DWFGraphicResourcebuildGraphicResource (const char **ppAttributeList, DWFPackageReader *pPackageReader) throw ( DWFException )

Classes

class  Factory
 Class factory for DWFSection objects.
Since:
7.0.1.
More...


Constructor & Destructor Documentation

_DWFTK_API DWFToolkit::DWFSection::DWFSection DWFPackageReader pPackageReader  )  throw ()
 

Constructor

This constructor is generally only used by the parsing process when the DWFPackageReader associated with (and providing read access to) the DWF package file is available. The subsequent binding makes it possible to read section content data from the DWF package.

Parameters:
pPackageReader Provides access to section content in the DWF package.
Exceptions:
None 

_DWFTK_API DWFToolkit::DWFSection::DWFSection const DWFString zType,
const DWFString zName,
const DWFString zTitle,
DWFPackageReader pPackageReader
throw ()
 

Constructor

This constructor is generally only used by the parsing process when the DWFPackageReader associated with (and providing read access to) the DWF package file is available. The subsequent binding makes it possible to read section content data from the DWF package.

Parameters:
zType The section type identifier.
zName A string that uniquely identifies the section in the DWF package.
zTitle The descriptive and display friendly title text.
pPackageReader Provides access to section content in the DWF package.
Exceptions:
None 

_DWFTK_API DWFToolkit::DWFSection::DWFSection const DWFString zType,
const DWFString zTitle,
const DWFString zObjectID,
double  nVersion,
double  nPlotOrder,
const DWFSource rSource
throw ()
 

Constructor

This constructor is generally used by applications and publishers for creating new section objects.

Parameters:
zType The section type identifier.
zTitle The descriptive and display friendly title text.
zObjectID Uniquely identifies the section.
nVersion Identifies the version of the section type and/or descriptor.
nPlotOrder Indicates the initial position in the package to which the section was/will be published.
rSource Describes the original source of the data in the section (a drawing file, for example.)
Exceptions:
None 

_DWFTK_API DWFToolkit::DWFSection::DWFSection const DWFSection rSection  )  throw ()
 

Copy Constructor

Parameters:
rSection The source from which to construct this object.
Exceptions:
None 

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

Destructor

Exceptions:
None 


Member Function Documentation

_DWFTK_API void DWFToolkit::DWFSection::addSource const DWFSource rSource  )  throw ()
 

Identifies/updates the source information for this section.

This method will overwrite any existing data.

Parameters:
rSource The source object from which to copy data.
Exceptions:
None 

virtual DWFFontResource* DWFToolkit::DWFSection::buildFontResource const char **  ppAttributeList,
DWFPackageReader pPackageReader
throw ( DWFException ) [protected, virtual]
 

Builds a font resource.

Parameters:
ppAttributeList The attribute list for class member data.
pPackageReader The DWF package source data I/O object.
Exceptions:
DWFException 

Reimplemented from DWFToolkit::DWFXMLElementBuilder.

DWFGraphicResource* DWFToolkit::DWFSection::buildGraphicResource const char **  ppAttributeList,
DWFPackageReader pPackageReader
throw ( DWFException ) [protected, virtual]
 

Builds a graphic resource.

Parameters:
ppAttributeList The attribute list for class member data.
pPackageReader The DWF package source data I/O object.
Exceptions:
DWFException 

Reimplemented from DWFToolkit::DWFXMLElementBuilder.

virtual DWFImageResource* DWFToolkit::DWFSection::buildImageResource const char **  ppAttributeList,
DWFPackageReader pPackageReader
throw ( DWFException ) [protected, virtual]
 

Builds a image resource.

Parameters:
ppAttributeList The attribute list for class member data.
pPackageReader The DWF package source data I/O object.
Exceptions:
DWFException 

Reimplemented from DWFToolkit::DWFXMLElementBuilder.

virtual _DWFTK_API DWFInterface* DWFToolkit::DWFSection::buildInterface  )  throw ( DWFException ) [inline, virtual]
 

Returns the interface associated with the section type.

An interface identifier is used in the DWF package manifest to document, for quick reference, the all section types in the package.

Returns:
A pointer to a new interface object. This object will be allocated using the DWFCORE_ALLOC_OBJECT macro and must be deleted by the caller using the DWFCORE_FREE_OBJECT macro.
Exceptions:
DWFException 

Reimplemented in DWFToolkit::DWFEModelSection, and DWFToolkit::DWFEPlotSection.

Definition at line 396 of file Section.h.

virtual DWFResource* DWFToolkit::DWFSection::buildResource const char **  ppAttributeList,
DWFPackageReader pPackageReader
throw ( DWFException ) [protected, virtual]
 

Builds a generic or untyped resource.

Parameters:
ppAttributeList The attribute list for class member data.
pPackageReader The DWF package source data I/O object.
Exceptions:
DWFException 

Reimplemented from DWFToolkit::DWFXMLElementBuilder.

virtual _DWFTK_API void DWFToolkit::DWFSection::getObjectDefinition DWFObjectDefinitionReader rObjectDefinitionReader,
DWFInputStream rObjectDefinitionStream
const throw ( DWFException ) [virtual]
 

Processes object definitions using the reader interface provided. This allows the caller to participate directly in the parsing process. No in-memory data representation will be created nor cached by the DWFSection implicitly.

rObjectDefinitionReader An interface reference to an object that knows how to read and parse object definition documents. rObjectDefinitionStream A stream providing an object definition document for this section.

Exceptions:
DWFException 

virtual _DWFTK_API void DWFToolkit::DWFSection::getObjectDefinition DWFObjectDefinitionReader rObjectDefinitionReader,
DWFResource pResource = NULL
const throw ( DWFException ) [virtual]
 

Processes object definitions using the reader interface provided. This allows the caller to participate directly in the parsing process. No in-memory data representation will be created nor cached by the DWFSection implicitly.

rObjectDefinitionReader An interface reference to an object that knows how to read and parse object definition documents. pResource An optional pointer to an object definition resource. If NULL, all object definition resources will be processed.

Exceptions:
DWFException 

virtual _DWFTK_API DWFObjectDefinition* DWFToolkit::DWFSection::getObjectDefinition  )  const throw ( DWFException ) [virtual]
 

Returns:
A pointer to a new DWFObjectDefinition. The caller is reponsible for deleting this pointer with the DWFCORE_FREE_OBJECT macro.
Exceptions:
DWFException 
Examples:
DWFGoogleDesktopCrawl/DWFCrawlHandler.cpp, ObjectDefinitionReader/ObjectDefinitionReader.cpp, and TimedXMLReader/TimedXMLReader.cpp.

_DWFTK_API const DWFString& DWFToolkit::DWFSection::name  )  const throw () [inline]
 

Returns the section name.

The section name refers to the string that uniquely identifies the section in the DWF package. In the current format specification, the section name is used as the virtual directory in the zip archive. Usually this name is a string representation of a UUID. The title() method should be used to retrieve the descriptive and display friendly text title of the section.

Returns:
A string that uniquely identifies the section in the DWF package.
Exceptions:
None 
Examples:
SimpleEnumReader/SimpleEnumReader.cpp.

Definition at line 304 of file Section.h.

_DWFTK_API const DWFString& DWFToolkit::DWFSection::objectID  )  const throw () [inline]
 

Returns a unique identifier for the section.

This identifier should be immutable for the life of the section; remaining unchanged during relocation and aggregation (the same is not true of the name()).

Returns:
A reference to the unique section identifier.
Exceptions:
None 
Examples:
SimpleEnumReader/SimpleEnumReader.cpp.

Definition at line 413 of file Section.h.

_DWFTK_API DWFSection& DWFToolkit::DWFSection::operator= const DWFSection rSection  )  throw ()
 

Assignment Operator

Parameters:
rSection The source from which to construct this object.
Exceptions:
None 

_DWFTK_API double DWFToolkit::DWFSection::order  )  const throw () [inline]
 

Returns the order in which the section was published.

Returns:
The plot order.
Exceptions:
None 
Examples:
SimpleEnumReader/SimpleEnumReader.cpp.

Definition at line 442 of file Section.h.

virtual _DWFTK_API void DWFToolkit::DWFSection::parseAttributeList const char **  ppAttributeList  )  throw ( DWFException ) [virtual]
 

Receives and processes an attribute list from the parser; using it to initialize class members.

Example:

                 size_t iAttrib = 0;
       
                 for(; ppAttributeList[iAttrib]; iAttrib += 2)
                 {
                    //
                    // dump attribute 
                    //
                    cout << "Attribute Name: " << ppAttributeList[iAttrib] << " ";
                    cout << "Attribute Value: " << ppAttributeList[iAttrib+1] << endl;
                }

Parameters:
ppAttributeList An array of null-terminated atribute name, value string pairs. The array itself is zero-terminated.
Exceptions:
None 

Implements DWFToolkit::DWFXMLBuildable.

virtual _DWFTK_API void DWFToolkit::DWFSection::readDescriptor DWFSectionDescriptorReader rSectionDescriptorReader,
DWFInputStream rSectionDescriptorStream
const throw ( DWFException ) [virtual]
 

Processes the section descriptor using the reader interface provided. This allows the caller to participate directly in the parsing process. No in-memory data representation will be created nor cached by the DWFSection implicitly.

Parameters:
rSectionDescriptorReader An interface reference to an object that knows how to read and parse the descriptor associated with this section [type].
rSectionDescriptorStream A stream providing the descriptor document for this section.
Exceptions:
DWFException 

virtual _DWFTK_API void DWFToolkit::DWFSection::readDescriptor DWFSectionDescriptorReader rSectionDescriptorReader,
DWFResource rResource
const throw ( DWFException ) [virtual]
 

Processes the section descriptor using the reader interface provided. This allows the caller to participate directly in the parsing process. No in-memory data representation will be created nor cached by the DWFSection implicitly.

Parameters:
rSectionDescriptorReader An interface reference to an object that knows how to read and parse the descriptor associated with this section [type].
rResource The descriptor document resource for this section.
Exceptions:
DWFException 

virtual _DWFTK_API const DWFResource& DWFToolkit::DWFSection::readDescriptor DWFSectionDescriptorReader pSectionDescriptorReader = NULL  )  const throw ( DWFException ) [virtual]
 

Returns:
A reference to the descriptor document resource.
Exceptions:
DWFException 

Reimplemented in DWFToolkit::DWFEModelSection, DWFToolkit::DWFEPlotSection, and DWFToolkit::DWFGlobalSection.

Examples:
SimpleEnumReader/SimpleEnumReader.cpp, and TimedXMLReader/TimedXMLReader.cpp.

virtual _DWFTK_API void DWFToolkit::DWFSection::rename const DWFString zName  )  throw () [virtual]
 

Change the section name.

This method is generally used during the internal publishing process in DWFPackageWriter::addSection() to ensure uniqueness.

The section name refers to the string that uniquely identifies the section in the DWF package. In the current format specification, the section name is used as the virtual directory in the zip archive. Usually this name is a string representation of a UUID. The title() method should be used to retrieve the descriptive and display friendly text title of the section.

Parameters:
zName A string that uniquely identifies the section in the DWF package.
Exceptions:
None 

Reimplemented from DWFToolkit::DWFResourceContainer.

virtual _DWFTK_API void DWFToolkit::DWFSection::reorder double  nPlotOrder  )  throw () [inline, virtual]
 

Note:
Sections are always re-ordered by the DWFPackageWriter.

Definition at line 457 of file Section.h.

virtual _DWFTK_API void DWFToolkit::DWFSection::serializeXML DWFXMLSerializer rSerializer,
unsigned int  nFlags
throw ( DWFException ) [virtual]
 

Writes an XML representation of the object into a stream.

Parameters:
rSerializer The object that accepts the serialization of the object.
nFlags An implementation-defined set of options for altering the serialization process of this object.

Implements DWFToolkit::DWFXMLSerializable.

Reimplemented in DWFToolkit::DWFCustomSection, DWFToolkit::DWFEModelSection, DWFToolkit::DWFEPlotSection, DWFToolkit::DWFGlobalSection, DWFToolkit::DWFEPlotGlobalSection, and DWFToolkit::DWFEModelGlobalSection.

_DWFTK_API const DWFSource& DWFToolkit::DWFSection::source  )  const throw () [inline]
 

Returns an object that can be used to identify the source of the original data from which the section content was created.

Source will always exist but may contain empty elements.

Returns:
The source object.
Exceptions:
None 

Definition at line 366 of file Section.h.

_DWFTK_API const DWFString& DWFToolkit::DWFSection::title  )  const throw () [inline]
 

Returns the section title.

Returns:
The descriptive and display friendly title text.
Exceptions:
None 
Examples:
SimpleEnumReader/SimpleEnumReader.cpp.

Definition at line 349 of file Section.h.

_DWFTK_API const DWFString& DWFToolkit::DWFSection::type  )  const throw () [inline]
 

Returns the section type.

Returns:
The section type identifier.
Exceptions:
None 
Examples:
GlobalSectionWriter/GlobalSectionWriter.cpp, ObjectDefinitionReader/ObjectDefinitionReader.cpp, SimpleEnumReader/SimpleEnumReader.cpp, SimpleEPlotWriter/SimpleEPlotWriter_UTF8.cpp, and SimpleW3DStreamProcessor/SimpleW3DStreamProcessor.cpp.

Definition at line 336 of file Section.h.

_DWFTK_API double DWFToolkit::DWFSection::version  )  const throw () [inline]
 

Returns the version of the section and/or descriptor.

Section types/classes should always be versioned to ensure backwards compatability.

Returns:
The version number.
Exceptions:
None 
Examples:
SimpleEnumReader/SimpleEnumReader.cpp.

Definition at line 429 of file Section.h.


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