libcryfs/impl/FileBlob.h

34 lines
683 B
C
Raw Normal View History

#pragma once
#ifndef CRYFS_LIB_IMPL_FILEBLOB_H_
#define CRYFS_LIB_IMPL_FILEBLOB_H_
#include <messmer/blobstore/interface/Blob.h>
#include <memory>
namespace cryfs {
class FileBlob {
public:
static std::unique_ptr<FileBlob> InitializeEmptyFile(std::unique_ptr<blobstore::Blob> blob);
FileBlob(std::unique_ptr<blobstore::Blob> blob);
virtual ~FileBlob();
void read(void *target, uint64_t offset, uint64_t count) const;
void write(const void *source, uint64_t offset, uint64_t count);
void resize(off_t size);
2015-03-11 00:34:25 +01:00
off_t size() const;
blockstore::Key key() const;
private:
std::unique_ptr<blobstore::Blob> _blob;
unsigned char magicNumber() const;
};
}
#endif