forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDODownloader.h
More file actions
28 lines (25 loc) · 1 KB
/
Copy pathDODownloader.h
File metadata and controls
28 lines (25 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#include <AppInstallerDownloader.h>
#include <AppInstallerProgress.h>
#include <optional>
#include <ostream>
#include <string>
#include <vector>
namespace AppInstaller::Utility
{
// Downloads a file from the given URL and places it in the given location.
// url: The url to be downloaded from. http->https redirection is allowed.
// dest: The stream to be downloaded to.
// computeHash: Optional. Indicates if SHA256 hash should be calculated when downloading.
std::optional<std::vector<BYTE>> DODownload(
const std::string& url,
const std::filesystem::path& dest,
IProgressCallback& progress,
bool computeHash,
std::optional<DownloadInfo> info);
// Returns true if the error from DODownload should be treated as fatal;
// false if we should be able to fall back to other download methods.
bool IsDOErrorFatal(HRESULT error);
}