home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / btree / IXStoreDirectory.h < prev    next >
Text File  |  1993-08-15  |  3KB  |  76 lines

  1. /*
  2. IXStoreDirectory.h
  3. Copyright 1991, NeXT Computer, Inc.
  4. */
  5.  
  6. #import    <objc/Object.h>
  7. #import    <store/IXStoreFile.h>
  8.  
  9. #ifdef    NX_COMPILER_RELEASE_3_0
  10. @class IXBTreeCursor;
  11. #endif    NX_COMPILER_RELEASE_3_0
  12.  
  13. // This class implements a simple directory for managing store clients.  The 
  14. // store clients must conform to the IXBlockAndStoreAccess protocol.  Any 
  15. // object may be stored in an IXStoreDirectory, however, as long as it responds 
  16. // to init and the archiving methods read: and write:.
  17.  
  18. #ifdef    NX_COMPILER_RELEASE_3_0
  19. @interface IXStoreDirectory: Object <IXNameAndFileAccess>
  20. #else    NX_COMPILER_RELEASE_3_0
  21. @interface IXStoreDirectory: Object
  22. #endif    NX_COMPILER_RELEASE_3_0
  23. {
  24.     BOOL        _freeStore;
  25.     char        *_handleName;
  26.     unsigned        _handle;
  27.     IXStore        *_store;
  28. #ifdef    NX_COMPILER_RELEASE_3_0
  29.     IXBTreeCursor       *_btreeCursor;
  30. #else    NX_COMPILER_RELEASE_3_0
  31.     id                  _btreeCursor;
  32. #endif    NX_COMPILER_RELEASE_3_0
  33. }
  34.  
  35. // Returns the receiver's store, primarily as a convenience for transaction 
  36. // management - e.g., [[client store] startTransaction].
  37.  
  38. - (IXStore *)store;
  39.  
  40. // These methods add new named entries to the directory.  Any class may be 
  41. // supplied, as long as the instances can be meaningfully initialized with the 
  42. // init method and archived with NXWriteRootObject.  If the class is a store 
  43. // client, the instance will be initialized in the directory's store using the 
  44. // initFromBlock:inStore: method.
  45.  
  46. - addEntryNamed:(const char *)aName ofClass:aClass;
  47. - addEntryNamed:(const char *)aName ofClass:aClass atBlock:(unsigned)aHandle;
  48. - addEntryNamed:(const char *)aName forObject:anObject;
  49.  
  50. // This method is obselete.  Use entryNames instead.
  51. - (const char **)entries; // caller must free the array of entry names
  52.  
  53. // Returns newline delimited string containing entry names; caller must free.
  54. - (const char *)entryNames;
  55.  
  56. // These methods remove entries from the directory, but don't remove the 
  57. // associated objects from the store.  Use empty and freeEntryNamed: to free 
  58. // the objects, as well as the entries.
  59.  
  60. - reset; // removes all entries
  61. - removeName:(const char *)aName; // removes, but doesn't free entry object
  62.  
  63. - empty; // frees all entries
  64. - freeEntryNamed:(const char *)aName; // removes and frees associated object
  65.  
  66. // The first of these two methods is redundant.  openEntryNamed simply returns 
  67. // nil if passed an invalid name;  otherwise, it returns the associated object.
  68.  
  69. - (BOOL)hasEntryNamed:(const char *)aName;
  70. - openEntryNamed:(const char *)aName;
  71.  
  72. - getBlock:(unsigned *)aBlock ofEntryNamed:(const char *)aName;
  73. - getClass:(Class *)aClass ofEntryNamed:(const char *)aName;
  74.  
  75. @end
  76.