xref: /haiku/src/add-ons/kernel/file_systems/ramfs/File.h (revision b9795faf5d27edaf49acb9f884ba181c0f0ae66b)
1 /*
2  * Copyright 2007, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * All rights reserved. Distributed under the terms of the MIT license.
4  */
5 #ifndef FILE_H
6 #define FILE_H
7 
8 #include "DataContainer.h"
9 #include "Node.h"
10 
11 class File : public Node, public DataContainer {
12 public:
13 	File(Volume *volume);
14 	virtual ~File();
15 
GetVolume()16 	Volume *GetVolume() const	{ return Node::GetVolume(); }
17 
18 	virtual status_t ReadAt(off_t offset, void *buffer, size_t size,
19 							size_t *bytesRead);
20 	virtual status_t WriteAt(off_t offset, const void *buffer, size_t size,
21 							 size_t *bytesWritten);
22 
23 	virtual status_t SetSize(off_t newSize);
24 	virtual off_t GetSize() const;
25 
26 	// debugging
27 	virtual void GetAllocationInfo(AllocationInfo &info);
28 };
29 
30 #endif	// FILE_H
31