binarystore: Move serialized data loading to its own function

Move serialized data loading to a separate function to make the code
cleaner.

Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I267bc1ec42a0f6b4100aff357b5ed9c9fb1a2716
diff --git a/binarystore.hpp b/binarystore.hpp
index 551d22d..f07cf7b 100644
--- a/binarystore.hpp
+++ b/binarystore.hpp
@@ -106,6 +106,7 @@
         baseBlobId_(baseBlobId),
         file_(std::move(file)), maxSize_(maxSize)
     {
+        blob_.set_blob_base_id(baseBlobId_);
     }
 
     ~BinaryStore() = default;
@@ -146,6 +147,10 @@
         CommitError // Error happened during committing
     };
 
+    /* Load the serialized data from sysfile if commit state is dirty.
+     * Returns False if encountered error when loading */
+    bool loadSerializedData();
+
     std::string baseBlobId_;
     binaryblobproto::BinaryBlobBase blob_;
     binaryblobproto::BinaryBlob* currentBlob_ = nullptr;