1 /* 2 ** Copyright 2003-2004, 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 7 8 9 #include <boot/vfs.h> 10 11 #include "Volume.h" 12 #include "Stream.h" 13 14 15 namespace BFS { 16 17 class File : public Node { 18 public: 19 File(Volume &volume, block_run run); 20 File(Volume &volume, off_t id); 21 File(const Stream &stream); 22 virtual ~File(); 23 24 status_t InitCheck(); 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 protected: 35 Stream fStream; 36 }; 37 38 } // namespace BFS 39 40 #endif /* FILE_H */ 41