2014-11-15 16:33:24 +01:00
|
|
|
#pragma once
|
|
|
|
#ifndef CRYFS_LIB_CRYFILE_H_
|
|
|
|
#define CRYFS_LIB_CRYFILE_H_
|
|
|
|
|
2015-03-12 15:37:26 +01:00
|
|
|
#include "impl/FileBlob.h"
|
2015-02-17 01:02:15 +01:00
|
|
|
#include <messmer/fspp/fs_interface/File.h>
|
2014-11-15 16:33:24 +01:00
|
|
|
#include "CryNode.h"
|
|
|
|
|
2014-12-09 11:28:52 +01:00
|
|
|
|
2014-11-15 16:33:24 +01:00
|
|
|
namespace cryfs {
|
|
|
|
|
2014-11-16 00:05:28 +01:00
|
|
|
class CryFile: public fspp::File, CryNode {
|
2014-11-15 16:33:24 +01:00
|
|
|
public:
|
2015-03-11 00:23:52 +01:00
|
|
|
CryFile(CryDevice *device, std::unique_ptr<DirBlob> parent, const blockstore::Key &key);
|
2014-11-15 16:33:24 +01:00
|
|
|
virtual ~CryFile();
|
|
|
|
|
2015-03-08 03:25:20 +01:00
|
|
|
void stat(struct ::stat *result) const override;
|
2014-11-16 00:05:28 +01:00
|
|
|
std::unique_ptr<fspp::OpenFile> open(int flags) const override;
|
2014-11-15 16:33:24 +01:00
|
|
|
void truncate(off_t size) const override;
|
|
|
|
void unlink() override;
|
|
|
|
|
|
|
|
private:
|
2015-03-08 03:51:19 +01:00
|
|
|
CryDevice *_device;
|
2015-03-11 00:23:52 +01:00
|
|
|
std::unique_ptr<DirBlob> _parent;
|
|
|
|
blockstore::Key _key;
|
2014-12-09 11:28:52 +01:00
|
|
|
|
2014-11-15 16:33:24 +01:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CryFile);
|
|
|
|
};
|
|
|
|
|
2014-12-07 08:57:23 +01:00
|
|
|
}
|
2014-11-15 16:33:24 +01:00
|
|
|
|
|
|
|
#endif
|