summaryrefslogtreecommitdiff
path: root/collaboration.cpp
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2025-08-27 21:02:59 -0400
committerAlexander Taylor <alex@vector35.com>2025-11-04 22:09:16 -0500
commit5ab92a703fe01634e086cbf278dc8ca36c438a54 (patch)
tree8d3e7341ffa1e896cb51afe075ba32ea0d330ec8 /collaboration.cpp
parentae1dbe7e69e3a1d5cc69fa5362fba1b85ba5b6b8 (diff)
Add auto downloading of project file dependencies, clean up download APIs
Diffstat (limited to 'collaboration.cpp')
-rw-r--r--collaboration.cpp15
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]);