home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / bento / headers / namspace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-02  |  4.8 KB  |  166 lines

  1. /*
  2.     File:        NamSpace.h
  3.  
  4.     Contains:    XMPAbsNameSpace class definition.
  5.  
  6.     Written by:    Nick Pilch
  7.  
  8.     Copyright:    ⌐ 1993 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <26>      2/7/94    JA        Moved XMPFileRefNum type to PlfmType.h.
  13.         <25>     1/29/94    NP        Init changes.
  14.         <24>     1/18/94    CG        Added valueLen parameter to GetValue().
  15.         <23>     1/14/94    CG        Iterator and NameSpaceManager break out.
  16.         <22>    12/15/93    Té        more InitObject changes, remove
  17.                                     Initialize() method
  18.         <21>    11/15/93    NP        Changed XMPSymbols to XMPNameSpaceManager.
  19.         <20>     11/8/93    NP        Added WriteToStorage and ReadFromStorage.
  20.         <19>     11/8/93    NP        Changed signature of WriteToFile and
  21.                                     ReadFromFile and added type XMPFileRefNum.
  22.         <18>     11/5/93    NP        Added WriteToFile and ReadFromFile.
  23.         <17>    10/28/93    NP        Comment out obsoleted parts of API. Will
  24.                                     remove later.
  25.         <16>    10/22/93    NP        Removed valueLength parameter for XMPSLong
  26.                                     and XMPOSType methods-it was never used.
  27.         <15>     10/5/93    CG        Added Exists method to XMPAbsNameSpace.
  28.         <14>     9/21/93    CG        Added valuelength parameter to methods.
  29.         <13>     7/21/93    NP        Added documentation.
  30.         <12>     7/2/93        NP        Abstract/Concrete breakout.
  31.         <11>     6/22/93    NP        Reverted iterator semantics to orginal.
  32.                                     Added comments.
  33.         <10>     6/14/93    NP        Implemented inheritance.
  34.          <9>      6/4/93    NP        Changed iterator semantics. Fixed comments.
  35.          <8>      6/2/93    NP        Interface and comment changes as per
  36.                                     discussion with Kurt.
  37.          <7>     5/18/93    NP        Updated HasNameSpace.
  38.          <6>     4/28/93    NP        File name changes.
  39.          <5>     4/28/93    NP        Added Initialize and Purge.
  40.          <4>     4/23/93    NP        XMPHashTable -> XMPAEHashTable.
  41.          <3>     4/23/93    NP        Added Initialize and Purge.
  42.          <2>     4/23/93    NP        Changed XMPAbsValueIterator::IsComplete to
  43.                                     XMPAbsValueIterator::IsNotComplete.
  44.          <1>     4/13/93    NP        first checked in
  45.  
  46.     To Do:
  47. */
  48.  
  49. #ifndef _NAMSPACE_
  50. #define _NAMSPACE_
  51.  
  52.  
  53. #ifndef _XMPOBJ_
  54. #include "XMPObj.h"
  55. #endif
  56.  
  57. //==============================================================================
  58. // Theory of Operation
  59. //==============================================================================
  60.  
  61. /*
  62.     This file contains an interface for creating name spaces and registering
  63.     symbols within those spaces.
  64. */
  65.  
  66. //==============================================================================
  67. // Scalar Types
  68. //==============================================================================
  69.  
  70. enum XMPNSTypeSpec
  71. {
  72.     kXMPNSTypeISOStr,
  73.     kXMPNSTypeOSType,
  74.     kXMPNSTypeSLong
  75. };
  76.  
  77. //==============================================================================
  78. // Classes defined in this interface
  79. //==============================================================================
  80.  
  81. class XMPAbsNameSpace;
  82. class XMPNameSpace;
  83. class XMPStorageUnitView;
  84.  
  85.  
  86. //==============================================================================
  87. // XMPAbsNameSpace
  88. //==============================================================================
  89.  
  90. class XMPAbsNameSpace : public XMPObject
  91. {
  92.   public:
  93.  
  94.     XMPVMethod XMPISOStr    GetName()
  95.         = 0;
  96.  
  97.         // Don't modify the return value. Copy instead if you need to modify.
  98.  
  99.     // kXMPErrWrongType is throw for any of the following nine functions if the
  100.     //    the parameter type does not match the type that the XMPAbsNameSpace was
  101.     //    initialized with.
  102.  
  103.     XMPVMethod void        Register(XMPISOStr key, XMPPtr value, XMPULong valueLength)
  104.         = 0;
  105. //    XMPVMethod void        Register(XMPOSType key, XMPPtr value)
  106. //        = 0;
  107. //    XMPVMethod void        Register(XMPSLong key, XMPPtr value)
  108. //        = 0;
  109.  
  110.         // register value under key
  111.  
  112.     XMPVMethod void        Unregister(XMPISOStr key)
  113.         = 0;
  114. //    XMPVMethod void        Unregister(XMPOSType key)
  115. //        = 0;
  116. //    XMPVMethod void        Unregister(XMPSLong key)
  117. //        = 0;
  118.  
  119.         // unregister value registered under key
  120.  
  121.     XMPVMethod XMPBoolean    GetValue(XMPISOStr key, XMPPtr* value, XMPULong* valLen)
  122.         = 0;
  123. //    XMPVMethod XMPBoolean    GetValue(XMPOSType key , XMPPtr* value)
  124. //        = 0;
  125. //    XMPVMethod XMPBoolean    GetValue(XMPSLong key , XMPPtr* value)
  126. //        = 0;
  127.  
  128.         // find value registered under key. kXMPErrKeyDoesNotExist is thrown if
  129.         //    key was never registered.
  130.  
  131.     XMPVMethod XMPBoolean    Exists(XMPISOStr key)
  132.         = 0;
  133. //    XMPVMethod XMPBoolean    Exists(XMPOSType key)
  134. //        = 0;
  135. //    XMPVMethod XMPBoolean    Exists(XMPSLong key)
  136. //        = 0;
  137.  
  138.         // check for existance of value registered under key. 
  139.  
  140.     XMPVMethod void            WriteToFile(XMPFileRefNum file)
  141.         = 0;
  142.  
  143.     XMPVMethod void            ReadFromFile(XMPFileRefNum file)
  144.         = 0;
  145.  
  146.     XMPVMethod void            WriteToStorage(XMPStorageUnitView* view)
  147.         = 0;
  148.  
  149.     XMPVMethod void            ReadFromStorage(XMPStorageUnitView* view)
  150.         = 0;
  151.  
  152.     XMPVMethod XMPSize        Purge(XMPSize size)
  153.         = 0;
  154.  
  155.   public: // private by convention
  156.  
  157.     XMPAbsNameSpace() {}
  158.     XMPVMethod ~XMPAbsNameSpace() {}
  159. };
  160.  
  161. #ifndef _NAMSPACM_
  162. #include "NamSpacM.h"
  163. #endif
  164.  
  165. #endif // _NAMSPACE_
  166.