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

package/resource.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_RESOURCE_H
00021 #define _DWFTK_RESOURCE_H
00022 
00027 
00028 
00029 #include "dwfcore/STL.h"
00030 #include "dwfcore/Owner.h"
00031 #include "dwfcore/SkipList.h"
00032 #include "dwfcore/InputStream.h"
00033 using namespace DWFCore;
00034 
00035 #include "dwf/Toolkit.h"
00036 #include "dwf/package/XML.h"
00037 #include "dwf/package/reader/PackageReader.h"
00038 #include "dwf/package/writer/PackageWriter.h"
00039 #include "dwf/package/utility/PropertyContainer.h"
00040 
00041 namespace DWFToolkit
00042 {
00043 
00051 class DWFResource : public DWFXMLBuildable
00052 
00053 #ifndef DWFTK_READ_ONLY
00054                   , public DWFXMLSerializable
00055 #endif
00056                   , public DWFPropertyContainer
00057                   , public DWFOwnable
00058 {
00059 
00060 public:
00061 
00065     typedef vector<DWFResource*>                                            tList;
00069     typedef DWFSkipList<uint32_t, DWFResource*>                             tOrderedList;
00073     typedef DWFWCharKeySkipList<DWFResource*>                               tMap;
00077     typedef multimap<const wchar_t*, DWFResource*, tDWFWCharCompareLess>    tMultiMap;
00078 
00079 public:
00080 
00093     _DWFTK_API
00094     DWFResource( DWFPackageReader* pPackageReader )
00095         throw();
00096 
00118     _DWFTK_API
00119     DWFResource( const DWFString& zTitle,
00120                  const DWFString& zRole,
00121                  const DWFString& zMIME,
00122                  const DWFString& zHREF = L"" )
00123         throw();
00124 
00130     _DWFTK_API
00131     virtual ~DWFResource()
00132         throw();
00133 
00140     _DWFTK_API
00141     const DWFString& title() const
00142         throw()
00143     {
00144         return _zTitle;
00145     }
00146 
00153     _DWFTK_API
00154     void setTitle( const DWFString& zTitle )
00155         throw()
00156     {
00157         _zTitle = zTitle;
00158     }
00159 
00166     _DWFTK_API
00167     const DWFString& role() const
00168         throw()
00169     {
00170         return _zRole;
00171     }
00172 
00180     _DWFTK_API
00181     void setRole( const DWFString& zRole )
00182         throw()
00183     {
00184         _zRole = zRole;
00185     }
00186 
00193     _DWFTK_API
00194     const DWFString& mime() const
00195         throw()
00196     {
00197         return _zMIME;
00198     }
00199 
00207     _DWFTK_API
00208     void setMIME( const DWFString& zMIME )
00209         throw()
00210     {
00211         _zMIME = zMIME;
00212     }
00213 
00220     _DWFTK_API
00221     const DWFString& href() const
00222         throw()
00223     {
00224         return _zHRef;
00225     }
00226 
00236     _DWFTK_API
00237     void setHRef( const DWFString& zHRef )
00238         throw()
00239     {
00240         _zHRef = zHRef;
00241     }
00242 
00249     _DWFTK_API
00250     const DWFString& objectID() const
00251         throw()
00252     {
00253         return _zObjectID;
00254     }
00255 
00262     _DWFTK_API
00263     void setObjectID( const DWFString& zObjectID )
00264         throw()
00265     {
00266         _zObjectID = zObjectID;
00267     }
00268 
00275     _DWFTK_API
00276     const DWFString& parentID() const
00277         throw()
00278     {
00279         return _zParentObjectID;
00280     }
00281 
00294     _DWFTK_API
00295     void setParentResource( const DWFResource* pResource )
00296         throw();
00297 
00310     _DWFTK_API
00311     void setParentObjectID( const DWFString& zObjectID )
00312         throw()
00313     {
00314         _zParentObjectID = zObjectID;
00315     }
00316 
00323     _DWFTK_API
00324     const size_t size() const
00325         throw()
00326     {
00327         return _nSize;
00328     }
00329 
00339     _DWFTK_API
00340     void setPublishedIdentity( const DWFString& zSectionName,
00341                                const DWFString& zObjectID )
00342         throw();
00343 
00358     _DWFTK_API
00359     const DWFString& publishedIdentity() const
00360         throw()
00361     {
00362         return _zTargetHRef;
00363     }
00364 
00390     _DWFTK_API
00391     virtual DWFInputStream* getInputStream( bool bCache = false )
00392         throw( DWFException );
00393 
00397     _DWFTK_API
00398     virtual void parseAttributeList( const char** ppAttributeList )
00399         throw( DWFException );
00400 
00401 #ifndef DWFTK_READ_ONLY
00402 
00432     _DWFTK_API
00433     void setInputStream( DWFInputStream* pStream, size_t nBytes = 0 )
00434         throw( DWFException );
00435 
00439     _DWFTK_API
00440     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00441         throw( DWFException );
00442 
00443 #endif
00444 
00445 
00446 protected:
00447 
00451     size_t _nSize;
00452 
00453 private:
00454 
00455     DWFString _zTitle;
00456     DWFString _zRole;
00457     DWFString _zMIME;
00458     DWFString _zHRef;
00459     DWFString _zTargetHRef;
00460     DWFString _zObjectID;
00461     DWFString _zParentObjectID;
00462 
00463     DWFInputStream*     _pStream;
00464     DWFPackageReader*   _pPackageReader;
00465 
00466 private:
00467 
00468     DWFResource( const DWFResource& );
00469     DWFResource& operator=( const DWFResource& );
00470 };
00471 
00472 }
00473 
00474 #endif

Generated on Mon May 2 18:54:15 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1