xref: /haiku/src/system/boot/loader/file_systems/bfs/Directory.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the OpenBeOS License.
4 */
5 #ifndef DIRECTORY_H
6 #define DIRECTORY_H
7 
8 
9 #include <boot/vfs.h>
10 
11 #include "Volume.h"
12 #include "Stream.h"
13 #include "BPlusTree.h"
14 
15 
16 namespace BFS {
17 
18 class Directory : public ::Directory {
19 	public:
20 		Directory(Volume &volume, block_run run);
21 		Directory(Volume &volume, off_t id);
22 		Directory(const Stream &stream);
23 		virtual ~Directory();
24 
25 		status_t InitCheck();
26 
27 		virtual status_t Open(void **_cookie, int mode);
28 		virtual status_t Close(void *cookie);
29 
30 		virtual Node *Lookup(const char *name, bool traverseLinks);
31 
32 		virtual status_t GetNextEntry(void *cookie, char *nameBuffer, size_t bufferSize);
33 		virtual status_t GetNextNode(void *cookie, Node **_node);
34 		virtual status_t Rewind(void *cookie);
35 		virtual bool IsEmpty();
36 
37 		virtual status_t GetName(char *name, size_t size) const;
38 		virtual ino_t Inode() const;
39 
40 	private:
41 		Stream		fStream;
42 		BPlusTree	fTree;
43 
44 		typedef ::Directory _inherited;
45 };
46 
47 }	// namespace BFS
48 
49 #endif	/* DIRECTORY_H */
50