libosmscout 1.1.1
Loading...
Searching...
No Matches
osmscout::FileDownloader Class Reference

Downloads a file specified by URL. More...

#include <libosmscout-client-qt/include/osmscoutclientqt/FileDownloader.h>

Inheritance diagram for osmscout::FileDownloader:
Collaboration diagram for osmscout::FileDownloader:

Public Slots

void startDownload ()

Signals

void downloadedBytes (uint64_t sz)
void writtenBytes (uint64_t sz)
void finished (QString path)
void error (QString error_text, bool recoverable)

Public Member Functions

 FileDownloader (QNetworkAccessManager *manager, QString url, QString path, QObject *parent=nullptr)
 ~FileDownloader () override
 operator bool () const
QString getFileName () const
QString getFilePath () const
uint64_t getBytesDownloaded () const

Protected Slots

void onNetworkReadyRead ()
void onDownloaded ()
void onNetworkError (QNetworkReply::NetworkError code)
void onTimeout ()

Protected Member Functions

void onFinished ()
void onError (const QString &err)
bool restartDownload ()
 Restart download if download retries are not used up.

Detailed Description

Downloads a file specified by URL.

Downloads a file as specified by URL and stores in a given path. If the required directories do not exist, creates all parent directories as needed.

Constructor & Destructor Documentation

◆ FileDownloader()

osmscout::FileDownloader::FileDownloader ( QNetworkAccessManager * manager,
QString url,
QString path,
QObject * parent = nullptr )
explicit

◆ ~FileDownloader()

osmscout::FileDownloader::~FileDownloader ( )
override

Member Function Documentation

◆ downloadedBytes

void osmscout::FileDownloader::downloadedBytes ( uint64_t sz)
signal

◆ error

void osmscout::FileDownloader::error ( QString error_text,
bool recoverable )
signal

◆ finished

void osmscout::FileDownloader::finished ( QString path)
signal

◆ getBytesDownloaded()

uint64_t osmscout::FileDownloader::getBytesDownloaded ( ) const

◆ getFileName()

QString osmscout::FileDownloader::getFileName ( ) const
inline

◆ getFilePath()

QString osmscout::FileDownloader::getFilePath ( ) const
inline

◆ onDownloaded

void osmscout::FileDownloader::onDownloaded ( )
protectedslot

◆ onError()

void osmscout::FileDownloader::onError ( const QString & err)
protected

◆ onFinished()

void osmscout::FileDownloader::onFinished ( )
protected

◆ onNetworkError

void osmscout::FileDownloader::onNetworkError ( QNetworkReply::NetworkError code)
protectedslot

◆ onNetworkReadyRead

void osmscout::FileDownloader::onNetworkReadyRead ( )
protectedslot

◆ onTimeout

void osmscout::FileDownloader::onTimeout ( )
protectedslot

◆ operator bool()

osmscout::FileDownloader::operator bool ( ) const
inlineexplicit

◆ restartDownload()

bool osmscout::FileDownloader::restartDownload ( )
protected

Restart download if download retries are not used up.

◆ startDownload

void osmscout::FileDownloader::startDownload ( )
slot

◆ writtenBytes

void osmscout::FileDownloader::writtenBytes ( uint64_t sz)
signal

The documentation for this class was generated from the following file: