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
|
|
|
|
2015-09-30 14:05:05 +02:00
|
|
|
#include <messmer/cpp-utils/lock/LockPool.h>
|
2015-09-30 13:21:07 +02:00
|
|
|
#include <messmer/cpp-utils/pointer/unique_ref.h>
|
|
|
|
#include <messmer/blobstore/interface/BlobStore.h>
|
|
|
|
#include "FileBlob.h"
|
|
|
|
#include "DirBlob.h"
|
|
|
|
#include "SymlinkBlob.h"
|
|
|
|
|
|
|
|
namespace cryfs {
|
|
|
|
namespace fsblobstore {
|
2015-09-30 14:05:05 +02:00
|
|
|
//TODO Test classes in fsblobstore
|
|
|
|
|
2015-09-30 13:21:07 +02:00
|
|
|
class FsBlobStore {
|
|
|
|
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:
|
2015-09-30 14:05:05 +02:00
|
|
|
|
2015-10-04 17:20:14 +02:00
|
|
|
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
|