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

dashpat.h

00001 //  Copyright (c) 1996-2001 by Autodesk, Inc.
00002 //
00003 //  By using this code, you are agreeing to the terms and conditions of
00004 //  the License Agreement included in the documentation for this code.
00005 //
00006 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00007 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00008 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00009 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00010 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00011 //
00012 //  Use, duplication, or disclosure by the U.S. Government is subject to
00013 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00014 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00015 //  Data and Computer Software), as applicable.
00016 //
00017 
00018 #if !defined DASHPAT_HEADER
00019 #define DASHPAT_HEADER
00020 
00025 
00026 
00040 class WHIPTK_API WT_Dash_Pattern : public WT_Attribute, public WT_Item
00041 {
00042 private:
00043     WT_Integer16* m_data;
00044     WT_Integer16  m_size;
00045     WT_Integer16  m_allocated;
00046     WT_Integer32  m_number;
00047     enum WT_Materialize_Stage
00048     {   Eating_Initial_Whitespace,
00049         Getting_Number,
00050         Checking_For_Attribute_End,
00051         Getting_Size,
00052         Getting_Data,
00053         Getting_Separator,
00054         Eating_End_Whitespace
00055     } m_stage;
00056 
00057     void _deleteObject(void *object)
00058     {
00059         delete (WT_Dash_Pattern*)object;
00060     }
00061 
00062 public:
00063 
00065 
00068     static const WT_Dash_Pattern kNull;
00069 
00071 
00072     WT_Dash_Pattern()
00073     : m_data(0)
00074     , m_size(0)
00075     , m_allocated(0)
00076     , m_number(-1)
00077     , m_stage(Eating_Initial_Whitespace)
00078     {}
00079 
00081 
00084     WT_Dash_Pattern(
00088         WT_Integer32 id_number,
00089         WT_Integer16 length, 
00090         WT_Integer16 const * pArray 
00091         )
00092     : m_data(0)
00093     , m_size(0)
00094     , m_allocated(0)
00095     , m_number(-1)
00096     , m_stage(Eating_Initial_Whitespace)
00097     { set(id_number,length,pArray); }
00098 
00100     WT_Dash_Pattern(
00101         WT_Dash_Pattern const & r )
00102     : WT_Attribute()
00103     , WT_Item()
00104     , m_data(0)
00105     , m_size(0)
00106     , m_allocated(0)
00107     , m_number(-1)
00108     , m_stage(Eating_Initial_Whitespace)
00109     { set(r); }
00110 
00112     ~WT_Dash_Pattern()
00113     { set(0,0,0); }
00114 
00116 
00118 
00119     inline WT_Integer16 length()  const { return m_size; }
00121     inline WT_Integer32 number()  const { return m_number; }
00123     inline WT_Integer32& number() { return m_number; }
00125     inline WT_Integer16 const * pattern() const { return m_data; }
00127     void set( WT_Dash_Pattern const & pattern);
00129     void set(
00133         WT_Integer32 id_number,
00134         WT_Integer16 length=0, 
00135         WT_Integer16 const * pArray=0 
00136         );
00138     inline void set_pattern(
00139         WT_Integer16 length, 
00140         WT_Integer16 const * pArray 
00141         ) { set(m_number, length, pArray); }
00143     inline WT_Dash_Pattern& operator= ( WT_Dash_Pattern const & r ) { set(r); return *this; }
00145     inline WT_Dash_Pattern& operator=(
00149         WT_Integer32 id_number
00150         ) { set(id_number); return *this; }
00151 
00153     WT_Integer16& operator[](
00154         WT_Integer16 index 
00155         );
00157 
00159     WT_ID            object_id() const;
00160     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00161     WT_Result        process(WT_File & file);
00162     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00163     WT_Result        serialize (WT_File & file) const;
00164     WT_Result        sync (WT_File & file) const;
00165     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00167 
00169 
00171     static WT_Result default_process(
00172         WT_Dash_Pattern & item, 
00173         WT_File & file 
00174         );
00175 
00176 private:
00177     WT_Result serialize_pattern_definition( WT_File& ) const;
00178 
00179 };
00180 
00182 
00183 #endif // DASHPAT_HEADER

Generated on Tue May 17 12:07:44 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1