blob: dcc17b4fee9499cf0472d8d1f8ac80d23fda6aaa [file] [log] [blame]
Kun Yi91beea62018-11-26 15:23:14 -08001#pragma once
2
3#include <blobs-ipmid/blobs.hpp>
4#include <cstdint>
5#include <string>
6#include <vector>
7
8using std::size_t;
9using std::uint16_t;
10using std::uint32_t;
11using std::uint64_t;
12using std::uint8_t;
13
14namespace blobs
15{
16
17class BinaryStoreBlobHandler : public GenericBlobInterface
18{
19 public:
20 BinaryStoreBlobHandler() = default;
21 ~BinaryStoreBlobHandler() = default;
22 BinaryStoreBlobHandler(const BinaryStoreBlobHandler&) = delete;
23 BinaryStoreBlobHandler& operator=(const BinaryStoreBlobHandler&) = delete;
24 BinaryStoreBlobHandler(BinaryStoreBlobHandler&&) = default;
25 BinaryStoreBlobHandler& operator=(BinaryStoreBlobHandler&&) = default;
26
27 bool canHandleBlob(const std::string& path) override;
28 std::vector<std::string> getBlobIds() override;
29 bool deleteBlob(const std::string& path) override;
30 bool stat(const std::string& path, struct BlobMeta* meta) override;
31 bool open(uint16_t session, uint16_t flags,
32 const std::string& path) override;
33 std::vector<uint8_t> read(uint16_t session, uint32_t offset,
34 uint32_t requestedSize) override;
35 bool write(uint16_t session, uint32_t offset,
36 const std::vector<uint8_t>& data) override;
37 bool writeMeta(uint16_t session, uint32_t offset,
38 const std::vector<uint8_t>& data) override;
39 bool commit(uint16_t session, const std::vector<uint8_t>& data) override;
40 bool close(uint16_t session) override;
41 bool stat(uint16_t session, struct BlobMeta* meta) override;
42 bool expire(uint16_t session) override;
43};
44
45} // namespace blobs