34 lines
913 B
C++
34 lines
913 B
C++
#pragma once
|
|
#ifndef MESSMER_CRYFS_FILESYSTEM_CRYOPENFILE_H_
|
|
#define MESSMER_CRYFS_FILESYSTEM_CRYOPENFILE_H_
|
|
|
|
#include <fspp/fs_interface/OpenFile.h>
|
|
#include "parallelaccessfsblobstore/FileBlobRef.h"
|
|
|
|
namespace cryfs {
|
|
class CryDevice;
|
|
|
|
class CryOpenFile final: public fspp::OpenFile {
|
|
public:
|
|
explicit CryOpenFile(const CryDevice *device, cpputils::unique_ref<parallelaccessfsblobstore::FileBlobRef> fileBlob);
|
|
~CryOpenFile();
|
|
|
|
void stat(struct ::stat *result) const override;
|
|
void truncate(off_t size) const override;
|
|
size_t read(void *buf, size_t count, off_t offset) const override;
|
|
void write(const void *buf, size_t count, off_t offset) override;
|
|
void flush() override;
|
|
void fsync() override;
|
|
void fdatasync() override;
|
|
|
|
private:
|
|
const CryDevice *_device;
|
|
cpputils::unique_ref<parallelaccessfsblobstore::FileBlobRef> _fileBlob;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CryOpenFile);
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|