diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-17 18:18:47 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-17 19:04:17 -0700 |
| commit | 4da39c6ca6e70734abe7b3d880e6987b7783fe36 (patch) | |
| tree | 83152d912ac6c1fcc047b793b71e1b64e8498b5d /toolsrc/include | |
| parent | c8ff4e39ba313b7ad6d3daa0d604e5f648a04d71 (diff) | |
| download | vcpkg-4da39c6ca6e70734abe7b3d880e6987b7783fe36.tar.gz vcpkg-4da39c6ca6e70734abe7b3d880e6987b7783fe36.zip | |
InstallationDirs struct now checks/create the needed dirs
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Commands.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 21c82cea2..8535e27c4 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -45,10 +45,19 @@ namespace vcpkg::Commands { struct InstallationDirs { + static InstallationDirs initiliaze_dirs(Files::Filesystem& fs, + const fs::path& source_dir, + const fs::path& destination_root, + const std::string& destination_subdirectory, + const fs::path& listfile); + + fs::path source_dir; // "source" from source-destination, not source code. fs::path destination_root; std::string destination_subdirectory; fs::path listfile; + + fs::path destination() const; }; void install_files_and_write_listfile(Files::Filesystem& fs, const InstallationDirs& dirs); @@ -167,7 +176,7 @@ namespace vcpkg::Commands void perform_and_exit(const VcpkgCmdArguments& args); } - template <class T> + template<class T> struct PackageNameAndFunction { std::string name; @@ -178,7 +187,7 @@ namespace vcpkg::Commands const std::vector<PackageNameAndFunction<CommandTypeB>>& get_available_commands_type_b(); const std::vector<PackageNameAndFunction<CommandTypeC>>& get_available_commands_type_c(); - template <typename T> + template<typename T> T find(const std::string& command_name, const std::vector<PackageNameAndFunction<T>> available_commands) { for (const PackageNameAndFunction<T>& cmd : available_commands) |
