Fix getting light user list
[platform/core/appfw/app-installers.git] / src / common / utils / file_util.cc
index 76ce1de..8df33f4 100644 (file)
@@ -739,4 +739,19 @@ bf::path RelativePath(const bf::path& from,
   return result;
 }
 
+std::vector<std::string> GetDirectoryList(const boost::filesystem::path& cwd) {
+  if (!bf::exists(cwd))
+    return {};
+
+  std::vector<std::string> list;
+  for (bf::directory_iterator file(cwd); file != bf::directory_iterator();
+      ++file) {
+    if (!bf::is_directory(file->path()))
+      continue;
+    list.emplace_back(file->path().filename().string());
+  }
+
+  return list;
+}
+
 }  // namespace common_installer