-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8604948
commit 43b4b54
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,39 @@ | ||
#include "../generic/dirlist.hpp" | ||
#pragma once | ||
|
||
#include <filesystem> | ||
|
||
#include <stringconv.hpp> | ||
|
||
namespace untwine | ||
{ | ||
namespace os | ||
{ | ||
|
||
// PDAL's directoryList had a bug, so we've imported a working | ||
// version here so that we can still use older PDAL releases. | ||
|
||
inline std::vector<std::string> directoryList(const std::string& dir) | ||
{ | ||
namespace fs = std::filesystem; | ||
|
||
std::vector<std::string> files; | ||
|
||
try | ||
{ | ||
fs::directory_iterator it(toNative(dir)); | ||
fs::directory_iterator end; | ||
while (it != end) | ||
{ | ||
files.push_back(fromNative(it->path().string())); | ||
it++; | ||
} | ||
} | ||
catch (fs::filesystem_error&) | ||
{ | ||
files.clear(); | ||
} | ||
return files; | ||
} | ||
|
||
} // namespace os | ||
} // namespace untwine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters