home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / indexing / IXFileFinder.h < prev    next >
Text File  |  1992-05-18  |  4KB  |  118 lines

  1. /*
  2. IXFileFinder.h
  3. Copyright 1991, NeXT Computer, Inc.
  4. */
  5.  
  6. #import    "IXPostingList.h"
  7.  
  8. #import <objc/hashtable.h>
  9. #import    <macb/reference.h>
  10.  
  11. @class IXFileFinder, IXFileRecord;
  12.  
  13. @protocol IXFileFinderQueryAndUpdate
  14.  
  15. - (const char *)rootPath; // returns the root path
  16. - recordManager; // returns the underlying record manager
  17.  
  18. - clean; // removes stale information from index
  19. - reset; // resets index
  20.  
  21. - updateIndexAtPath:(const char *)path forSender:aSender;
  22. - (BOOL)isUpdating; // true when updating is in progress
  23.  
  24. - resumeUpdating; // resumes asynchronous updating
  25. - suspendUpdating; // suspends asynchronous updating
  26.  
  27. - stopQueryForSender:aSender; // stops a query in progress
  28. - (IXPostingList *)performQuery:(const char *)query 
  29.     atPath:(const char *)path forSender:aSender;
  30.  
  31. @end
  32.  
  33. @interface Object(FileFinderSender)
  34.  
  35. - fileFinder:(IXFileFinder *)aFinder 
  36.     didFindList:(IXPostingList *)aList;
  37. - fileFinder:(IXFileFinder *)aFinder 
  38.     didFindFile:(IXFileRecord *)anObject;
  39. - fileFinder:(IXFileFinder *)aFinder 
  40.     willAddFile:(IXFileRecord *)anObject;
  41.  
  42. @end
  43.  
  44. @protocol IXFileFinderConfiguration
  45.  
  46. - getAttributeParsers:(List *)aList;
  47. - setAttributeParsers:(List *)aList;
  48.  
  49. - (char *)ignoredTypes; // returns list of ignored types
  50. - setIgnoredTypes:(const char *)types; // sets list of ignored types
  51.  
  52. - (char *)ignoredNames; // returns list of ignored names
  53. - setIgnoredNames:(const char *)names; // sets list of ignored names
  54.  
  55. - (BOOL)crossesDeviceChanges; // returns device crossing policy
  56. - setCrossesDeviceChanges:(BOOL)flag; // sets device crossing policy
  57.  
  58. - (BOOL)followsSymbolicLinks; // returns symbolic link policy
  59. - setFollowsSymbolicLinks:(BOOL)flag; // sets symbolic link policy
  60.  
  61. - (BOOL)generatesDescriptions; // returns description generation policy
  62. - setGeneratesDescriptions:(BOOL)flag; // sets description generation policy
  63.  
  64. - (BOOL)updatesAutomatically; // returns automatic update policy
  65. - setUpdatesAutomatically:(BOOL)flag; // sets automatic update policy
  66.  
  67. - (BOOL)scansForModifiedFiles; // return file scanning policy
  68. - setScansForModifiedFiles:(BOOL)flag; // sets file scanning policy
  69.  
  70. @end
  71.  
  72. // an instance of this class manages the inversion of a single rootPath tree in the file system.  multiple queries may be run concurrently with updating.
  73.  
  74. @interface IXFileFinder: Object <NXReference, IXBlockAndStoreAccess, IXNameAndFileAccess, IXFileFinderQueryAndUpdate, IXFileFinderConfiguration>
  75. {
  76.     struct FinderRecord    *_finderRecord;
  77.     unsic        references; // the reference count
  78.     List        *attributeParsers; // the list of attribute parsers
  79.     id            recordManager; // the supporting record manager
  80.     NXHashTable        *ignoredNames; // table of ignored names
  81.     NXHashTable        *ignoredTypes; // table of ignored types
  82.     char        *rootPath; // the root path
  83.     unsigned        commitDelay; // transaction commit delay in seconds
  84.     struct        {
  85.     unsigned    crossesDeviceChanges:1; // crosses device changes
  86.     unsigned    followsSymbolicLinks:1; // follows symbolic links
  87.     unsigned    generatesDescriptions:1; // generates descriptions
  88.     unsigned    updatesAutomatically:1; // queries request updates
  89.     unsigned    scansForModifiedFiles:1; // scans for modified files
  90.     unsigned    removesAutomatically:1; // scans for removed files
  91.     }             booleanOptions;
  92. }
  93.  
  94. - initInStore:(IXStore *)aStore 
  95.     atPath:(const char *)path;
  96. - initFromBlock:(unsigned)block inStore:(IXStore *)aStore 
  97.     atPath:(const char *)path;
  98.  
  99. - initWithName:(const char *)name inFile:(const char *)filename
  100.     atPath:(const char *)path;
  101. - initFromName:(const char *)aName inFile:(const char *)aFile 
  102.     forWriting:(BOOL)flag atPath:(const char *)path;
  103.  
  104. @end
  105.  
  106. #ifdef KANJI
  107. #define IX_NOTDEF_ENCODING    0
  108. #define IX_NEXTSTEP_ENCODING    1
  109. #define IX_NJE_ENCODING    2
  110.  
  111. @interface IXFileFinder (QueryEncoding)
  112.  
  113. - (unsigned)queryEncoding;
  114. - setQueryEncoding:(unsigned)encoding;
  115.  
  116. @end
  117. #endif KANJI
  118.