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

PackageWriter.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_PACKAGE_WRITER_H
00021 #define _DWFTK_PACKAGE_WRITER_H
00022 
00027 
00028 
00029 #ifndef DWFTK_READ_ONLY
00030 
00031 
00032 
00033 #include "dwfcore/STL.h"
00034 #include "dwfcore/UUID.h"
00035 #include "dwfcore/OutputStream.h"
00036 using namespace DWFCore;
00037 
00038 #include "dwf/Toolkit.h"
00039 #include "dwf/package/XML.h"
00040 #include "dwf/package/Constants.h"
00041 #include "dwf/package/writer/DWFXMLSerializer.h"
00042 #include "dwf/package/writer/PackageVersionExtension.h"
00043 #include "dwf/package/utility/DWFPackageFileDescriptor.h"
00044 
00045 
00046 namespace DWFToolkit
00047 {
00048 
00049 //
00050 // fwd decl
00051 //
00052 class DWFManifest;
00053 class DWFResource;
00054 class DWFInterface;
00055 class DWFSection;
00056 class DWFGlobalSection;
00057 class DWFPropertyContainer;
00058 
00068 class DWFPackageWriter : public DWFToolkitMemory
00069 {
00070 
00071 public:
00072 
00077     typedef enum
00078     {
00079         eManifest           = 0x10,
00080         eDescriptor         = 0x40,
00081         eObjectDefinition   = 0x80
00082 
00083     } teDocumentType;
00084 
00089     typedef enum
00090     {
00091         eNone               = 0x00,
00092         eEPlot              = 0x01,
00093         eEModel             = 0x02,
00094         eGlobal             = 0x04
00095 
00096     } teSectionType;
00097 
00098 public:
00099 
00108     _DWFTK_API
00109     DWFPackageWriter( const DWFFile&                rDWFPackageFile,
00110                       const DWFString&              zDWFPackagePassword = L"",
00111                       DWFPackageVersionExtension*   pVersionExtension = NULL )
00112         throw();
00113 
00119     _DWFTK_API
00120     virtual ~DWFPackageWriter()
00121         throw();
00122 
00140     _DWFTK_API
00141     void addSection( DWFSection*    pSection,
00142                      DWFInterface*  pInterface = NULL )
00143         throw( DWFException );
00144 
00156     _DWFTK_API
00157     void addGlobalSection( DWFGlobalSection* pSection )
00158         throw( DWFException );
00159 
00176     _DWFTK_API
00177     DWFInterface* addInterface( DWFInterface* pInterface )
00178         throw( DWFException );
00179 
00189     _DWFTK_API
00190     DWFPropertyContainer& getManifestProperties()
00191         throw( DWFException );
00192 
00235     _DWFTK_API
00236     void write( const DWFString&                 zSourceProductVendor = L"",
00237                 const DWFString&                 zSourceProductName = L"",
00238                 const DWFString&                 zSourceProductVersion = L"",
00239                 const DWFString&                 zDWFProductVendor = L"",
00240                 const DWFString&                 zDWFProductVersion = L"",
00241                 DWFZipFileDescriptor::teFileMode eCompressionMode = DWFZipFileDescriptor::eZipSmallest )
00242         throw( DWFException );
00243 
00244 private:
00245 
00246     //
00247     //
00248     //
00249     void _serializeResource( const DWFString&   zSection,
00250                              DWFResource&       rResource )
00251         throw( DWFException );
00252 
00253     //
00254     // 
00255     //
00256     void _ensureManifest()
00257         throw( DWFException );
00258 
00259 private:
00260 
00261     DWFFile                     _rDWFPackage;
00262     DWFString                   _zDWFPassword;
00263 
00264     DWFUUID                     _oUUID;
00265     DWFXMLSerializer*           _pXMLSerializer;
00266     DWFPackageVersionExtension* _pVersionExtension;
00267 
00268     DWFPackageFileDescriptor*   _pPackageDescriptor;
00269     DWFManifest*                _pPackageManifest;
00270 
00271     double                      _nNextPlot;
00272 
00273     bool                        _bEPlotAdded;
00274     bool                        _bEModelAdded;
00275     bool                        _bEPlotGlobalAdded;
00276     bool                        _bEModelGlobalAdded;
00277 
00278     vector<DWFSection*>         _oSections;
00279     vector<DWFGlobalSection*>   _oGlobalSections;
00280 
00281 private:
00282 
00283     DWFPackageWriter();
00284     DWFPackageWriter( const DWFPackageWriter& );
00285     DWFPackageWriter& operator=( const DWFPackageWriter& );
00286 };
00287 
00288 }
00289 
00290 #endif
00291 #endif
00292 

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