headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / boot / loader / file_systems / fat / File.h
blob9b4d71f10ba30c5476de8098fdcac47ee4719676
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 FILE_H
6 #define FILE_H
9 #include <boot/vfs.h>
11 #include "Stream.h"
12 #include "Volume.h"
15 namespace FATFS {
17 class File : public Node {
18 public:
19 File(Volume &volume, off_t dirEntryOffset, uint32 cluster, off_t size,
20 const char *name);
21 virtual ~File();
23 status_t InitCheck();
25 off_t DirEntryOffset() const { return fDirEntryOffset; }
27 virtual status_t Open(void **_cookie, int mode);
28 virtual status_t Close(void *cookie);
30 virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize);
31 virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize);
33 virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
34 virtual status_t GetFileMap(struct file_map_run *runs, int32 *count);
35 virtual int32 Type() const;
36 virtual off_t Size() const;
37 virtual ino_t Inode() const;
39 private:
40 Volume &fVolume;
41 //FileBlock fNode;
42 Stream fStream;
43 off_t fDirEntryOffset;
46 } // namespace FATFS
48 #endif /* FILE_H */