Add protobuf definitions
Add protobuf definitions for binaryblob store, and change data types
to the generated class.
Signed-off-by: Kun Yi <kunyi@google.com>
Change-Id: I856a000c4a81c10bbbd1983d51712b4999a4e29e
diff --git a/binarystore.hpp b/binarystore.hpp
index a54eaf5..7020cff 100644
--- a/binarystore.hpp
+++ b/binarystore.hpp
@@ -7,6 +7,8 @@
#include <string>
#include <vector>
+#include "binaryblob.pb.h"
+
using std::size_t;
using std::uint16_t;
using std::uint32_t;
@@ -85,19 +87,6 @@
virtual bool stat() = 0;
};
-// TODO: move to protobuf definition
-struct BinaryBlobSingle
-{
- std::string id;
- std::vector<uint8_t> data;
-};
-
-struct BinaryBlob
-{
- std::string baseBlobId;
- std::vector<BinaryBlobSingle> blobs;
-};
-
/**
* @class BinaryStore instantiates a concrete implementation of
* BinaryStoreInterface. The dependency on file is injected through its
@@ -150,7 +139,8 @@
int fd_;
uint32_t offset_;
uint32_t maxSize_;
- BinaryBlob blob_;
+ binaryblobproto::BinaryBlobBase blob_;
+ binaryblobproto::BinaryBlob* currentBlob_;
};
} // namespace binstore