cutelyst 4.8.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Cutelyst::Upload Class Referencefinal

Cutelyst Upload handles file upload requests. More...

#include <Cutelyst/Upload>

Inheritance diagram for Cutelyst::Upload:

Public Member Functions

 Upload (UploadPrivate *prv)
 
virtual ~Upload () override
 
QByteArray contentType () const
 
std::unique_ptr< QTemporaryFile > createTemporaryFile (const QString &templateName={})
 
QString filename () const
 
Headers headers () const
 
QString name () const
 
qint64 pos () const override
 
bool save (const QString &filename)
 
bool seek (qint64 pos) override
 
qint64 size () const override
 

Protected Member Functions

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

Related Symbols

(Note that these are not member symbols.)

typedef QVector< Upload * > Uploads
 

Detailed Description

Cutelyst Upload handles file upload requests.

Definition at line 25 of file upload.h.

Constructor & Destructor Documentation

◆ Upload()

Upload::Upload ( UploadPrivate *  prv)

This class provides access to client upload requests

Definition at line 155 of file upload.cpp.

◆ ~Upload()

Upload::~Upload ( )
overridevirtual

Destroys the Upload object.

Definition at line 181 of file upload.cpp.

Member Function Documentation

◆ contentType()

QByteArray Upload::contentType ( ) const

Returns the content type provided by the user agent.

Definition at line 21 of file upload.cpp.

◆ createTemporaryFile()

std::unique_ptr< QTemporaryFile > Upload::createTemporaryFile ( const QString &  templateName = {})

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

Definition at line 83 of file upload.cpp.

References seek().

◆ filename()

QString Upload::filename ( ) const

Returns the file name provided by the user agent.

Definition at line 15 of file upload.cpp.

◆ headers()

Headers Upload::headers ( ) const

Returns the headers provided by the user agent.

Definition at line 27 of file upload.cpp.

◆ name()

QString Upload::name ( ) const

Returns the name of the form field.

Definition at line 186 of file upload.cpp.

◆ pos()

qint64 Upload::pos ( ) const
override

Reimplemented from QIODevice::pos().

Definition at line 132 of file upload.cpp.

Referenced by seek().

◆ readData()

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

Reimplemented from QIODevice::readData().

Definition at line 192 of file upload.cpp.

References size().

◆ readLineData()

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

Reimplemented from QIODevice::readLineData().

Definition at line 204 of file upload.cpp.

References size().

◆ save()

bool Upload::save ( const QString &  filename)

Saves this upload to the location defined by filename.

Definition at line 33 of file upload.cpp.

References seek().

◆ seek()

bool Upload::seek ( qint64  pos)
override

Reimplemented from QIODevice::seek().

Definition at line 144 of file upload.cpp.

References pos(), and size().

Referenced by createTemporaryFile(), and save().

◆ size()

qint64 Upload::size ( ) const
override

Reimplemented from QIODevice::size().

Definition at line 138 of file upload.cpp.

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

◆ writeData()

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

Reimplemented from QIODevice::writeData().

Definition at line 216 of file upload.cpp.

Friends And Related Symbol Documentation

◆ Uploads

typedef QVector<Upload *> Uploads
related

A vector of Upload pointers.

Definition at line 29 of file request.h.