diff --git a/include/vcpkg/base/files.h b/include/vcpkg/base/files.h index 7b43319223..57694986a1 100644 --- a/include/vcpkg/base/files.h +++ b/include/vcpkg/base/files.h @@ -52,10 +52,10 @@ namespace vcpkg } }; - bool is_symlink(FileType s); - bool is_regular_file(FileType s); - bool is_directory(FileType s); - bool exists(FileType s); + constexpr bool is_symlink(FileType s) noexcept { return s == FileType::symlink || s == FileType::junction; } + constexpr bool is_regular_file(FileType s) noexcept { return s == FileType::regular; } + constexpr bool is_directory(FileType s) noexcept { return s == FileType::directory; } + constexpr bool exists(FileType s) noexcept { return s != FileType::not_found && s != FileType::none; } struct FilePointer { diff --git a/include/vcpkg/commands.install.h b/include/vcpkg/commands.install.h index 22d7f8f394..eb34c0f6fc 100644 --- a/include/vcpkg/commands.install.h +++ b/include/vcpkg/commands.install.h @@ -56,8 +56,8 @@ namespace vcpkg Path m_listfile; public: - const Path& destination() const; - const Path& listfile() const; + const Path& destination() const noexcept { return this->m_destination; } + const Path& listfile() const noexcept { return this->m_listfile; } }; void install_package_and_write_listfile(const Filesystem& fs, diff --git a/src/vcpkg/base/files.cpp b/src/vcpkg/base/files.cpp index e466e97163..dec715d4f2 100644 --- a/src/vcpkg/base/files.cpp +++ b/src/vcpkg/base/files.cpp @@ -1366,11 +1366,6 @@ namespace vcpkg const char* to_printf_arg(const Path& p) noexcept { return p.m_str.c_str(); } - bool is_symlink(FileType s) { return s == FileType::symlink || s == FileType::junction; } - bool is_regular_file(FileType s) { return s == FileType::regular; } - bool is_directory(FileType s) { return s == FileType::directory; } - bool exists(FileType s) { return s != FileType::not_found && s != FileType::none; } - FilePointer::FilePointer(const Path& path) : m_fs(nullptr), m_path(path) { } FilePointer::FilePointer() noexcept : m_fs(nullptr), m_path{} { } diff --git a/src/vcpkg/commands.install.cpp b/src/vcpkg/commands.install.cpp index 5f750f3658..c2ef6ced1b 100644 --- a/src/vcpkg/commands.install.cpp +++ b/src/vcpkg/commands.install.cpp @@ -42,10 +42,6 @@ namespace vcpkg return dirs; } - const Path& InstallDir::destination() const { return this->m_destination; } - - const Path& InstallDir::listfile() const { return this->m_listfile; } - void install_package_and_write_listfile(const Filesystem& fs, const Path& source_dir, const InstallDir& destination_dir)