libcryfs/src/blockstore/utils/BlockStoreUtils.cpp

19 lines
396 B
C++
Raw Normal View History

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