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

url.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 URL_HEADER
00019 #define URL_HEADER
00020 
00021 #include "whiptk/whipcore.h"
00022 #include "whiptk/attribute.h"
00023 
00024 class WT_File;
00025 class WT_URL_Item;
00026 
00031 
00032 
00036 class WHIPTK_API WT_URL : public WT_Attribute
00037 {
00038 private:
00039 
00040     int                          m_incarnation;
00041     WT_Integer32                 m_current_index;
00042     WT_String                    m_current_address;
00043     WT_String                    m_current_friendly_name;
00044     WT_URL_List                  m_url_list;
00045     WT_Integer32                 m_count;
00046 
00047     enum WT_Materialize_Stage
00048     {
00049         Eating_Initial_Whitespace,
00050         Gathering_String,
00051         Eating_End_Whitespace,
00052         Skipping_Last_Paren,
00053 
00054         Getting_Next_Block,
00055         Getting_Assigned_Index,
00056         Getting_Address,
00057         Getting_Friendly_Name,
00058         Getting_Closing_Block_Paren,
00059         Reading_Index,
00060         Completed
00061 
00062     }  m_stage;
00063 
00064 public:
00065 
00067 
00068     WT_URL()
00069         : m_incarnation(-1)
00070         , m_stage(Eating_Initial_Whitespace)
00071     { }
00072 
00074     WT_URL(WT_URL_Item  &item);
00075 
00077     WT_URL(
00078         WT_Integer32 index, 
00079         WT_Unsigned_Integer16 const * address, 
00080         WT_Unsigned_Integer16 const * friendly_name 
00081         );
00083 
00085 
00086 
00090     void add_url(
00091         WT_URL_Item & item
00092         )
00093     {
00094         WD_Assert((item.index() != WD_URL_Optimize)); // user should use add_url_optimized!
00095         m_url_list.add(item);
00096     };
00097 
00099 
00103     void add_url(
00104         WT_Integer32 index,
00105         WT_Unsigned_Integer16 const *address,
00106         WT_Unsigned_Integer16 const *friendly_name
00107         )
00108     {
00109         set(index, address, friendly_name);
00110     }
00111 
00113 
00117     void add_url(
00118         WT_Integer32 index, 
00119         WT_String & address, 
00120         WT_String & friendly_name 
00121         )
00122     {
00123         WT_URL_Item item(index, address, friendly_name);
00124         add_url(item);
00125     }
00126 
00128 
00130     void add_url_optimized(
00131         WT_URL_Item & item, 
00132         WT_File & file 
00133         );
00134 
00136 
00138     void add_url_optimized(
00139         WT_Integer32 index, 
00140         WT_Unsigned_Integer16 const *address, 
00141         WT_Unsigned_Integer16 const *friendly_name, 
00142         WT_File & file 
00143         )
00144     {
00145         WT_URL_Item item(index, address, friendly_name);
00146         add_url_optimized(item, file);
00147     }
00148 
00150 
00152     void add_url_optimized(
00153         WT_Integer32 index, 
00154         WT_String & address, 
00155         WT_String & friendly_name, 
00156         WT_File & file 
00157         )
00158     {
00159         WT_URL_Item item(index, address, friendly_name);
00160         add_url_optimized(item, file);
00161     }
00162 
00164     void clear() { m_url_list.remove_all(); }
00165 
00167 
00172     void flush_rendition(WT_File & file) ;
00173 
00175     void set(
00176         WT_Integer32 index, 
00177         WT_Unsigned_Integer16 const * address, 
00178         WT_Unsigned_Integer16 const * friendly_name 
00179         );
00180 
00182     WT_URL_List const & url()
00183     {    return m_url_list;    }
00184 
00186     WT_URL const & operator=(WT_URL const & url);
00188 
00190     WT_ID            object_id() const;
00191     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00192     WT_Result        process(WT_File & file);
00193     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00194     WT_Result        serialize (WT_File & file) const;
00195     WT_Result        sync (WT_File & file) const;
00196     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00198 
00200 
00202     static WT_Result default_process(
00203         WT_URL & item, 
00204         WT_File & file 
00205         );
00206 };
00207 
00209 
00210 #endif // URL_HEADER

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