directory.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 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 #if !defined DIRECTORY_HEADER
00020 #define DIRECTORY_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/attribute.h"
00028 #include "whiptk/blockref.h"
00029 
00031 
00035 class WHIPTK_API WT_Directory : public WT_Object, public WT_Item_List
00036 {
00037 public:
00039     WT_Directory() : m_file_offset(0), m_optioncode(WD_Null), m_stage(Starting)
00040     { }
00041 
00043     WT_Directory(const WT_Directory & directory)
00044         : WT_Object()
00045         , WT_Item_List()
00046     {
00047         *this = directory;
00048     }
00049 
00051     virtual ~WT_Directory();
00052 
00054     WT_Result add (WT_BlockRef &item);
00056     WT_BlockRef * blockref_from_index(WT_Integer32 index);
00058     WT_Integer32  index_from_blockref(WT_BlockRef & item_in);
00060     WT_Unsigned_Integer32 get_file_offset() {
00061        return m_file_offset;
00062     }
00063 
00064     // WT_Object virtual methods
00065     WT_Result    materialize(WT_Opcode const & opcode, WT_File & file);
00066     WT_ID        object_id() const;
00067     WT_Type      object_type() const;
00068     WT_Result    process(WT_File & file);
00069     WT_Result    serialize (WT_File & file) const;
00070     WT_Result    skip_operand(WT_Opcode const & opcode, WT_File & file);
00071 
00073     WT_Directory const & operator=(WT_Directory const & blockref);
00075     WT_Boolean operator== (WT_Directory const & list) const;
00076 
00078 
00080     static WT_Result default_process(
00081         WT_Directory & item, 
00082         WT_File & file 
00083         );
00084 
00085 private:
00086     WT_Unsigned_Integer32   m_file_offset;
00087     WT_Opcode *             m_optioncode;
00088 
00089     enum
00090     {
00091         Starting,
00092         Getting_BlockRef_Count,
00093         Getting_BlockRefs,
00094         Getting_Directory_File_Offset,
00095         Getting_Close
00096     }   m_stage;
00097 };
00098 
00099 #endif // DIRECTORY_HEADER

Generated on Tue Jan 6 22:41:12 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5