From 0bc21296c9ef32412237a8cc0c8141d0226b9070 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 11 Apr 2017 15:16:39 -0700 Subject: [vcpkg] Alias out standard filesystem headers to ensure clean separation. --- toolsrc/include/filesystem_fs.h | 13 ++++++++++++- toolsrc/include/vcpkg_Files.h | 7 +++++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/filesystem_fs.h b/toolsrc/include/filesystem_fs.h index ece485c23..8e223511d 100644 --- a/toolsrc/include/filesystem_fs.h +++ b/toolsrc/include/filesystem_fs.h @@ -2,4 +2,15 @@ #include -namespace fs = std::tr2::sys; \ No newline at end of file +namespace fs +{ + namespace stdfs = std::tr2::sys; + + using stdfs::path; + using stdfs::copy_options; + using stdfs::file_status; + + inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); } + inline bool is_directory(file_status s) { return stdfs::is_directory(s); } + inline bool status_known(file_status s) { return stdfs::status_known(s); } +} \ No newline at end of file diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 339b64364..dde5cf5ee 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -15,14 +15,17 @@ namespace vcpkg::Files virtual void write_all_lines(const fs::path& file_path, const std::vector& lines) = 0; virtual void rename(const fs::path& oldpath, const fs::path& newpath) = 0; - virtual void remove(const fs::path& path) = 0; + virtual bool remove(const fs::path& path) = 0; + virtual bool remove(const fs::path& path, std::error_code& ec) = 0; + virtual std::uintmax_t remove_all(const fs::path& path, std::error_code& ec) = 0; virtual bool exists(const fs::path& path) const = 0; virtual bool is_directory(const fs::path& path) const = 0; virtual bool is_regular_file(const fs::path& path) const = 0; virtual bool is_empty(const fs::path& path) const = 0; virtual bool create_directory(const fs::path& path, std::error_code& ec) = 0; virtual void copy(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts) = 0; - virtual void copy_file(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts, std::error_code& ec) = 0; + virtual bool copy_file(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts, std::error_code& ec) = 0; + virtual fs::file_status status(const fs::path& path, std::error_code& ec) const = 0; }; Filesystem& get_real_filesystem(); -- cgit v1.2.3