BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / file_systems / ramfs / Directory.h
bloba626cbffce906e2c677d232d751c5ceebfa9181b
1 // Directory.h
3 #ifndef DIRECTORY_H
4 #define DIRECTORY_H
6 #include <util/DoublyLinkedList.h>
8 #include "Node.h"
11 class Entry;
12 class File;
13 class SymLink;
15 class Directory : public Node {
16 public:
17 Directory(Volume *volume);
18 virtual ~Directory();
20 virtual status_t Link(Entry *entry);
21 virtual status_t Unlink(Entry *entry);
23 virtual status_t SetSize(off_t newSize);
24 virtual off_t GetSize() const;
26 Directory *GetParent() const;
28 status_t CreateDirectory(const char *name, Directory **directory);
29 status_t CreateFile(const char *name, File **file);
30 status_t CreateSymLink(const char *name, const char *path,
31 SymLink **symLink);
33 bool IsEmpty() const { return fEntries.IsEmpty(); }
35 status_t AddEntry(Entry *entry);
36 status_t CreateEntry(Node *node, const char *name, Entry **entry = NULL);
37 status_t RemoveEntry(Entry *entry);
38 status_t DeleteEntry(Entry *entry);
40 status_t FindEntry(const char *name, Entry **entry) const;
41 status_t FindNode(const char *name, Node **node) const;
42 status_t FindAndGetNode(const char *name, Node **node,
43 Entry **entry = NULL) const;
45 status_t GetPreviousEntry(Entry **entry) const;
46 status_t GetNextEntry(Entry **entry) const;
48 // debugging
49 virtual void GetAllocationInfo(AllocationInfo &info);
51 private:
52 status_t _CreateCommon(Node *node, const char *name);
54 private:
55 DoublyLinkedList<Entry> fEntries;
58 #endif // DIRECTORY_H