DODownloader.h (980B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include <AppInstallerDownloader.h> 5 #include <AppInstallerProgress.h> 6 7 #include <optional> 8 #include <ostream> 9 #include <string> 10 #include <vector> 11 12 namespace AppInstaller::Utility 13 { 14 // Downloads a file from the given URL and places it in the given location. 15 // url: The url to be downloaded from. http->https redirection is allowed. 16 // dest: The stream to be downloaded to. 17 // computeHash: Optional. Indicates if SHA256 hash should be calculated when downloading. 18 DownloadResult DODownload( 19 const std::string& url, 20 const std::filesystem::path& dest, 21 IProgressCallback& progress, 22 std::optional<DownloadInfo> info); 23 24 // Returns true if the error from DODownload should be treated as fatal; 25 // false if we should be able to fall back to other download methods. 26 bool IsDOErrorFatal(HRESULT error); 27 }