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

The TelegramSendFile class Base clas for upload files to server. More...

#include <telegramsendfile.h>

Public Member Functions

 TelegramSendFile (const QString &request, const QString &fileName, const QString &fileType, const QByteArray &data, const TelegramArgs &args, const QHash< QString, QSharedPointer< QJsonObject > > &extraObjects={})
 
 TelegramSendFile (const QString &request, const QFileInfo &file, const TelegramArgs &args, const QHash< QString, QSharedPointer< QJsonObject > > &extraObjects={})
 
RequestMethod method () const override
 method returns method of the request.
 
- Public Member Functions inherited from qTbot::TelegramSingleRquest
 TelegramSingleRquest (const QString &request, const QMap< QString, QVariant > &args)
 TelegramSingleRquest This main constructor of the single requests.
 
 TelegramSingleRquest (const QString &request)
 TelegramSingleRquest This main constructor of the single requests.
 
QString baseAddress () const override
 baseAddress This method return base domain of remote server.
 
RequestMethod method () const override
 method returns method of the request.
 
- Public Member Functions inherited from qTbot::iRequest
 iRequest ()
 
virtual QString makeUpload () const
 makeUpload This method prepare data to upload;
 
const QString & request () const
 request return current requests commnad.
 
void setRequest (const QString &newRequest)
 setRequest sets custom requests commnad
 
const QMap< QString, QVariant > & args () const
 args This method returns a current list of arguments
 
void addArg (const QString &key, const QVariant &val)
 addArg This method push new arg, to arguments list
 
void setArgs (const QMap< QString, QVariant > &newArgs)
 setArgs For the some requests list of arguments posible to build only after constructor.
 
QString argsToUrl () const
 argsToUrl This method converts the arguments to a URL string.
 
QSharedPointer< QHttpMultiPart > argsToMultipartFormData () const
 argsToMultipartFormData This method generates multipart/form-data request data.
 

Protected Member Functions

virtual QString type () const
 type return type file. By Default it is REQUEST_UPLOAD_FILE_KEY
 

Additional Inherited Members

- Public Types inherited from qTbot::iRequest
enum  RequestMethod { Get , Post , Upload }
 RequestMethod Tgis islist of supported requests types of the requests. More...
 

Detailed Description

The TelegramSendFile class Base clas for upload files to server.

Definition at line 23 of file telegramsendfile.h.

Inheritance diagram for qTbot::TelegramSendFile:
Inheritance graph
Collaboration diagram for qTbot::TelegramSendFile:
Collaboration graph

Constructor & Destructor Documentation

◆ TelegramSendFile() [1/2]

qTbot::TelegramSendFile::TelegramSendFile ( const QString &  request,
const QString &  fileName,
const QString &  fileType,
const QByteArray &  data,
const TelegramArgs args,
const QHash< QString, QSharedPointer< QJsonObject > > &  extraObjects = {} 
)

Definition at line 14 of file telegramsendfile.cpp.

Here is the call graph for this function:

◆ TelegramSendFile() [2/2]

qTbot::TelegramSendFile::TelegramSendFile ( const QString &  request,
const QFileInfo &  file,
const TelegramArgs args,
const QHash< QString, QSharedPointer< QJsonObject > > &  extraObjects = {} 
)

Definition at line 31 of file telegramsendfile.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ method()

iRequest::RequestMethod qTbot::TelegramSendFile::method ( ) const
overridevirtual

method returns method of the request.

Returns
method of the request

Implements qTbot::iRequest.

Definition at line 58 of file telegramsendfile.cpp.

◆ type()

QString qTbot::TelegramSendFile::type ( ) const
protectedvirtual

type return type file. By Default it is REQUEST_UPLOAD_FILE_KEY

Returns

Definition at line 62 of file telegramsendfile.cpp.


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