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 "Stream.h" 12 #include "Volume.h" 13 14 15 namespace FATFS { 16 17 class File : public Node { 18 public: 19 File(Volume &volume, uint32 cluster, off_t size, const char *name); 20 virtual ~File(); 21 22 status_t InitCheck(); 23 24 virtual status_t Open(void **_cookie, int mode); 25 virtual status_t Close(void *cookie); 26 27 virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize); 28 virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize); 29 30 virtual status_t GetName(char *nameBuffer, size_t bufferSize) const; 31 virtual status_t GetFileMap(struct file_map_run *runs, int32 *count); 32 virtual int32 Type() const; 33 virtual off_t Size() const; 34 virtual ino_t Inode() const; 35 36 private: 37 Volume &fVolume; 38 //FileBlock fNode; 39 Stream fStream; 40 }; 41 42 } // namespace FATFS 43 44 #endif /* FILE_H */ 45