]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Implementation of SALOME_Fake_NamingService::list_directory_recurs
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 26 Aug 2021 09:04:13 +0000 (11:04 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 26 Aug 2021 09:04:13 +0000 (11:04 +0200)
This is needed by ShutdownContainers.

src/NamingService/SALOME_Fake_NamingService.cxx

index a667cc03e5a9fdffe4ec7cb154da273bdb6eb27d..2952fef9eb929aff17bf86d7b736cdc835b673a9 100644 (file)
@@ -114,7 +114,6 @@ std::vector<std::string> SALOME_Fake_NamingService::list_directory()
   std::lock_guard<std::mutex> g(_mutex);
   std::vector<std::string> ret;
   std::vector<std::string> splitCWD(SplitDir(_current_dir));
-  auto len = _current_dir.length();
   for(auto it : _map)
   {
     std::vector<std::string> splitIt(SplitDir(it.first));
@@ -130,7 +129,12 @@ std::vector<std::string> SALOME_Fake_NamingService::list_directory()
 
 std::vector<std::string> SALOME_Fake_NamingService::list_directory_recurs()
 {
-  return std::vector<std::string>();
+  std::vector<std::string> result;
+  for(const std::pair< std::string,CORBA::Object_var>& it : _map)
+    if( it.first.length() >= _current_dir.length() &&
+        it.first.compare(0, _current_dir.length(), _current_dir) == 0)
+      result.push_back(it.first);
+  return result;
 }
 
 CORBA::Object_ptr SALOME_Fake_NamingService::Resolve(const char* Path)