parser : implement entry method
Implement the run() method, which serves as the entry point to parse out
OpenPOWER VPD.
Change-Id: I966c38c6257f1a69b814518932c0c5c0a8386a08
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/impl.cpp b/impl.cpp
index 9a6d8f9..c06700f 100644
--- a/impl.cpp
+++ b/impl.cpp
@@ -293,6 +293,24 @@
return map;
}
+Store Impl::run()
+{
+ // Check if the VHDR record is present
+ checkHeader();
+
+ // Read the table of contents record, to get offsets
+ // to other records.
+ auto offsets = readTOC();
+ for (const auto& offset : offsets)
+ {
+ processRecord(offset);
+ }
+
+ // Return a Store object, which has interfaces to
+ // access parsed VPD by record:keyword
+ return Store(std::move(out));
+}
+
} // namespace parser
} // namespace vpd
} // namespace openpower