#include <DataUploader.h>
|
void | Upload (CancellationContextPtr cancellationContex, const ServiceConfig &config, const UploadUrls &target, std::vector< uint8_t > data, std::function< void(ResponseResult)> callback, std::function< void(double)> progressCallback={}) |
|
void | Upload (CancellationContextPtr cancellationContex, const ServiceConfig &config, const UploadUrls &target, std::string filePath, std::function< void(ResponseResult)> callback, std::function< void(double)> progressCallback={}) |
|
Definition at line 34 of file DataUploader.h.
◆ ResponsesList
◆ DataUploader() [1/3]
audacity::cloud::audiocom::sync::DataUploader::DataUploader |
( |
| ) |
|
|
privatedefault |
◆ ~DataUploader()
audacity::cloud::audiocom::sync::DataUploader::~DataUploader |
( |
| ) |
|
|
private |
◆ DataUploader() [2/3]
audacity::cloud::audiocom::sync::DataUploader::DataUploader |
( |
const DataUploader & |
| ) |
|
|
privatedelete |
◆ DataUploader() [3/3]
audacity::cloud::audiocom::sync::DataUploader::DataUploader |
( |
DataUploader && |
| ) |
|
|
privatedelete |
◆ Get()
DataUploader & audacity::cloud::audiocom::sync::DataUploader::Get |
( |
| ) |
|
|
static |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ RemoveResponse()
void audacity::cloud::audiocom::sync::DataUploader::RemoveResponse |
( |
UploadOperation & |
response | ) |
|
|
private |
◆ Upload() [1/2]
void audacity::cloud::audiocom::sync::DataUploader::Upload |
( |
CancellationContextPtr |
cancellationContex, |
|
|
const ServiceConfig & |
config, |
|
|
const UploadUrls & |
target, |
|
|
std::string |
filePath, |
|
|
std::function< void(ResponseResult)> |
callback, |
|
|
std::function< void(double)> |
progressCallback = {} |
|
) |
| |
Definition at line 240 of file DataUploader.cpp.
245{
246 if (!callback)
247 callback = [](auto...) {};
248
249 if (!progressCallback)
250 progressCallback = [](auto...) { return true; };
251
252 if (!cancellationContex)
254
256 {
257 if (callback)
258 callback(ResponseResult {
261
262 return;
263 }
264
266
267 mResponses.emplace_back(std::make_shared<UploadOperation>(
268 *this, cancellationContex, target, std::move(filePath),
270 std::move(callback), std::move(progressCallback)));
271
273}
static CancellationContextPtr Create()
constexpr int RetriesCount
const std::string ApplicationXOctetStream
std::string ToUTF8(const std::wstring &wstr)
wxString ToWXString(const std::string &str)
References audacity::network_manager::common_content_types::ApplicationXOctetStream, audacity::concurrency::CancellationContext::Create(), mResponseMutex, mResponses, audacity::cloud::audiocom::sync::RetriesCount, audacity::ToUTF8(), audacity::ToWXString(), audacity::cloud::audiocom::UnknownError, and XO().
◆ Upload() [2/2]
void audacity::cloud::audiocom::sync::DataUploader::Upload |
( |
CancellationContextPtr |
cancellationContex, |
|
|
const ServiceConfig & |
config, |
|
|
const UploadUrls & |
target, |
|
|
std::vector< uint8_t > |
data, |
|
|
std::function< void(ResponseResult)> |
callback, |
|
|
std::function< void(double)> |
progressCallback = {} |
|
) |
| |
Definition at line 215 of file DataUploader.cpp.
220{
221 if (!callback)
222 callback = [](auto...) {};
223
224 if (!progressCallback)
225 progressCallback = [](auto...) { return true; };
226
227 if (!cancellationContex)
229
231
232 mResponses.emplace_back(std::make_unique<UploadOperation>(
233 *this, cancellationContex, target, std::move(data),
235 std::move(callback), std::move(progressCallback)));
236
238}
References audacity::network_manager::common_content_types::ApplicationXOctetStream, audacity::concurrency::CancellationContext::Create(), mResponseMutex, mResponses, and audacity::cloud::audiocom::sync::RetriesCount.
Referenced by audacity::cloud::audiocom::sync::MissingBlocksUploader::ConsumeBlock(), audacity::cloud::audiocom::sync::LocalProjectSnapshot::OnSnapshotCreated(), audacity::cloud::audiocom::sync::MixdownUploader::UploadMixdown(), and audacity::cloud::audiocom::sync::anonymous_namespace{ResumedSnaphotUploadOperation.cpp}::ResumedSnaphotUploadOperation::UploadSnapshot().
◆ mResponseMutex
std::mutex audacity::cloud::audiocom::sync::DataUploader::mResponseMutex |
|
private |
◆ mResponses
ResponsesList audacity::cloud::audiocom::sync::DataUploader::mResponses |
|
private |
The documentation for this class was generated from the following files: