libcryfs/interface/BlockStore.h

28 lines
640 B
C
Raw Normal View History

2014-12-09 17:19:59 +01:00
#pragma once
#ifndef FSPP_BLOCKSTORE_BLOCKSTORE_H_
#define FSPP_BLOCKSTORE_BLOCKSTORE_H_
2015-02-17 00:23:33 +01:00
#include <messmer/blockstore/interface/Block.h>
2014-12-09 17:19:59 +01:00
#include <string>
#include <memory>
namespace blockstore {
//TODO Don't use string, but own class for keys? (better performance for all keys have same length)
class BlockStore {
public:
virtual ~BlockStore() {}
virtual std::unique_ptr<Block> create(size_t size) = 0;
2014-12-09 17:19:59 +01:00
//TODO Use boost::optional (if key doesn't exist)
// Return nullptr if block with this key doesn't exists
virtual std::unique_ptr<Block> load(const Key &key) = 0;
2015-02-22 00:29:21 +01:00
virtual void remove(const Key &key) = 0;
2014-12-09 17:19:59 +01:00
};
}
#endif