Audacity 3.2.0
NetworkUtils.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 NetworkUtils.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11
12#pragma once
13
14#include <chrono>
15#include <string>
16
18{
19class IResponse;
20class Request;
21} // namespace audacity::network_manager
22
24{
25struct CLOUD_AUDIOCOM_API TransferStats final
26{
27 using Duration = std::chrono::milliseconds;
28
29 int64_t BytesTransferred {};
30 int64_t BlocksTransferred {};
31 int64_t ProjectFilesTransferred {};
32
33 Duration TransferDuration {};
34
35 TransferStats& SetBytesTransferred(int64_t bytesTransferred);
36 TransferStats& SetBlocksTransferred(int64_t blocksTransferred);
37 TransferStats& SetProjectFilesTransferred(int64_t projectFilesTransferred);
38 TransferStats& SetTransferDuration(Duration transferDuration);
39}; // struct TransferStats
40
41
43{
44 Success,
45 Cancelled,
46 Expired,
47 Conflict,
49 PaymentRequired,
51 Unauthorized,
52 Forbidden,
53 NotFound,
56 InternalServerError,
59}; // enum class ResponseResultCode
60
61struct ResponseResult final
62{
64 std::string Content;
65}; // struct ResponseResult
66
68 audacity::network_manager::IResponse& response, bool readBody);
69
71
73} // namespace audacity::cloud::audiocom
TimePoint::duration Duration
Interface, that provides access to the data from the HTTP response.
Definition: IResponse.h:113
bool IsUploadRecoverable(SyncResultCode code)
void SetCommonHeaders(Request &request)
ResponseResult GetResponseResult(IResponse &response, bool readBody)
std::chrono::milliseconds Duration
Definition: NetworkUtils.h:27