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

ObjectDefinitionReader.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2005 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 
00020 #ifndef _DWFTK_OBJECT_DEFINITION_READER_H
00021 #define _DWFTK_OBJECT_DEFINITION_READER_H
00022 
00023 
00028 
00029 #include "dwfcore/Core.h"
00030 #include "dwfcore/STL.h"
00031 using namespace DWFCore;
00032 
00033 #include "dwf/package/XML.h"
00034 #include "dwf/package/Property.h"
00035 #include "dwf/package/DefinedObject.h"
00036 #include "dwf/package/reader/PackageReader.h"
00037 
00038 
00039 namespace DWFToolkit
00040 {
00041 
00057 class DWFObjectDefinitionReader : public DWFXMLCallback
00058 {
00059 
00060 public:
00061 
00069     typedef enum
00070     {
00074         eProvideNone                =   0x00,
00075 
00079         eProvideVersion             =   0x01,
00080 
00084         eProvideProperties          =   0x02,
00088         eProvideObjects             =   0x04,
00092         eProvideInstances           =   0x08,
00093 
00097         eProvideAttributes          =   0x01,
00101         eProvideElements            =   0x0E,
00102 
00106         eProvideAll                 =   0xFF
00107 
00108     } teProviderType;
00109 
00110 public:
00111 
00119     _DWFTK_API
00120     DWFObjectDefinitionReader( DWFPackageReader* pPackageReader = NULL,
00121                                unsigned char     nProviderFlags = eProvideAll )
00122         throw();
00123 
00129     _DWFTK_API
00130     virtual ~DWFObjectDefinitionReader()
00131         throw();
00132 
00140     _DWFTK_API
00141     virtual void provideVersion( double nVersion)
00142         throw();
00143 
00154     _DWFTK_API
00155     virtual void provideProperties( const DWFString&    zID,
00156                                     vector<DWFString>*  pPropertyRefs,
00157                                     DWFProperty::tList* pPropertyList )
00158         throw();
00159 
00167     _DWFTK_API
00168     virtual void provideObject( DWFDefinedObject* pObject )
00169         throw();
00170 
00178     _DWFTK_API
00179     virtual void provideInstance( DWFDefinedObjectInstance* pInstance )
00180         throw();
00181 
00185     _DWFTK_API
00186     void notifyStartElement( const char*   zName,
00187                              const char**  ppAttributeList )
00188         throw();
00189 
00193     _DWFTK_API
00194     void notifyEndElement( const char*     zName )
00195         throw();
00196 
00200     _DWFTK_API
00201     void notifyStartNamespace( const char* zPrefix,
00202                                const char* zURI )
00203         throw();
00204 
00208     _DWFTK_API
00209     void notifyEndNamespace( const char*   zPrefix )
00210         throw();
00211 
00215     _DWFTK_API
00216     void notifyCharacterData( const char* zCData, 
00217                               int         nLength ) 
00218         throw();
00219 
00220 protected:
00221 
00225     DWFPackageReader* _pPackageReader;
00226 
00231     DWFXMLElementBuilder        _oDefaultElementBuilder;
00232 
00238     DWFXMLElementBuilder*       _pElementBuilder;
00239 
00240 private:
00241 
00242     unsigned char _nProviderFlags;
00243     unsigned char _nCurrentCollectionProvider;
00244     unsigned long _nInstanceSequence;
00245 
00246     DWFString           _zCurrentID;
00247     DWFDefinedObject*   _pCurrentObject;
00248     vector<DWFString>*  _pCurrentRefs;
00249     DWFProperty::tList* _pCurrentProperties;
00250 
00251 private:
00252 
00253     //
00254     // Not implemented
00255     //
00256 
00257     DWFObjectDefinitionReader( const DWFObjectDefinitionReader& );
00258     DWFObjectDefinitionReader& operator=( const DWFObjectDefinitionReader& );
00259 };
00260 
00261 }
00262 
00263 #endif

Generated on Tue May 17 12:38:51 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1