aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-04-11 15:16:39 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-04-11 15:16:39 -0700
commit0bc21296c9ef32412237a8cc0c8141d0226b9070 (patch)
treebe76ea0d3e3b2d8f469f8ff83fe2187d533efabd /toolsrc/include
parentb34c40a4e674f5db538e84ca2b9509482ac140e7 (diff)
downloadvcpkg-0bc21296c9ef32412237a8cc0c8141d0226b9070.tar.gz
vcpkg-0bc21296c9ef32412237a8cc0c8141d0226b9070.zip
[vcpkg] Alias out standard filesystem headers to ensure clean separation.
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/filesystem_fs.h13
-rw-r--r--toolsrc/include/vcpkg_Files.h7
2 files changed, 17 insertions, 3 deletions
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 <filesystem>
-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<std::string>& 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();