parser : read table of contents record

This change implements logic to read the OpenPOWER VPD VTOC record,
which contains information about offsets to other records in the VPD.

Change-Id: Id40dee0f940815766bf2e956c6ab08c875e6f79b
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/impl.hpp b/impl.hpp
index 63128bf..31bf22a 100644
--- a/impl.hpp
+++ b/impl.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include <cstddef>
 #include "store.hpp"
 
 namespace openpower
@@ -9,6 +10,13 @@
 namespace parser
 {
 
+namespace internal
+{
+
+using OffsetList = std::vector<uint32_t>;
+
+}
+
 /** @class Impl
  *  @brief Implements parser for OpenPOWER VPD
  *
@@ -54,6 +62,23 @@
         Store run();
 
     private:
+        /** @brief Process the table of contents record, VHDR
+         *
+         *  @returns List of offsets to records in VPD
+         */
+        internal::OffsetList readTOC() const;
+
+        /** @brief Read the PT keyword contained in the VHDR record,
+         *         to obtain offsets to other records in the VPD.
+         *
+         *  @param[in] iterator - iterator to buffer containing VPD
+         *  @param[in] ptLength - Length of PT keyword data
+         *
+         *  @returns List of offsets to records in VPD
+         */
+        internal::OffsetList readPT(Binary::const_iterator iterator,
+                                    std::size_t ptLen) const;
+
         /** @brief Checks if the VHDR record is present in the VPD */
         void checkHeader() const;