xref: /haiku/src/system/boot/loader/file_systems/fat/Directory.h (revision b671e9bbdbd10268a042b4f4cc4317ccd03d105e)
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 "fatfs.h"
10 #include "Stream.h"
11 
12 #include <boot/vfs.h>
13 
14 
15 namespace FATFS {
16 
17 class Volume;
18 
19 class Directory : public ::Directory {
20 	public:
21 		Directory();
22 		Directory(Volume &volume, uint32 cluster, const char *name);
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 		status_t GetNextEntry(void *cookie,
42 				uint8 mask = FAT_VOLUME, uint8 match = 0);
43 		Volume			&fVolume;
44 		Stream			fStream;
45 
46 		typedef ::Directory _inherited;
47 };
48 
49 }	// namespace FATFS
50 
51 #endif	/* DIRECTORY_H */
52