aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
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();