xref: /haiku/src/system/boot/loader/file_systems/amiga_ffs/File.h (revision 3cb015b1ee509d69c643506e8ff573808c86dcfc)
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 FILE_H
6 #define FILE_H
7 
8 
9 #include <boot/vfs.h>
10 
11 #include "Volume.h"
12 
13 
14 namespace FFS {
15 
16 class File : public Node {
17 	public:
18 		File(Volume &volume, int32 block);
19 		virtual ~File();
20 
21 		status_t InitCheck();
22 
23 		virtual status_t Open(void **_cookie, int mode);
24 		virtual status_t Close(void *cookie);
25 
26 		virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize);
27 		virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize);
28 
29 		virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
30 		virtual int32 Type() const;
31 		virtual off_t Size() const;
32 		virtual ino_t Inode() const;
33 
34 	private:
35 		Volume		&fVolume;
36 		FileBlock	fNode;
37 };
38 
39 }	// namespace FFS
40 
41 #endif	/* FILE_H */
42