102c8f6c8SAxel Dörfler /* 2*225e1b11SAxel Dörfler * Copyright 2001-2012, Axel Dörfler, axeld@pinc-software.de. 3fb02804aSAxel Dörfler * This file may be used under the terms of the MIT License. 4fb02804aSAxel Dörfler */ 5c42ee134SAxel Dörfler #ifndef INDEX_H 6c42ee134SAxel Dörfler #define INDEX_H 7c42ee134SAxel Dörfler 8c42ee134SAxel Dörfler 9c391f84bSIngo Weinhold #include "system_dependencies.h" 10c42ee134SAxel Dörfler 1102c8f6c8SAxel Dörfler 12c42ee134SAxel Dörfler class Transaction; 13c42ee134SAxel Dörfler class Volume; 14c42ee134SAxel Dörfler class Inode; 15c42ee134SAxel Dörfler 16c42ee134SAxel Dörfler 17c42ee134SAxel Dörfler class Index { 18c42ee134SAxel Dörfler public: 19c42ee134SAxel Dörfler Index(Volume* volume); 20c42ee134SAxel Dörfler ~Index(); 21c42ee134SAxel Dörfler 22c42ee134SAxel Dörfler status_t SetTo(const char* name); 23c42ee134SAxel Dörfler void Unset(); 24c42ee134SAxel Dörfler 25c42ee134SAxel Dörfler Inode* Node() const { return fNode; }; 26c42ee134SAxel Dörfler uint32 Type(); 27c42ee134SAxel Dörfler size_t KeySize(); 28c42ee134SAxel Dörfler 2902c8f6c8SAxel Dörfler status_t Create(Transaction& transaction, const char* name, 3002c8f6c8SAxel Dörfler uint32 type); 31c42ee134SAxel Dörfler 3202c8f6c8SAxel Dörfler status_t Update(Transaction& transaction, const char* name, 3302c8f6c8SAxel Dörfler int32 type, const uint8* oldKey, 3402c8f6c8SAxel Dörfler uint16 oldLength, const uint8* newKey, 3502c8f6c8SAxel Dörfler uint16 newLength, Inode* inode); 36c42ee134SAxel Dörfler 3702c8f6c8SAxel Dörfler status_t InsertName(Transaction& transaction, 3802c8f6c8SAxel Dörfler const char* name, Inode* inode); 3902c8f6c8SAxel Dörfler status_t RemoveName(Transaction& transaction, 4002c8f6c8SAxel Dörfler const char* name, Inode* inode); 4102c8f6c8SAxel Dörfler status_t UpdateName(Transaction& transaction, 4202c8f6c8SAxel Dörfler const char* oldName, const char* newName, 43fb02804aSAxel Dörfler Inode* inode); 44c42ee134SAxel Dörfler 45fb02804aSAxel Dörfler status_t InsertSize(Transaction& transaction, Inode* inode); 46fb02804aSAxel Dörfler status_t RemoveSize(Transaction& transaction, Inode* inode); 47fb02804aSAxel Dörfler status_t UpdateSize(Transaction& transaction, Inode* inode); 48c42ee134SAxel Dörfler 4902c8f6c8SAxel Dörfler status_t InsertLastModified(Transaction& transaction, 5002c8f6c8SAxel Dörfler Inode* inode); 5102c8f6c8SAxel Dörfler status_t RemoveLastModified(Transaction& transaction, 5202c8f6c8SAxel Dörfler Inode* inode); 5302c8f6c8SAxel Dörfler status_t UpdateLastModified(Transaction& transaction, 54d09596f5SAxel Dörfler Inode* inode, bigtime_t modified = -1); 55c42ee134SAxel Dörfler 56c42ee134SAxel Dörfler private: 5702c8f6c8SAxel Dörfler Index(const Index& other); 5802c8f6c8SAxel Dörfler Index& operator=(const Index& other); 592b5451f1SAxel Dörfler // no implementation 602b5451f1SAxel Dörfler 61*225e1b11SAxel Dörfler private: 62c42ee134SAxel Dörfler Volume* fVolume; 63c42ee134SAxel Dörfler Inode* fNode; 64c42ee134SAxel Dörfler const char* fName; 65c42ee134SAxel Dörfler }; 66c42ee134SAxel Dörfler 67*225e1b11SAxel Dörfler 6802c8f6c8SAxel Dörfler #endif // INDEX_H 69