1 // IndexDirectory.h 2 3 #ifndef INDEX_DIRECTORY_H 4 #define INDEX_DIRECTORY_H 5 6 #include "List.h" 7 8 class AttributeIndex; 9 class Index; 10 class LastModifiedIndex; 11 class NameIndex; 12 class SizeIndex; 13 class Volume; 14 15 class IndexDirectory { 16 public: 17 IndexDirectory(Volume *volume); 18 ~IndexDirectory(); 19 20 status_t InitCheck() const; 21 22 status_t CreateIndex(const char *name, uint32 type, 23 AttributeIndex **index = NULL); 24 bool DeleteIndex(const char *name, uint32 type); 25 bool DeleteIndex(Index *index); 26 27 Index *FindIndex(const char *name); 28 Index *FindIndex(const char *name, uint32 type); 29 AttributeIndex *FindAttributeIndex(const char *name); 30 AttributeIndex *FindAttributeIndex(const char *name, uint32 type); 31 32 bool IsSpecialIndex(Index *index) const; 33 NameIndex *GetNameIndex() const { return fNameIndex; } 34 LastModifiedIndex *GetLastModifiedIndex() const 35 { return fLastModifiedIndex; } 36 SizeIndex *GetSizeIndex() const { return fSizeIndex; } 37 38 Index *IndexAt(int32 index) const { return fIndices.ItemAt(index); } 39 40 private: 41 Volume *fVolume; 42 NameIndex *fNameIndex; 43 LastModifiedIndex *fLastModifiedIndex; 44 SizeIndex *fSizeIndex; 45 List<Index*> fIndices; 46 }; 47 48 #endif // INDEX_DIRECTORY_H 49