Expose power cap min/max on dbus

The min and max power cap values will be read from sysfs files and then
the data will be put on the dbus. This will allow users to know the
valid range of power cap available.

The PowerCap object was moved from Manager to Status.

Change-Id: I5196cc8645f84c31a5282cf844109bae47b09bf7
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_device.hpp b/occ_device.hpp
index 106604e..97bdceb 100644
--- a/occ_device.hpp
+++ b/occ_device.hpp
@@ -11,6 +11,7 @@
 
 #include <filesystem>
 #include <fstream>
+#include <regex>
 
 namespace open_power
 {
@@ -274,6 +275,25 @@
      *  @param[in] error - True if an error is reported, false otherwise
      */
     void throttleMemTempCallback(bool error);
+
+    /** @brief Get the pathname for a file based on a regular expression
+     *
+     *  @param[in] basePath - The path where the files will be checked
+     *  @param[in] expr - Regular expression describing the target file
+     *
+     *  @return path to the file or empty path if not found
+     */
+    fs::path getFilenameByRegex(fs::path basePath, const std::regex& expr) const
+    {
+        for (auto& file : fs::directory_iterator(basePath))
+        {
+            if (std::regex_search(file.path().string(), expr))
+            {
+                return file;
+            }
+        }
+        return fs::path{};
+    }
 };
 
 } // namespace occ