mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 20:53:02 +08:00
Introduce filesystem_fs.h
This commit is contained in:
parent
5815a10238
commit
0042316c4b
@ -4,8 +4,6 @@
|
||||
#include "Paragraphs.h"
|
||||
#include <regex>
|
||||
|
||||
namespace fs = std::tr2::sys;
|
||||
|
||||
namespace vcpkg { namespace PostBuildLint
|
||||
{
|
||||
enum class LinkageType
|
||||
|
@ -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);
|
||||
}}
|
||||
|
@ -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;
|
||||
|
5
toolsrc/include/filesystem_fs.h
Normal file
5
toolsrc/include/filesystem_fs.h
Normal file
@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace fs = std::tr2::sys;
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
#include <filesystem>
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include "vcpkg_Files.h"
|
||||
|
@ -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"([\/:*?"<>|])");
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <filesystem>
|
||||
#include "expected.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "metrics.h"
|
||||
|
@ -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" />
|
||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user