qTbot 0.89.ee6949a
qTbot is base back end library for your c++ Qt projects.
qTbot::iFile Class Referenceabstract

The iFile class This is main interface for all implementations of the files. More...

#include <ifile.h>

Public Types

enum  Type { Local , Ram }
 The Type enum is type of the file object. More...
 

Signals

void uploadProgressChanged ()
 Signal emitted when the upload progress changes.
 
void downloadProgressChanged ()
 Signal emitted when the download progress changes.
 
void errorChanged ()
 Signal emitted when the error code changes.
 
void replayChanged ()
 Signal emitted when the associated QNetworkReply changes.
 
void finishedChanged ()
 Signal emitted when the associated finished changes.
 

Public Member Functions

 iFile (const QSharedPointer< QNetworkReply > &replay)
 
float uploadProgress () const
 Get the current upload progress.
 
void setUploadProgress (float newUploadProgress)
 Set the upload progress.
 
float downloadProgress () const
 Get the current download progress.
 
void setDownloadProgress (float newDownloadProgress)
 Set the download progress.
 
int error () const
 Get the error code associated with this file.
 
void setError (int newError)
 Set the error code for this file.
 
const QSharedPointer< QNetworkReply > & replay () const
 Get the shared pointer to the associated QNetworkReply.
 
virtual Type type () const =0
 type This is type of the file object.
 
bool isFinished () const
 finished return true if the request was finished else false.
 
void setDownloadRequest (const QSharedPointer< QNetworkReply > &replay)
 setDownloadRequest This method sets replay for the file.
 

Protected Slots

virtual void handleReadReady ()=0
 Slot to handle when data is ready to be read.
 
virtual void handleFinished ()
 Slot to handle when the network operation is finished.
 
virtual void handleError (QNetworkReply::NetworkError error)
 Slot to handle errors in the network operation.
 

Protected Member Functions

void setFinished (bool newFinished)
 setFinished monual sets finished flag.
 

Friends

class ITelegramBot
 

Detailed Description

The iFile class This is main interface for all implementations of the files.

Definition at line 20 of file ifile.h.

Inheritance diagram for qTbot::iFile:
Inheritance graph
Collaboration diagram for qTbot::iFile:
Collaboration graph

Member Enumeration Documentation

◆ Type

The Type enum is type of the file object.

Enumerator
Local 

This is local file, all receive bytes will be save directed into file.

Ram 

This is memory saved file. All received bytes will be saved into QByteArray object.

Definition at line 28 of file ifile.h.

Constructor & Destructor Documentation

◆ iFile()

qTbot::iFile::iFile ( const QSharedPointer< QNetworkReply > &  replay)

Definition at line 12 of file ifile.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ downloadProgress()

float qTbot::iFile::downloadProgress ( ) const

Get the current download progress.

Returns
The current download progress as a floating-point value.

Definition at line 28 of file ifile.cpp.

◆ downloadProgressChanged

void qTbot::iFile::downloadProgressChanged ( )
signal

Signal emitted when the download progress changes.

Here is the caller graph for this function:

◆ error()

int qTbot::iFile::error ( ) const

Get the error code associated with this file.

Returns
The error code as an integer value.

Definition at line 40 of file ifile.cpp.

Here is the caller graph for this function:

◆ errorChanged

void qTbot::iFile::errorChanged ( )
signal

Signal emitted when the error code changes.

Here is the caller graph for this function:

◆ finishedChanged

void qTbot::iFile::finishedChanged ( )
signal

Signal emitted when the associated finished changes.

Here is the caller graph for this function:

◆ handleError

void qTbot::iFile::handleError ( QNetworkReply::NetworkError  error)
protectedvirtualslot

Slot to handle errors in the network operation.

Parameters
errorThis is error code.

Definition at line 59 of file ifile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleFinished

void qTbot::iFile::handleFinished ( )
protectedvirtualslot

Slot to handle when the network operation is finished.

Definition at line 122 of file ifile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleReadReady

virtual void qTbot::iFile::handleReadReady ( )
protectedpure virtualslot

Slot to handle when data is ready to be read.

Here is the caller graph for this function:

◆ isFinished()

bool qTbot::iFile::isFinished ( ) const

finished return true if the request was finished else false.

Returns
true if the request was finished else false

Definition at line 55 of file ifile.cpp.

◆ replay()

const QSharedPointer< QNetworkReply > & qTbot::iFile::replay ( ) const

Get the shared pointer to the associated QNetworkReply.

Returns
A shared pointer to the associated QNetworkReply.

Definition at line 51 of file ifile.cpp.

Here is the caller graph for this function:

◆ replayChanged

void qTbot::iFile::replayChanged ( )
signal

Signal emitted when the associated QNetworkReply changes.

◆ setDownloadProgress()

void qTbot::iFile::setDownloadProgress ( float  newDownloadProgress)

Set the download progress.

Parameters
newDownloadProgressThe new download progress value to set.

Definition at line 32 of file ifile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDownloadRequest()

void qTbot::iFile::setDownloadRequest ( const QSharedPointer< QNetworkReply > &  replay)

setDownloadRequest This method sets replay for the file.

Parameters
replayThis is pointer to the replay.

Definition at line 74 of file ifile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setError()

void qTbot::iFile::setError ( int  newError)

Set the error code for this file.

Parameters
newErrorThe new error code to set.

Definition at line 44 of file ifile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFinished()

void qTbot::iFile::setFinished ( bool  newFinished)
protected

setFinished monual sets finished flag.

Parameters
newFinishednew value for the finished flag.

Definition at line 114 of file ifile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUploadProgress()

void qTbot::iFile::setUploadProgress ( float  newUploadProgress)

Set the upload progress.

Parameters
newUploadProgressThe new upload progress value to set.

Definition at line 20 of file ifile.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

virtual Type qTbot::iFile::type ( ) const
pure virtual

type This is type of the file object.

Returns
type of the file object.

Implemented in qTbot::File, and qTbot::VirtualFile.

◆ uploadProgress()

float qTbot::iFile::uploadProgress ( ) const

Get the current upload progress.

Returns
The current upload progress as a floating-point value.

Definition at line 16 of file ifile.cpp.

◆ uploadProgressChanged

void qTbot::iFile::uploadProgressChanged ( )
signal

Signal emitted when the upload progress changes.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ITelegramBot

friend class ITelegramBot
friend

Definition at line 171 of file ifile.h.


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