Refactor GetSubTreePaths method
Since the GetSubTreePaths method has been implemented in dbus_utility
and this commit is to integrate all the places where the
GetSubTreePaths method is called, and use the method in dbus_utility
uniformly.
Requires https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/60020 to
build.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie4140d4484a7e4f4b943013f4371ffd2d44a22e9
diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp
index 393ffe3..c7fda6d 100644
--- a/include/dbus_utility.hpp
+++ b/include/dbus_utility.hpp
@@ -29,6 +29,7 @@
#include <span>
#include <sstream>
#include <string>
+#include <string_view>
#include <tuple>
#include <utility>
#include <variant>
@@ -157,7 +158,8 @@
}
inline void getSubTreePaths(
- const std::string& path, std::span<std::string> interfaces,
+ const std::string& path, int32_t depth,
+ std::span<const std::string_view> interfaces,
std::function<void(const boost::system::error_code&,
const MapperGetSubTreePathsResponse&)>&& callback)
{
@@ -169,7 +171,7 @@
},
"xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths", path, 0,
+ "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths", path, depth,
interfaces);
}