Files
haiku-beta6/src/add-ons/kernel/file_systems/packagefs/PackageFile.h
T
Ingo Weinhold 744a460c12 * Package: Added Open() (and matching Close()) method, which opens the package
file once, tracking an open count.
* Added VFSInit()/VFSUninit() methods to the Node and PackageNode class
  hierarchies, called by the {get,put}_vnode() PackageFile implements them to
  set up/tear down access to the file data. Also added a Read() reading the
  data.
* Implemented the open(), free_cookie(), and read() FS hooks for real. Reading
  files works now. Executing doesn't yet -- it requires working with
  IORequests in a way not supported by the userlandfs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-17 22:04:46 +00:00

38 lines
730 B
C++

/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef PACKAGE_FILE_H
#define PACKAGE_FILE_H
#include "PackageData.h"
#include "PackageLeafNode.h"
class PackageFile : public PackageLeafNode {
public:
PackageFile(Package* package, mode_t mode,
const PackageData& data);
virtual ~PackageFile();
virtual status_t VFSInit(dev_t deviceID, ino_t nodeID);
virtual void VFSUninit();
virtual off_t FileSize() const;
virtual status_t Read(off_t offset, void* buffer,
size_t* bufferSize);
private:
struct DataAccessor;
private:
PackageData fData;
DataAccessor* fDataAccessor;
};
#endif // PACKAGE_FILE_H