libcryfs/src/cryfs_lib/CryOpenFile.h

33 lines
763 B
C
Raw Normal View History

#pragma once
#ifndef CRYFS_LIB_CRYOPENFILE_H_
#define CRYFS_LIB_CRYOPENFILE_H_
2014-11-16 00:10:29 +01:00
#include "fspp/fs_interface/OpenFile.h"
#include "fspp/utils/macros.h"
namespace cryfs {
class CryDevice;
2014-11-16 00:05:28 +01:00
class CryOpenFile: public fspp::OpenFile {
public:
CryOpenFile(const CryDevice *device, const boost::filesystem::path &path, int flags);
virtual ~CryOpenFile();
void stat(struct ::stat *result) const override;
void truncate(off_t size) const override;
int read(void *buf, size_t count, off_t offset) override;
void write(const void *buf, size_t count, off_t offset) override;
2014-11-21 01:11:24 +01:00
void flush() override;
void fsync() override;
void fdatasync() override;
private:
int _descriptor;
DISALLOW_COPY_AND_ASSIGN(CryOpenFile);
};
} /* namespace cryfs */
#endif