xref: /haiku/src/system/boot/loader/file_systems/amiga_ffs/Directory.h (revision 6aa2c9ecf151dae2111df60a737ceb266fd18002)
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 "amiga_ffs.h"
10 
11 #include <boot/vfs.h>
12 
13 
14 namespace FFS {
15 
16 class Volume;
17 
18 class Directory : public ::Directory {
19 	public:
20 		Directory(Volume &volume, ::Directory* parent, RootBlock &root);
21 		Directory(Volume &volume, ::Directory* parent, int32 block);
22 		virtual ~Directory();
23 
24 		status_t InitCheck();
25 
26 		virtual status_t Open(void **_cookie, int mode);
27 		virtual status_t Close(void *cookie);
28 
29 		virtual Node *Lookup(const char *name, bool traverseLinks);
30 
31 		virtual status_t GetNextEntry(void *cookie, char *nameBuffer, size_t bufferSize);
32 		virtual status_t GetNextNode(void *cookie, Node **_node);
33 		virtual status_t Rewind(void *cookie);
34 		virtual bool IsEmpty();
35 
36 		virtual status_t GetName(char *name, size_t size) const;
37 		virtual ino_t Inode() const;
38 
39 	private:
40 		Volume			&fVolume;
41 		DirectoryBlock	fNode;
42 
43 		typedef ::Directory _inherited;
44 };
45 
46 }	// namespace FFS
47 
48 #endif	/* DIRECTORY_H */
49