Skip to content

Commit 3b0c89d

Browse files
committed
Add isCancelled method to Downloader
1 parent 336aaaf commit 3b0c89d

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/internal/downloader.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ void Downloader::wait()
3333
}
3434
}
3535

36+
bool Downloader::isCancelled() const
37+
{
38+
if (!m_asyncResponse)
39+
return false;
40+
41+
return m_asyncResponse->IsCancelled();
42+
}
43+
3644
const std::string &Downloader::text() const
3745
{
3846
return m_response.text;

src/internal/downloader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Downloader : public IDownloader
1919
void cancel() override;
2020
void wait() override;
2121

22+
bool isCancelled() const override;
2223
const std::string &text() const override;
2324

2425
private:

src/internal/idownloader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class IDownloader
1616
virtual void cancel() = 0;
1717
virtual void wait() = 0;
1818

19+
virtual bool isCancelled() const = 0;
1920
virtual const std::string &text() const = 0;
2021
};
2122

0 commit comments

Comments
 (0)