libcryfs/src/cryfs/filesystem/fsblobstore/FsBlobStore.h

38 lines
1.1 KiB
C
Raw Normal View History

2015-10-15 13:06:51 +02:00
#pragma once
#ifndef MESSMER_CRYFS_FILESYSTEM_FSBLOBSTORE_FSBLOBSTORE_H
#define MESSMER_CRYFS_FILESYSTEM_FSBLOBSTORE_FSBLOBSTORE_H
2015-09-30 13:21:07 +02:00
2016-02-11 16:39:42 +01:00
#include <cpp-utils/lock/LockPool.h>
#include <cpp-utils/pointer/unique_ref.h>
#include <blobstore/interface/BlobStore.h>
2015-09-30 13:21:07 +02:00
#include "FileBlob.h"
#include "DirBlob.h"
#include "SymlinkBlob.h"
namespace cryfs {
namespace fsblobstore {
//TODO Test classes in fsblobstore
class FsBlobStore final {
2015-09-30 13:21:07 +02:00
public:
FsBlobStore(cpputils::unique_ref<blobstore::BlobStore> baseBlobStore);
cpputils::unique_ref<FileBlob> createFileBlob();
cpputils::unique_ref<DirBlob> createDirBlob();
cpputils::unique_ref<SymlinkBlob> createSymlinkBlob(const boost::filesystem::path &target);
boost::optional<cpputils::unique_ref<FsBlob>> load(const blockstore::Key &key);
void remove(cpputils::unique_ref<FsBlob> blob);
private:
std::function<off_t(const blockstore::Key &)> _getLstatSize();
2015-09-30 13:21:07 +02:00
cpputils::unique_ref<blobstore::BlobStore> _baseBlobStore;
2015-10-05 16:58:33 +02:00
DISALLOW_COPY_AND_ASSIGN(FsBlobStore);
2015-09-30 13:21:07 +02:00
};
}
}
#endif