diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-27 18:08:52 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-27 18:59:57 -0700 |
| commit | 1e9471a1489156720362ef12e1ec6849ea9b45b6 (patch) | |
| tree | 46f0f35093ecd18034c9f9463d6f8b7aa590ade0 /toolsrc/src/vcpkg_Files.cpp | |
| parent | 75e8752cb90eb8bc7717518d9d6a5c68f27f2b0f (diff) | |
| download | vcpkg-1e9471a1489156720362ef12e1ec6849ea9b45b6.tar.gz vcpkg-1e9471a1489156720362ef12e1ec6849ea9b45b6.zip | |
Run clang-format over the cpp files
Diffstat (limited to 'toolsrc/src/vcpkg_Files.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg_Files.cpp | 59 |
1 files changed, 23 insertions, 36 deletions
diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 599c6f5ef..385e95f27 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -1,4 +1,5 @@ #include "pch.h" + #include "vcpkg_Files.h" #include "vcpkg_System.h" #include <thread> @@ -51,7 +52,8 @@ namespace vcpkg::Files return std::move(output); } - virtual fs::path find_file_recursively_up(const fs::path & starting_dir, const std::string & filename) const override + virtual fs::path find_file_recursively_up(const fs::path& starting_dir, + const std::string& filename) const override { fs::path current_dir = starting_dir; for (; !current_dir.empty(); current_dir = current_dir.parent_path()) @@ -66,7 +68,7 @@ namespace vcpkg::Files return current_dir; } - virtual std::vector<fs::path> get_files_recursive(const fs::path & dir) const override + virtual std::vector<fs::path> get_files_recursive(const fs::path& dir) const override { std::vector<fs::path> ret; @@ -79,7 +81,7 @@ namespace vcpkg::Files return ret; } - virtual std::vector<fs::path> get_files_non_recursive(const fs::path & dir) const override + virtual std::vector<fs::path> get_files_non_recursive(const fs::path& dir) const override { std::vector<fs::path> ret; @@ -92,7 +94,7 @@ namespace vcpkg::Files return ret; } - virtual void write_lines(const fs::path & file_path, const std::vector<std::string>& lines) override + virtual void write_lines(const fs::path& file_path, const std::vector<std::string>& lines) override { std::fstream output(file_path, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); for (const std::string& line : lines) @@ -102,19 +104,13 @@ namespace vcpkg::Files output.close(); } - virtual void rename(const fs::path & oldpath, const fs::path & newpath) override + virtual void rename(const fs::path& oldpath, const fs::path& newpath) override { fs::stdfs::rename(oldpath, newpath); } - virtual bool remove(const fs::path & path) override - { - return fs::stdfs::remove(path); - } - virtual bool remove(const fs::path & path, std::error_code& ec) override - { - return fs::stdfs::remove(path, ec); - } - virtual std::uintmax_t remove_all(const fs::path & path, std::error_code& ec) override + virtual bool remove(const fs::path& path) override { return fs::stdfs::remove(path); } + virtual bool remove(const fs::path& path, std::error_code& ec) override { return fs::stdfs::remove(path, ec); } + virtual std::uintmax_t remove_all(const fs::path& path, std::error_code& ec) override { // Working around the currently buggy remove_all() std::uintmax_t out = fs::stdfs::remove_all(path, ec); @@ -128,28 +124,19 @@ namespace vcpkg::Files if (this->exists(path)) { - System::println(System::Color::warning, "Some files in %s were unable to be removed. Close any editors operating in this directory and retry.", path.string()); + System::println(System::Color::warning, + "Some files in %s were unable to be removed. Close any editors operating in this " + "directory and retry.", + path.string()); } return out; } - virtual bool exists(const fs::path & path) const override - { - return fs::stdfs::exists(path); - } - virtual bool is_directory(const fs::path & path) const override - { - return fs::stdfs::is_directory(path); - } - virtual bool is_regular_file(const fs::path & path) const override - { - return fs::stdfs::is_regular_file(path); - } - virtual bool is_empty(const fs::path & path) const override - { - return fs::stdfs::is_empty(path); - } - virtual bool create_directory(const fs::path & path, std::error_code & ec) override + virtual bool exists(const fs::path& path) const override { return fs::stdfs::exists(path); } + virtual bool is_directory(const fs::path& path) const override { return fs::stdfs::is_directory(path); } + virtual bool is_regular_file(const fs::path& path) const override { return fs::stdfs::is_regular_file(path); } + virtual bool is_empty(const fs::path& path) const override { return fs::stdfs::is_empty(path); } + virtual bool create_directory(const fs::path& path, std::error_code& ec) override { return fs::stdfs::create_directory(path, ec); } @@ -157,11 +144,12 @@ namespace vcpkg::Files { return fs::stdfs::create_directories(path, ec); } - virtual void copy(const fs::path & oldpath, const fs::path & newpath, fs::copy_options opts) override + virtual void copy(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts) override { fs::stdfs::copy(oldpath, newpath, opts); } - virtual bool copy_file(const fs::path & oldpath, const fs::path & newpath, fs::copy_options opts, std::error_code & ec) override + virtual bool + copy_file(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts, std::error_code& ec) override { return fs::stdfs::copy_file(oldpath, newpath, opts, ec); } @@ -180,10 +168,9 @@ namespace vcpkg::Files Checks::check_exit(VCPKG_LINE_INFO, count == data.size()); } - }; - Filesystem & get_real_filesystem() + Filesystem& get_real_filesystem() { static RealFilesystem real_fs; return real_fs; |
