From 039f62b48a14fefabae07d8c008e2e131deadfc6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Aug 2016 11:03:00 +0200 Subject: Add few filesystem function overloads for C-string paths --- butl/filesystem | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'butl/filesystem') 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. // -- cgit v1.1