diff options
| author | Brian Potchik <brian@vector35.com> | 2018-08-10 13:58:07 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2018-08-10 13:58:07 -0400 |
| commit | 199092fb6960090d88c8fecba1a0dbe503a9f7e0 (patch) | |
| tree | e4431ce420679b186ff4eef2a72099b276cb4df3 /downloadprovider.cpp | |
| parent | 6ef32157e767aacd142012206bcf79c48266da2a (diff) | |
Finish DownloadProvider C++ API.
Diffstat (limited to 'downloadprovider.cpp')
| -rw-r--r-- | downloadprovider.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/downloadprovider.cpp b/downloadprovider.cpp index 436e2516..8e56bbf5 100644 --- a/downloadprovider.cpp +++ b/downloadprovider.cpp @@ -41,12 +41,15 @@ int DownloadInstance::PerformRequestCallback(void* ctxt, const char* url) } -string DownloadInstance::GetError() const +uint64_t DownloadInstance::WriteDataCallback(uint8_t* data, uint64_t len) { - char* str = BNGetErrorForDownloadInstance(m_object); - string result = str; - BNFreeString(str); - return result; + return BNWriteDataForDownloadInstance(m_object, data, len); +} + + +bool DownloadInstance::NotifyProgressCallback(uint64_t progress, uint64_t total) +{ + return BNNotifyProgressForDownloadInstance(m_object, progress, total); } @@ -56,6 +59,15 @@ void DownloadInstance::SetError(const string& error) } +string DownloadInstance::GetError() const +{ + char* str = BNGetErrorForDownloadInstance(m_object); + string result = str; + BNFreeString(str); + return result; +} + + int DownloadInstance::PerformRequest(const string& url, BNDownloadInstanceOutputCallbacks* callbacks) { return BNPerformDownloadRequest(m_object, url.c_str(), callbacks); |
