aboutsummaryrefslogtreecommitdiff
path: root/butl/filesystem
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-28 11:03:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-28 11:03:00 +0200
commit039f62b48a14fefabae07d8c008e2e131deadfc6 (patch)
tree109212c7e0633537ea3701b2f3037f909188c92c /butl/filesystem
parent31b316e1da75d4da75ee8def2c64fcf03c0dfe8f (diff)
Add few filesystem function overloads for C-string paths
Diffstat (limited to 'butl/filesystem')
-rw-r--r--butl/filesystem15
1 files changed, 12 insertions, 3 deletions
diff --git a/butl/filesystem b/butl/filesystem
index 41b9266..4b4af6a 100644
--- a/butl/filesystem
+++ b/butl/filesystem
@@ -36,13 +36,19 @@ namespace butl
// this function resolves symlinks.
//
LIBBUTL_EXPORT bool
- file_exists (const path&);
+ file_exists (const char*);
+
+ inline bool
+ file_exists (const path& p) {return file_exists (p.string ().c_str ());}
// Return true if the path is to an existing directory. Note that
// this function resolves symlinks.
//
LIBBUTL_EXPORT bool
- dir_exists (const path&);
+ dir_exists (const char*);
+
+ inline bool
+ dir_exists (const path& p) {return dir_exists (p.string ().c_str ());}
// Return true if the directory is empty. Note that the path must exist
// and be a directory.
@@ -217,7 +223,10 @@ namespace butl
// symlinks.
//
LIBBUTL_EXPORT timestamp
- file_mtime (const path&);
+ file_mtime (const char*);
+
+ inline timestamp
+ file_mtime (const path& p) {return file_mtime (p.string ().c_str ());}
// Path permissions.
//