@@ -46,7 +46,7 @@ void get_nodemap_as_string(std::stringstream & ss, Spinnaker::CameraPtr cam)
46
46
ss << s;
47
47
}
48
48
49
- static std::optional<CNodePtr> find_node (const std::string & path, CNodePtr & node, bool debug)
49
+ static std::optional<CNodePtr> find_node (const std::string & path, CNodePtr & node, bool debug, bool allow_unreadable )
50
50
{
51
51
// split off first part
52
52
auto pos = path.find (" /" );
@@ -72,12 +72,12 @@ static std::optional<CNodePtr> find_node(const std::string & path, CNodePtr & no
72
72
if (std::string (childNode->GetName ().c_str ()) == token) {
73
73
// no slash in name, this is a leaf node
74
74
const bool is_leaf_node = (pos == std::string::npos);
75
- if (is_readable (childNode)) {
75
+ if (allow_unreadable || is_readable (childNode)) {
76
76
if (is_leaf_node) {
77
77
return (childNode);
78
78
} else {
79
79
const std::string rest = path.substr (pos + 1 );
80
- return (find_node (rest, childNode, debug));
80
+ return (find_node (rest, childNode, debug, allow_unreadable ));
81
81
}
82
82
} else {
83
83
return (CNodePtr (nullptr )); // found, but not readable
@@ -90,11 +90,11 @@ static std::optional<CNodePtr> find_node(const std::string & path, CNodePtr & no
90
90
return (std::nullopt);
91
91
}
92
92
93
- std::optional<CNodePtr> find_node (const std::string & path, Spinnaker::CameraPtr cam, bool debug)
93
+ std::optional<CNodePtr> find_node (const std::string & path, Spinnaker::CameraPtr cam, bool debug, bool allow_unreadable )
94
94
{
95
95
INodeMap & appLayerNodeMap = cam->GetNodeMap ();
96
96
CNodePtr rootNode = appLayerNodeMap.GetNode (" Root" );
97
- return (find_node (path, rootNode, debug));
97
+ return (find_node (path, rootNode, debug, allow_unreadable ));
98
98
}
99
99
} // namespace genicam_utils
100
100
} // namespace spinnaker_camera_driver
0 commit comments