1 /* 2 * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de. 3 * This file may be used under the terms of the MIT License. 4 */ 5 #ifndef INDEX_H 6 #define INDEX_H 7 8 9 #include "system_dependencies.h" 10 11 12 class Transaction; 13 class Volume; 14 class Inode; 15 16 17 class Index { 18 public: 19 Index(Volume* volume); 20 ~Index(); 21 22 status_t SetTo(const char* name); 23 void Unset(); 24 25 Inode* Node() const { return fNode; }; 26 uint32 Type(); 27 size_t KeySize(); 28 29 status_t Create(Transaction& transaction, const char* name, 30 uint32 type); 31 32 status_t Update(Transaction& transaction, const char* name, 33 int32 type, const uint8* oldKey, 34 uint16 oldLength, const uint8* newKey, 35 uint16 newLength, Inode* inode); 36 37 status_t InsertName(Transaction& transaction, 38 const char* name, Inode* inode); 39 status_t RemoveName(Transaction& transaction, 40 const char* name, Inode* inode); 41 status_t UpdateName(Transaction& transaction, 42 const char* oldName, const char* newName, 43 Inode* inode); 44 45 status_t InsertSize(Transaction& transaction, Inode* inode); 46 status_t RemoveSize(Transaction& transaction, Inode* inode); 47 status_t UpdateSize(Transaction& transaction, Inode* inode); 48 49 status_t InsertLastModified(Transaction& transaction, 50 Inode* inode); 51 status_t RemoveLastModified(Transaction& transaction, 52 Inode* inode); 53 status_t UpdateLastModified(Transaction& transaction, 54 Inode* inode, bigtime_t modified = -1); 55 56 private: 57 Index(const Index& other); 58 Index& operator=(const Index& other); 59 // no implementation 60 61 Volume* fVolume; 62 Inode* fNode; 63 const char* fName; 64 }; 65 66 #endif // INDEX_H 67