Kun Yi | 64dc05c | 2018-12-19 13:19:03 -0800 | [diff] [blame^] | 1 | #include "binarystore.hpp" |
| 2 | |
| 3 | namespace binstore |
| 4 | { |
| 5 | |
| 6 | std::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 | |
| 15 | std::string BinaryStore::getBaseBlobId() const |
| 16 | { |
| 17 | return baseBlobId_; |
| 18 | } |
| 19 | |
| 20 | std::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 | |
| 33 | bool BinaryStore::openOrCreateBlob(const std::string& blobId, uint16_t flags) |
| 34 | { |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | bool BinaryStore::deleteBlob(const std::string& blobId) |
| 39 | { |
| 40 | return false; |
| 41 | } |
| 42 | |
| 43 | std::vector<uint8_t> BinaryStore::read(uint32_t offset, uint32_t requestedSize) |
| 44 | { |
| 45 | std::vector<std::uint8_t> result; |
| 46 | return result; |
| 47 | } |
| 48 | |
| 49 | bool BinaryStore::write(uint32_t offset, const std::vector<uint8_t>& data) |
| 50 | { |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | bool BinaryStore::commit() |
| 55 | { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | bool BinaryStore::close() |
| 60 | { |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | bool BinaryStore::stat() |
| 65 | { |
| 66 | return false; |
| 67 | } |
| 68 | |
| 69 | } // namespace binstore |