Audacity 3.2.0
Functions
audacity::cloud::audiocom::sync::anonymous_namespace{RemoteProjectSnapshot.cpp} Namespace Reference

Functions

std::vector< std::string > ListAttachedDatabases ()
 
std::vector< uint8_t > ReadResponseData (audacity::network_manager::IResponse &response)
 

Function Documentation

◆ ListAttachedDatabases()

std::vector< std::string > audacity::cloud::audiocom::sync::anonymous_namespace{RemoteProjectSnapshot.cpp}::ListAttachedDatabases ( )

Definition at line 35 of file RemoteProjectSnapshot.cpp.

36{
37 auto db = CloudProjectsDatabase::Get().GetConnection();
38 auto statement = db->CreateStatement("PRAGMA database_list");
39 auto result = statement->Prepare().Run();
40
41 std::vector<std::string> attachedDBs;
42
43 for (auto row : result)
44 {
45 std::string dbName;
46
47 if (!row.Get(1, dbName))
48 continue;
49
50 if (dbName == "main" || dbName == "temp")
51 continue;
52
53 attachedDBs.push_back(std::move(dbName));
54 }
55
56 return attachedDBs;
57}
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:202

References audacity::sqlite::Connection::CreateStatement(), audacity::cloud::audiocom::sync::CloudProjectsDatabase::Get(), and audacity::cloud::audiocom::sync::CloudProjectsDatabase::GetConnection().

Referenced by audacity::cloud::audiocom::sync::RemoteProjectSnapshot::~RemoteProjectSnapshot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadResponseData()

std::vector< uint8_t > audacity::cloud::audiocom::sync::anonymous_namespace{RemoteProjectSnapshot.cpp}::ReadResponseData ( audacity::network_manager::IResponse response)

Definition at line 426 of file RemoteProjectSnapshot.cpp.

427{
428 const auto size = response.getBytesAvailable();
429
430 if (size == 0)
431 return response.readAll<std::vector<uint8_t>>();
432
433 std::vector<uint8_t> data(size);
434 response.readData(data.data(), size);
435
436 return data;
437}
virtual uint64_t getBytesAvailable() const noexcept=0
virtual uint64_t readData(void *buffer, uint64_t maxBytesCount)=0

References audacity::network_manager::IResponse::getBytesAvailable(), audacity::network_manager::IResponse::readAll(), audacity::network_manager::IResponse::readData(), and size.

Referenced by audacity::cloud::audiocom::sync::RemoteProjectSnapshot::OnBlockDownloaded(), and audacity::cloud::audiocom::sync::RemoteProjectSnapshot::OnProjectBlobDownloaded().

Here is the call graph for this function:
Here is the caller graph for this function: