diff options
author | Deepak Kodihalli <dkodihal@in.ibm.com> | 2017-09-11 23:32:01 -0500 |
---|---|---|
committer | Deepak Kodihalli <dkodihal@in.ibm.com> | 2017-09-11 23:32:28 -0500 |
commit | 7e7821c68cc4c693d1449da62fbbda840bcace24 (patch) | |
tree | 648efef59f3dd5a0d3bb85015f785c1311df7d03 | |
parent | d47f1030c1e77c7c2b40defe705be76c321c3464 (diff) | |
download | openpower-vpd-parser-7e7821c68cc4c693d1449da62fbbda840bcace24.tar.gz openpower-vpd-parser-7e7821c68cc4c693d1449da62fbbda840bcace24.zip |
store: add API to check if VPD exists
Change-Id: Ife91241448b64b077a7187d5839953ab0eb990e7
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
-rw-r--r-- | store.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -48,6 +48,20 @@ class Store final template<Record R, record::Keyword K> inline const std::string& get() const; + /** @brief Checks if VPD exists in store + * + * @tparam R - VPD record + * @tparam K - VPD keyword + * @returns true if {R,K} exists + */ + template<Record R, record::Keyword K> + bool exists() const + { + static const std::string record = getRecord<R>(); + static const std::string keyword = record::getKeyword<K>(); + return vpd.count(record) && vpd.at(record).count(keyword); + } + private: /** @brief The store for parsed VPD */ Parsed vpd; |