diff options
| author | Josh Ferrell <josh@vector35.com> | 2025-08-27 21:02:59 -0400 |
|---|---|---|
| committer | Alexander Taylor <alex@vector35.com> | 2025-11-04 22:09:16 -0500 |
| commit | 5ab92a703fe01634e086cbf278dc8ca36c438a54 (patch) | |
| tree | 8d3e7341ffa1e896cb51afe075ba32ea0d330ec8 /collaboration.cpp | |
| parent | ae1dbe7e69e3a1d5cc69fa5362fba1b85ba5b6b8 (diff) | |
Add auto downloading of project file dependencies, clean up download APIs
Diffstat (limited to 'collaboration.cpp')
| -rw-r--r-- | collaboration.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/collaboration.cpp b/collaboration.cpp index d7d5d6e2..b0cb5421 100644 --- a/collaboration.cpp +++ b/collaboration.cpp @@ -1853,14 +1853,23 @@ void RemoteFile::DeleteSnapshot(const Ref<CollabSnapshot> snapshot) } -std::vector<uint8_t> RemoteFile::Download(ProgressFunction progress) +void RemoteFile::Download(ProgressFunction progress) +{ + ProgressContext pctxt; + pctxt.callback = progress; + if (!BNRemoteFileDownload(m_object, ProgressCallback, &pctxt)) + throw RemoteException("Failed to download file"); +} + + +std::vector<uint8_t> RemoteFile::DownloadContents(ProgressFunction progress) { ProgressContext pctxt; pctxt.callback = progress; size_t size = 0; uint8_t* data; - if (!BNRemoteFileDownload(m_object, ProgressCallback, &pctxt, &data, &size)) - throw SyncException("Failed to download file"); + if (!BNRemoteFileDownloadContents(m_object, ProgressCallback, &pctxt, &data, &size)) + throw SyncException("Failed to download file contents"); std::vector<uint8_t> out; out.insert(out.end(), &data[0], &data[size]); |
