libcryfs/utils/BlockStoreUtils.cpp

18 lines
410 B
C++
Raw Normal View History

2015-02-17 00:23:33 +01:00
#include <messmer/blockstore/interface/BlockStore.h>
#include <messmer/blockstore/utils/BlockStoreUtils.h>
2015-01-24 01:24:37 +01:00
#include <memory>
using std::unique_ptr;
namespace blockstore {
namespace utils {
unique_ptr<Block> copyToNewBlock(BlockStore *blockStore, const Block &block) {
2015-01-24 01:24:37 +01:00
auto newBlock = blockStore->create(block.size());
std::memcpy(newBlock->data(), block.data(), block.size());
2015-01-24 01:24:37 +01:00
return newBlock;
}
}
}