summaryrefslogtreecommitdiffstats
path: root/pnor_partition_table.hpp
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-02-21 15:29:38 +1030
committerAndrew Jeffery <andrew@aj.id.au>2018-03-24 13:59:32 +1030
commit581a4f2c267ebad0b1cbf554a7b23ebf25ececfd (patch)
tree0fec5afe047042e4ace62e4d0f1b5b85ee9c366d /pnor_partition_table.hpp
parentf34db31d768e38c3add58a83cd943609771fd212 (diff)
downloadphosphor-mboxd-581a4f2c267ebad0b1cbf554a7b23ebf25ececfd.tar.gz
phosphor-mboxd-581a4f2c267ebad0b1cbf554a7b23ebf25ececfd.zip
pnor_partition_table: Extract preparePartitions() loop body
Create a new private method, parseTocLine(), to handle the function of the loop body. The eventual goal is to extract the function from the class completely and simply have parseTocLine() as a public function in the openpower::virtual_pnor namespace. This will facilitate testing of the virtual PNOR parts of the codebase. Change-Id: Ib8c3b39eb9390cfc088a54abd45aab6f551775d3 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'pnor_partition_table.hpp')
-rw-r--r--pnor_partition_table.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/pnor_partition_table.hpp b/pnor_partition_table.hpp
index d3d7fa4..6e9d2fa 100644
--- a/pnor_partition_table.hpp
+++ b/pnor_partition_table.hpp
@@ -144,6 +144,20 @@ class Table
const pnor_partition& partition(const std::string& name) const;
private:
+ /** @brief Parse a ToC line (entry) into the corresponding FFS partition
+ * object.
+ *
+ * @param[in] dir - The parent directory of the FFS partition files
+ * described in the ToC.
+ * @param[in] line - The ToC line to parse
+ * @param[out] part - The partition object to populate with the information
+ * parsed from the provided ToC line
+ *
+ * @returns True on success, false on failure.
+ */
+ bool parseTocLine(fs::path& dir, const std::string& line,
+ pnor_partition& part);
+
/** @brief Prepares a vector of PNOR partition structures.
*/
void preparePartitions();
OpenPOWER on IntegriCloud