From 0042316c4b57cf91ded8e474a8dda354340e7381 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 18:08:53 -0800 Subject: Introduce filesystem_fs.h --- toolsrc/include/BuildInfo.h | 2 -- toolsrc/include/Paragraphs.h | 3 +-- toolsrc/include/coff_file_reader.h | 4 +--- toolsrc/include/filesystem_fs.h | 5 +++++ toolsrc/include/vcpkg.h | 3 --- toolsrc/include/vcpkg_Files.h | 10 ++++------ toolsrc/include/vcpkg_System.h | 5 ++--- toolsrc/include/vcpkg_paths.h | 4 +--- 8 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 toolsrc/include/filesystem_fs.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 7c654d9c7..9f872385e 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -4,8 +4,6 @@ #include "Paragraphs.h" #include -namespace fs = std::tr2::sys; - namespace vcpkg { namespace PostBuildLint { enum class LinkageType diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 22aaefe98..9e9fafe49 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -1,11 +1,10 @@ #pragma once -#include +#include "filesystem_fs.h" #include namespace vcpkg { namespace Paragraphs { - namespace fs = std::tr2::sys; std::vector> get_paragraphs(const fs::path& control_path); std::vector> parse_paragraphs(const std::string& str); }} diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index 81f107f10..1a9a071ef 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -1,12 +1,10 @@ #pragma once #include #include "MachineType.h" -#include +#include "filesystem_fs.h" namespace vcpkg {namespace COFFFileReader { - namespace fs = std::tr2::sys; - struct dll_info { MachineType machine_type; diff --git a/toolsrc/include/filesystem_fs.h b/toolsrc/include/filesystem_fs.h new file mode 100644 index 000000000..ece485c23 --- /dev/null +++ b/toolsrc/include/filesystem_fs.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +namespace fs = std::tr2::sys; \ No newline at end of file diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 81b4d45ba..832fb1920 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -1,6 +1,5 @@ #pragma once -#include #include "package_spec.h" #include "BinaryParagraph.h" #include "StatusParagraphs.h" @@ -8,8 +7,6 @@ namespace vcpkg { - namespace fs = std::tr2::sys; - extern bool g_do_dry_run; StatusParagraphs database_load_check(const vcpkg_paths& paths); diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 8ed1eabe1..aa25d8333 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -1,22 +1,20 @@ #pragma once #include "expected.h" -#include +#include "filesystem_fs.h" #include namespace vcpkg {namespace Files { - namespace fs = std::tr2::sys; - static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; - void check_is_directory(const std::tr2::sys::path& dirpath); + void check_is_directory(const fs::path& dirpath); bool has_invalid_chars_for_filesystem(const std::string s); - expected get_contents(const std::tr2::sys::path& file_path) noexcept; + expected get_contents(const fs::path& file_path) noexcept; - std::tr2::sys::path find_file_recursively_up(const std::tr2::sys::path& starting_dir, const std::string& filename); + fs::path find_file_recursively_up(const fs::path& starting_dir, const std::string& filename); template void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index c420464c1..e059bde0a 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -1,12 +1,11 @@ #pragma once #include "vcpkg_Strings.h" - -#include +#include "filesystem_fs.h" namespace vcpkg {namespace System { - std::tr2::sys::path get_exe_path_of_current_process(); + fs::path get_exe_path_of_current_process(); struct exit_code_and_output { diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index 2dc9c7636..a2932070d 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -1,13 +1,11 @@ #pragma once -#include +#include "filesystem_fs.h" #include "expected.h" #include "package_spec.h" #include "BinaryParagraph.h" namespace vcpkg { - namespace fs = std::tr2::sys; - struct vcpkg_paths { static expected create(const fs::path& vcpkg_root_dir); -- cgit v1.2.3