blob: 10aa44950a0492ea78916d645c7df7d5f67c962a [file] [log] [blame]
Kun Yi64dc05c2018-12-19 13:19:03 -08001#include "binarystore.hpp"
2
3namespace binstore
4{
5
6std::unique_ptr<BinaryStoreInterface>
7 BinaryStore::createFromConfig(const std::string& baseBlobId,
8 const std::string& sysfilePath,
9 uint32_t offset, uint32_t maxSize)
10{
11 // TODO: implement sysFile parsing
12 return std::make_unique<BinaryStore>(baseBlobId, 0, offset, maxSize);
13}
14
15std::string BinaryStore::getBaseBlobId() const
16{
17 return baseBlobId_;
18}
19
20std::vector<std::string> BinaryStore::getBlobIds() const
21{
22 std::vector<std::string> result;
23 result.push_back(baseBlobId_);
24
25 for (const auto& blob : blob_.blobs)
26 {
27 result.push_back(blob.id);
28 }
29
30 return result;
31}
32
33bool BinaryStore::openOrCreateBlob(const std::string& blobId, uint16_t flags)
34{
35 return false;
36}
37
38bool BinaryStore::deleteBlob(const std::string& blobId)
39{
40 return false;
41}
42
43std::vector<uint8_t> BinaryStore::read(uint32_t offset, uint32_t requestedSize)
44{
45 std::vector<std::uint8_t> result;
46 return result;
47}
48
49bool BinaryStore::write(uint32_t offset, const std::vector<uint8_t>& data)
50{
51 return false;
52}
53
54bool BinaryStore::commit()
55{
56 return false;
57}
58
59bool BinaryStore::close()
60{
61 return false;
62}
63
64bool BinaryStore::stat()
65{
66 return false;
67}
68
69} // namespace binstore