diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2018-02-21 16:16:14 +1030 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2018-03-24 13:59:32 +1030 |
commit | d394a787595281838831182f534ff8faf95a15ba (patch) | |
tree | a5d141eca65f22947ddf932536d72df450ec89a1 /pnor_partition_table.hpp | |
parent | 485954001e5d5275aa8e2e27c0f3a2706e5c7294 (diff) | |
download | phosphor-mboxd-d394a787595281838831182f534ff8faf95a15ba.tar.gz phosphor-mboxd-d394a787595281838831182f534ff8faf95a15ba.zip |
pnor_partition_table: Move parseTocLine() out of Table class
This is the final patch in the ongoing effort to extract parseTocLine()
from the Table class, enabling re-use in setup for test cases.
Change-Id: I62bbcbba39fbd337e370dcc78aec6ef3cf337caa
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'pnor_partition_table.hpp')
-rw-r--r-- | pnor_partition_table.hpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/pnor_partition_table.hpp b/pnor_partition_table.hpp index a3251fb..d470822 100644 --- a/pnor_partition_table.hpp +++ b/pnor_partition_table.hpp @@ -24,6 +24,19 @@ using checksum_t = uint32_t; */ PartitionTable endianFixup(const PartitionTable& src); +/** @brief Parse a ToC line (entry) into the corresponding FFS partition + * object. + * + * @param[in] line - The ToC line to parse + * @param[in] blockSize - The flash block size in bytes + * @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(const std::string& line, size_t blockSize, + pnor_partition& part); + namespace details { @@ -144,17 +157,6 @@ 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] 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(const std::string& line, pnor_partition& part); - /** @brief Prepares a vector of PNOR partition structures. */ void preparePartitions(); |