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

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 
00053 class DWFResource : public DWFToolkitMemory
00054                   , public DWFXMLBuildable
00055 
00056 #ifndef DWFTK_READ_ONLY
00057                   , public DWFXMLSerializable
00058 #endif
00059                   , public DWFPropertyContainer
00060                   , public DWFOwnable
00061 {
00062 
00063 public:
00064 
00068     typedef vector<DWFResource*>                                            tList;
00072     typedef DWFSkipList<uint32_t, DWFResource*>                             tOrderedList;
00076     typedef DWFWCharKeySkipList<DWFResource*>                               tMap;
00080     typedef multimap<const wchar_t*, DWFResource*, tDWFWCharCompareLess>    tMultiMap;
00081 
00082 public:
00083 
00096     _DWFTK_API
00097     DWFResource( DWFPackageReader* pPackageReader )
00098         throw();
00099 
00121     _DWFTK_API
00122     DWFResource( const DWFString& zTitle,
00123                  const DWFString& zRole,
00124                  const DWFString& zMIME,
00125                  const DWFString& zHREF = L"" )
00126         throw();
00127 
00133     _DWFTK_API
00134     virtual ~DWFResource()
00135         throw();
00136 
00143     _DWFTK_API
00144     const DWFString& title() const
00145         throw()
00146     {
00147         return _zTitle;
00148     }
00149 
00156     _DWFTK_API
00157     void setTitle( const DWFString& zTitle )
00158         throw()
00159     {
00160         _zTitle = zTitle;
00161     }
00162 
00169     _DWFTK_API
00170     const DWFString& role() const
00171         throw()
00172     {
00173         return _zRole;
00174     }
00175 
00183     _DWFTK_API
00184     void setRole( const DWFString& zRole )
00185         throw()
00186     {
00187         _zRole = zRole;
00188     }
00189 
00196     _DWFTK_API
00197     const DWFString& mime() const
00198         throw()
00199     {
00200         return _zMIME;
00201     }
00202 
00210     _DWFTK_API
00211     void setMIME( const DWFString& zMIME )
00212         throw()
00213     {
00214         _zMIME = zMIME;
00215     }
00216 
00223     _DWFTK_API
00224     const DWFString& href() const
00225         throw()
00226     {
00227         return _zHRef;
00228     }
00229 
00239     _DWFTK_API
00240     void setHRef( const DWFString& zHRef )
00241         throw()
00242     {
00243         _zHRef = zHRef;
00244     }
00245 
00252     _DWFTK_API
00253     const DWFString& objectID() const
00254         throw()
00255     {
00256         return _zObjectID;
00257     }
00258 
00265     _DWFTK_API
00266     void setObjectID( const DWFString& zObjectID )
00267         throw()
00268     {
00269         _zObjectID = zObjectID;
00270     }
00271 
00278     _DWFTK_API
00279     const DWFString& parentID() const
00280         throw()
00281     {
00282         return _zParentObjectID;
00283     }
00284 
00297     _DWFTK_API
00298     void setParentResource( const DWFResource* pResource )
00299         throw();
00300 
00313     _DWFTK_API
00314     void setParentObjectID( const DWFString& zObjectID )
00315         throw()
00316     {
00317         _zParentObjectID = zObjectID;
00318     }
00319 
00326     _DWFTK_API
00327     const size_t size() const
00328         throw()
00329     {
00330         return _nSize;
00331     }
00332 
00342     _DWFTK_API
00343     void setPublishedIdentity( const DWFString& zSectionName,
00344                                const DWFString& zObjectID )
00345         throw();
00346 
00361     _DWFTK_API
00362     const DWFString& publishedIdentity() const
00363         throw()
00364     {
00365         return _zTargetHRef;
00366     }
00367 
00393     _DWFTK_API
00394     virtual DWFInputStream* getInputStream( bool bCache = false )
00395         throw( DWFException );
00396 
00400     _DWFTK_API
00401     virtual void parseAttributeList( const char** ppAttributeList )
00402         throw( DWFException );
00403 
00404 #ifndef DWFTK_READ_ONLY
00405 
00435     _DWFTK_API
00436     void setInputStream( DWFInputStream* pStream, size_t nBytes = 0 )
00437         throw( DWFException );
00438 
00442     _DWFTK_API
00443     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00444         throw( DWFException );
00445 
00446 #endif
00447 
00448 
00449 protected:
00450 
00454     size_t _nSize;
00455 
00456 private:
00457 
00458     DWFString _zTitle;
00459     DWFString _zRole;
00460     DWFString _zMIME;
00461     DWFString _zHRef;
00462     DWFString _zTargetHRef;
00463     DWFString _zObjectID;
00464     DWFString _zParentObjectID;
00465 
00466     DWFInputStream*     _pStream;
00467     DWFPackageReader*   _pPackageReader;
00468 
00469 private:
00470 
00471     DWFResource( const DWFResource& );
00472     DWFResource& operator=( const DWFResource& );
00473 };
00474 
00475 }
00476 
00477 #endif

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