summaryrefslogtreecommitdiffstats
path: root/fs.hpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-11-21 14:19:28 -0800
committerPatrick Venture <venture@google.com>2018-11-28 08:47:53 -0800
commitc18e2b649691e393f0c6e0fcd9af288b68d7d9b5 (patch)
tree50b0ea97c204c1b43d32303f8a3ce0b115eaf98f /fs.hpp
parent2536863d32314250b94794143d6cadaf8e8c86fe (diff)
downloadphosphor-ipmi-blobs-c18e2b649691e393f0c6e0fcd9af288b68d7d9b5.tar.gz
phosphor-ipmi-blobs-c18e2b649691e393f0c6e0fcd9af288b68d7d9b5.zip
add dynamic library interface to enable testing
Add interface defining the methods for dynamic linking to enable testing. Change-Id: If4d090d3cedc019b426435a1f651191803bfc1a9 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'fs.hpp')
-rw-r--r--fs.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs.hpp b/fs.hpp
new file mode 100644
index 0000000..2fb574e
--- /dev/null
+++ b/fs.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <functional>
+#include <string>
+#include <vector>
+
+namespace blobs
+{
+using PathMatcher = std::function<bool(const std::string& filename)>;
+
+/**
+ * Returns a list of library paths. Checks against match method.
+ *
+ * TODO: Can be dropped if we implement a clean fs wrapper for test injection.
+ *
+ * @param[in] path - the path to search
+ * @param[in] check - the function to call to check the path
+ * @return a list of paths that match the criteria
+ */
+std::vector<std::string> getLibraryList(const std::string& path,
+ PathMatcher check);
+
+} // namespace blobs
OpenPOWER on IntegriCloud