diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-29 18:08:53 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-30 13:38:42 -0800 |
| commit | 0042316c4b57cf91ded8e474a8dda354340e7381 (patch) | |
| tree | b328767cab72afa547e9d06c5662f56fc5cfac21 | |
| parent | 5815a102389e84fd1bc6a6d7865ab0459d7c7a9f (diff) | |
| download | vcpkg-0042316c4b57cf91ded8e474a8dda354340e7381.tar.gz vcpkg-0042316c4b57cf91ded8e474a8dda354340e7381.zip | |
Introduce filesystem_fs.h
| -rw-r--r-- | toolsrc/include/BuildInfo.h | 2 | ||||
| -rw-r--r-- | toolsrc/include/Paragraphs.h | 3 | ||||
| -rw-r--r-- | toolsrc/include/coff_file_reader.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/filesystem_fs.h | 5 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg.h | 3 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Files.h | 10 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_System.h | 5 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_paths.h | 4 | ||||
| -rw-r--r-- | toolsrc/src/commands_hash.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/commands_search.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/metrics.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/post_build_lint.cpp | 3 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 1 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Files.cpp | 3 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_System.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_metrics_uploader.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_paths.cpp | 1 | ||||
| -rw-r--r-- | toolsrc/vcpkg/vcpkg.vcxproj | 1 | ||||
| -rw-r--r-- | toolsrc/vcpkg/vcpkg.vcxproj.filters | 3 |
19 files changed, 19 insertions, 41 deletions
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 <regex> -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 <filesystem> +#include "filesystem_fs.h" #include <unordered_map> namespace vcpkg { namespace Paragraphs { - namespace fs = std::tr2::sys; std::vector<std::unordered_map<std::string, std::string>> get_paragraphs(const fs::path& control_path); std::vector<std::unordered_map<std::string, std::string>> 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 <vector> #include "MachineType.h" -#include <filesystem> +#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 <filesystem> + +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 <filesystem> #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 <filesystem> +#include "filesystem_fs.h" #include <iterator> 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<std::string> get_contents(const std::tr2::sys::path& file_path) noexcept; + expected<std::string> 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 <class Pred> void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector<fs::path>* 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 <filesystem> +#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 <filesystem> +#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<vcpkg_paths> create(const fs::path& vcpkg_root_dir); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 4b89f2894..17c191b78 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,8 +1,6 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace fs = std::tr2::sys; - namespace vcpkg { static void do_file_hash(fs::path const& path, std::wstring const& hashType) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 923368252..a604c5383 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,8 +4,6 @@ #include "vcpkglib_helpers.h" #include "SourceParagraph.h" -namespace fs = std::tr2::sys; - namespace vcpkg { static std::vector<SourceParagraph> read_all_source_paragraphs(const vcpkg_paths& paths) diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index ada065fd6..23962bcfe 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -10,12 +10,10 @@ #include <Windows.h> #include <winhttp.h> #include <fstream> -#include <filesystem> +#include "filesystem_fs.h" #include "vcpkg_Strings.h" #include "vcpkg_System.h" -namespace fs = std::tr2::sys; - namespace vcpkg { static std::string GetCurrentDateTime() diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 61fbba52a..1a09c99b7 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -1,4 +1,3 @@ -#include <filesystem> #include "vcpkg_paths.h" #include "package_spec.h" #include "vcpkg_Files.h" @@ -8,8 +7,6 @@ #include "BuildInfo.h" #include <regex> -namespace fs = std::tr2::sys; - namespace vcpkg { namespace PostBuildLint { enum class lint_status diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index b1fe76982..4b65ea972 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -6,7 +6,6 @@ #include <string> #include <unordered_map> #include <memory> -#include <filesystem> #include <vector> #include <cassert> #include "vcpkg_Files.h" diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 86e7080e4..b86edb4ab 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -1,10 +1,7 @@ #include "vcpkg_Files.h" #include <fstream> -#include <filesystem> #include <regex> -namespace fs = std::tr2::sys; - namespace vcpkg {namespace Files { static const std::regex FILESYSTEM_INVALID_CHARACTERS_REGEX = std::regex(R"([\/:*?"<>|])"); diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index cc7080069..cb3eb6584 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -3,8 +3,6 @@ #include <Windows.h> #include <regex> -namespace fs = std::tr2::sys; - namespace vcpkg {namespace System { fs::path get_exe_path_of_current_process() diff --git a/toolsrc/src/vcpkg_metrics_uploader.cpp b/toolsrc/src/vcpkg_metrics_uploader.cpp index f1f4a52ed..63668d1d7 100644 --- a/toolsrc/src/vcpkg_metrics_uploader.cpp +++ b/toolsrc/src/vcpkg_metrics_uploader.cpp @@ -1,10 +1,8 @@ #include "metrics.h" -#include <filesystem> #include "vcpkg_Checks.h" #include "vcpkg_Files.h" #include <Windows.h> -namespace fs = std::tr2::sys; using namespace vcpkg; int WINAPI diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 5347b79d8..b7e716307 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -1,4 +1,3 @@ -#include <filesystem> #include "expected.h" #include "vcpkg_paths.h" #include "metrics.h" diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 9d9022229..7fab309d3 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -154,6 +154,7 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\include\coff_file_reader.h" /> + <ClInclude Include="..\include\filesystem_fs.h" /> <ClInclude Include="..\include\MachineType.h" /> <ClInclude Include="..\include\vcpkg_cmd_arguments.h" /> <ClInclude Include="..\include\vcpkg_Commands.h" /> diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 568850787..cfbb17a22 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -110,5 +110,8 @@ <ClInclude Include="..\include\MachineType.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\include\filesystem_fs.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> </Project>
\ No newline at end of file |
