RabbitCommon v2.2.6
Loading...
Searching...
No Matches
Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
RabbitCommon::CDownload Class Reference

Download the same file from multiple URLs. More...

#include <Download.h>

Inheritance diagram for RabbitCommon::CDownload:

Signals

void sigFinished (const QString szFile)
 
void sigError (int nErr, const QString szErr)
 
void sigDownloadProgress (qint64 bytesReceived, qint64 bytesTotal)
 

Public Member Functions

 CDownload (QObject *parent=nullptr)
 
int Start (QVector< QUrl > urls, QString szFileName=QString(), bool bSequence=false)
 

Private Slots

void slotReadyRead ()
 
void slotError (QNetworkReply::NetworkError e)
 
void slotSslError (const QList< QSslError > e)
 
void slotDownloadProgress (qint64 bytesReceived, qint64 bytesTotal)
 
void slotFinished ()
 

Private Member Functions

int DownloadFile (int nIndex, const QUrl &url, bool bRedirection=false)
 DownloadFile.
 
int CloseReply (QNetworkReply *pReply, bool bAbort=false)
 

Private Attributes

bool m_bSequence
 
QString m_szFileName
 
QVector< QUrl > m_Url
 
QVector< QSharedPointer< QFile > > m_DownloadFile
 
bool m_bDownload
 
QNetworkAccessManager m_NetManager
 
QMap< QNetworkReply *, int > m_Reply
 
qint64 m_nBytesReceived
 
QString m_szError
 

Detailed Description

Download the same file from multiple URLs.

Definition at line 44 of file Download.h.

Constructor & Destructor Documentation

◆ ~CDownload()

RabbitCommon::CDownload::~CDownload ( )

Definition at line 56 of file Download.cpp.

Member Function Documentation

◆ CloseReply()

int RabbitCommon::CDownload::CloseReply ( QNetworkReply *  pReply,
bool  bAbort = false 
)
private

Definition at line 422 of file Download.cpp.

◆ DownloadFile()

int RabbitCommon::CDownload::DownloadFile ( int  nIndex,
const QUrl &  url,
bool  bRedirection = false 
)
private

DownloadFile.

Parameters
nIndexurl index
urlDownload url
bRedirectiontrue: Is redirection
Returns

Definition at line 74 of file Download.cpp.

◆ sigFinished

void RabbitCommon::CDownload::sigFinished ( const QString  szFile)
signal
Parameters
szFilethe file of be download

◆ slotDownloadProgress

void RabbitCommon::CDownload::slotDownloadProgress ( qint64  bytesReceived,
qint64  bytesTotal 
)
privateslot

Definition at line 385 of file Download.cpp.

◆ slotError

void RabbitCommon::CDownload::slotError ( QNetworkReply::NetworkError  e)
privateslot

Definition at line 293 of file Download.cpp.

◆ slotFinished

void RabbitCommon::CDownload::slotFinished ( )
privateslot

Definition at line 242 of file Download.cpp.

◆ slotReadyRead

void RabbitCommon::CDownload::slotReadyRead ( )
privateslot

Definition at line 219 of file Download.cpp.

◆ slotSslError

void RabbitCommon::CDownload::slotSslError ( const QList< QSslError >  e)
privateslot

Definition at line 338 of file Download.cpp.

◆ Start()

int RabbitCommon::CDownload::Start ( QVector< QUrl >  urls,
QString  szFileName = QString(),
bool  bSequence = false 
)
Parameters
urls
szFileName
bSequenceWhether the requests are made in order. After the previous request fails, the latter one is requested. Returns if successful

Definition at line 19 of file Download.cpp.

Member Data Documentation

◆ m_bDownload

bool RabbitCommon::CDownload::m_bDownload
private

Definition at line 101 of file Download.h.

◆ m_bSequence

bool RabbitCommon::CDownload::m_bSequence
private

Definition at line 97 of file Download.h.

◆ m_DownloadFile

QVector<QSharedPointer<QFile> > RabbitCommon::CDownload::m_DownloadFile
private

Definition at line 100 of file Download.h.

◆ m_nBytesReceived

qint64 RabbitCommon::CDownload::m_nBytesReceived
private

Definition at line 104 of file Download.h.

◆ m_NetManager

QNetworkAccessManager RabbitCommon::CDownload::m_NetManager
private

Definition at line 102 of file Download.h.

◆ m_Reply

QMap<QNetworkReply*, int> RabbitCommon::CDownload::m_Reply
private

Definition at line 103 of file Download.h.

◆ m_szError

QString RabbitCommon::CDownload::m_szError
private

Definition at line 105 of file Download.h.

◆ m_szFileName

QString RabbitCommon::CDownload::m_szFileName
private

Definition at line 98 of file Download.h.

◆ m_Url

QVector<QUrl> RabbitCommon::CDownload::m_Url
private

Definition at line 99 of file Download.h.


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