xref: /haiku/src/add-ons/kernel/file_systems/packagefs/package/PackageFile.h (revision 002f37b0cca92e4cf72857c72ac95db5a8b09615)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef PACKAGE_FILE_H
6 #define PACKAGE_FILE_H
7 
8 
9 #include "PackageData.h"
10 #include "PackageLeafNode.h"
11 
12 
13 class PackageFile : public PackageLeafNode {
14 public:
15 								PackageFile(Package* package, mode_t mode,
16 									const PackageData& data);
17 	virtual						~PackageFile();
18 
19 	virtual	status_t			VFSInit(dev_t deviceID, ino_t nodeID);
20 	virtual	void				VFSUninit();
21 
22 	virtual	off_t				FileSize() const;
23 
24 	virtual	status_t			Read(off_t offset, void* buffer,
25 									size_t* bufferSize);
26 	virtual	status_t			Read(io_request* request);
27 
28 private:
29 			struct IORequestOutput;
30 			struct DataAccessor;
31 
32 private:
33 			PackageData			fData;
34 			DataAccessor*		fDataAccessor;
35 };
36 
37 
38 #endif	// PACKAGE_FILE_H
39