Cutelyst  2.13.0
Public Member Functions | Protected Member Functions | List of all members
Cutelyst::Upload Class Referencefinal

Cutelyst Upload handles file upload request More...

#include <Cutelyst/Upload>

Inheritance diagram for Cutelyst::Upload:
Inheritance graph
[legend]

Public Member Functions

 Upload (UploadPrivate *prv)
 
QString contentType () const
 
QTemporaryFile * createTemporaryFile (const QString &templateName=QString())
 
QString filename () const
 
Headers headers () const
 
QString name () const
 
virtual qint64 pos () const override
 
bool save (const QString &filename)
 
virtual bool seek (qint64 pos) override
 
virtual qint64 size () const override
 

Protected Member Functions

virtual qint64 readData (char *data, qint64 maxlen) override
 
virtual qint64 readLineData (char *data, qint64 maxlen) override
 
virtual qint64 writeData (const char *data, qint64 maxSize) override
 

Detailed Description

Definition at line 35 of file upload.h.

Constructor & Destructor Documentation

◆ Upload()

Upload::Upload ( UploadPrivate *  prv)

This class provides access to client upload requests

Definition at line 170 of file upload.cpp.

Member Function Documentation

◆ contentType()

QString Upload::contentType ( ) const

Returns the content type provided by the user agent

Definition at line 34 of file upload.cpp.

◆ createTemporaryFile()

QTemporaryFile * Upload::createTemporaryFile ( const QString &  templateName = QString())

This function creates a temporary file and fill it with the content of this upload. Returns zero if an error occours.

Definition at line 98 of file upload.cpp.

References seek().

◆ filename()

QString Upload::filename ( ) const

Returns the file name provided by the user agent

Definition at line 28 of file upload.cpp.

◆ headers()

Headers Upload::headers ( ) const

Returns the headers provided by the user agent

Definition at line 40 of file upload.cpp.

◆ name()

QString Upload::name ( ) const

Returns the name of the form field

Definition at line 200 of file upload.cpp.

◆ pos()

qint64 Upload::pos ( ) const
overridevirtual

Reimplemented from QIODevice::pos().

Definition at line 147 of file upload.cpp.

Referenced by seek().

◆ readData()

qint64 Upload::readData ( char *  data,
qint64  maxlen 
)
overrideprotectedvirtual

Reimplemented from QIODevice::readData().

Definition at line 206 of file upload.cpp.

References size().

◆ readLineData()

qint64 Upload::readLineData ( char *  data,
qint64  maxlen 
)
overrideprotectedvirtual

Reimplemented from QIODevice::readLineData().

Definition at line 219 of file upload.cpp.

References size().

◆ save()

bool Upload::save ( const QString &  filename)

Saves this upload to the following location.

Definition at line 46 of file upload.cpp.

References seek().

◆ seek()

bool Upload::seek ( qint64  pos)
overridevirtual

Reimplemented from QIODevice::seek().

Definition at line 159 of file upload.cpp.

References pos(), and size().

Referenced by createTemporaryFile(), and save().

◆ size()

qint64 Upload::size ( ) const
overridevirtual

Reimplemented from QIODevice::size().

Definition at line 153 of file upload.cpp.

Referenced by readData(), readLineData(), and seek().

◆ writeData()

qint64 Upload::writeData ( const char *  data,
qint64  maxSize 
)
overrideprotectedvirtual

Reimplemented from QIODevice::writeData().

Definition at line 232 of file upload.cpp.