vfs: check userland buffers before reading them.
[haiku.git] / src / system / boot / loader / file_systems / amiga_ffs / Directory.h
blobaf830ec42f92a1f6ae4df101044fc72afb0c3c40
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
5 #ifndef DIRECTORY_H
6 #define DIRECTORY_H
9 #include "amiga_ffs.h"
11 #include <boot/vfs.h>
14 namespace FFS {
16 class Volume;
18 class Directory : public ::Directory {
19 public:
20 Directory();
21 Directory(Volume &volume, RootBlock &root);
22 Directory(Volume &volume, int32 block);
23 virtual ~Directory();
25 status_t InitCheck();
27 virtual status_t Open(void **_cookie, int mode);
28 virtual status_t Close(void *cookie);
30 virtual Node* LookupDontTraverse(const char* name);
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();
37 virtual status_t GetName(char *name, size_t size) const;
38 virtual ino_t Inode() const;
40 private:
41 Volume &fVolume;
42 DirectoryBlock fNode;
44 typedef ::Directory _inherited;
47 } // namespace FFS
49 #endif /* DIRECTORY_H */