1*fb02804aSAxel Dörfler /* Index - index access functions 2*fb02804aSAxel Dörfler * 3*fb02804aSAxel Dörfler * Copyright 2001-2004, Axel Dörfler, axeld@pinc-software.de. 4*fb02804aSAxel Dörfler * This file may be used under the terms of the MIT License. 5*fb02804aSAxel Dörfler */ 6c42ee134SAxel Dörfler #ifndef INDEX_H 7c42ee134SAxel Dörfler #define INDEX_H 8c42ee134SAxel Dörfler 9c42ee134SAxel Dörfler 10c42ee134SAxel Dörfler #include <KernelExport.h> 11c42ee134SAxel 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 29*fb02804aSAxel Dörfler status_t Create(Transaction &transaction, const char *name, uint32 type); 30c42ee134SAxel Dörfler 31*fb02804aSAxel Dörfler status_t Update(Transaction &transaction, const char *name, int32 type, const uint8 *oldKey, 32*fb02804aSAxel Dörfler uint16 oldLength, const uint8 *newKey, uint16 newLength, Inode *inode); 33c42ee134SAxel Dörfler 34*fb02804aSAxel Dörfler status_t InsertName(Transaction &transaction, const char *name, Inode *inode); 35*fb02804aSAxel Dörfler status_t RemoveName(Transaction &transaction, const char *name, Inode *inode); 36*fb02804aSAxel Dörfler status_t UpdateName(Transaction &transaction, const char *oldName, const char *newName, 37*fb02804aSAxel Dörfler Inode *inode); 38c42ee134SAxel Dörfler 39*fb02804aSAxel Dörfler status_t InsertSize(Transaction &transaction, Inode *inode); 40*fb02804aSAxel Dörfler status_t RemoveSize(Transaction &transaction, Inode *inode); 41*fb02804aSAxel Dörfler status_t UpdateSize(Transaction &transaction, Inode *inode); 42c42ee134SAxel Dörfler 43*fb02804aSAxel Dörfler status_t InsertLastModified(Transaction &transaction, Inode *inode); 44*fb02804aSAxel Dörfler status_t RemoveLastModified(Transaction &transaction, Inode *inode); 45*fb02804aSAxel Dörfler status_t UpdateLastModified(Transaction &transaction, Inode *inode, off_t modified = -1); 46c42ee134SAxel Dörfler 47c42ee134SAxel Dörfler private: 482b5451f1SAxel Dörfler Index(const Index &); 492b5451f1SAxel Dörfler Index &operator=(const Index &); 502b5451f1SAxel Dörfler // no implementation 512b5451f1SAxel Dörfler 52c42ee134SAxel Dörfler Volume *fVolume; 53c42ee134SAxel Dörfler Inode *fNode; 54c42ee134SAxel Dörfler const char *fName; 55c42ee134SAxel Dörfler }; 56c42ee134SAxel Dörfler 57c42ee134SAxel Dörfler #endif /* INDEX_H */ 58