aboutsummaryrefslogtreecommitdiff
path: root/butl/filesystem.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-19 18:10:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-19 18:10:12 +0200
commit6aada88dc77a95a7b2726c39e008d4ddcd38d58c (patch)
tree12206f32a4f650860bfccc596c1607e5fb19e0c2 /butl/filesystem.ixx
parent2676fc8d88af82dff1033869823b435d9b91c9b8 (diff)
Add dir_empty() test
Diffstat (limited to 'butl/filesystem.ixx')
-rw-r--r--butl/filesystem.ixx6
1 files changed, 6 insertions, 0 deletions
diff --git a/butl/filesystem.ixx b/butl/filesystem.ixx
index af1125e..6062c38 100644
--- a/butl/filesystem.ixx
+++ b/butl/filesystem.ixx
@@ -4,6 +4,12 @@
namespace butl
{
+ inline bool
+ dir_empty (const dir_path& d)
+ {
+ return dir_iterator (d) == dir_iterator ();
+ }
+
inline rmdir_status
try_rmdir_r (const dir_path& p, bool ignore_error)
{