Cutelyst  2.14.2
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
 
QTemporaryFilecreateTemporaryFile (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
 
- Public Member Functions inherited from QIODevice
 QIODevice (QObject *parent)
 
void aboutToClose ()
 
virtual bool atEnd () const
 
virtual qint64 bytesAvailable () const
 
virtual qint64 bytesToWrite () const
 
void bytesWritten (qint64 bytes)
 
virtual bool canReadLine () const
 
virtual void close ()
 
QString errorString () const
 
bool getChar (char *c)
 
bool isOpen () const
 
bool isReadable () const
 
virtual bool isSequential () const
 
bool isTextModeEnabled () const
 
bool isWritable () const
 
virtual bool open (OpenMode mode)
 
OpenMode openMode () const
 
qint64 peek (char *data, qint64 maxSize)
 
QByteArray peek (qint64 maxSize)
 
bool putChar (char c)
 
qint64 read (char *data, qint64 maxSize)
 
QByteArray read (qint64 maxSize)
 
QByteArray readAll ()
 
void readChannelFinished ()
 
qint64 readLine (char *data, qint64 maxSize)
 
QByteArray readLine (qint64 maxSize)
 
void readyRead ()
 
virtual bool reset ()
 
void setTextModeEnabled (bool enabled)
 
void ungetChar (char c)
 
virtual bool waitForBytesWritten (int msecs)
 
virtual bool waitForReadyRead (int msecs)
 
qint64 write (const char *data, qint64 maxSize)
 
qint64 write (const QByteArray &byteArray)
 
qint64 write (const char *data)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectList & children () const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const
 
bool inherits (const char *className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType)
 
QThreadthread () const
 

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
 
- Protected Member Functions inherited from QIODevice
void setErrorString (const QString &str)
 
void setOpenMode (OpenMode openMode)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QIODevice
typedef OpenMode
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Definition at line 35 of file upload.h.

Constructor & Destructor Documentation

Upload::Upload ( UploadPrivate *  prv)

This class provides access to client upload requests

Definition at line 170 of file upload.cpp.

References QString::indexOf(), and QIODevice::open().

Member Function Documentation

QString Upload::contentType ( ) const

Returns the content type provided by the user agent

Definition at line 34 of file upload.cpp.

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 QIODevice::atEnd(), QIODevice::errorString(), QString::isEmpty(), QTemporaryFile::open(), QIODevice::read(), QFile::remove(), QFileDevice::seek(), seek(), QIODevice::setErrorString(), and QIODevice::write().

QString Upload::filename ( ) const

Returns the file name provided by the user agent

Definition at line 28 of file upload.cpp.

Headers Upload::headers ( ) const

Returns the headers provided by the user agent

Definition at line 40 of file upload.cpp.

QString Upload::name ( ) const

Returns the name of the form field

Definition at line 200 of file upload.cpp.

qint64 Upload::pos ( ) const
overridevirtual

Reimplemented from QIODevice::pos().

Reimplemented from QIODevice.

Definition at line 147 of file upload.cpp.

Referenced by seek().

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

Reimplemented from QIODevice::readData().

Implements QIODevice.

Definition at line 206 of file upload.cpp.

References size().

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

Reimplemented from QIODevice::readLineData().

Reimplemented from QIODevice.

Definition at line 219 of file upload.cpp.

References size().

bool Upload::save ( const QString filename)

Saves this upload to the following location.

Definition at line 46 of file upload.cpp.

References QString::arg(), QIODevice::atEnd(), QFileDevice::close(), QIODevice::errorString(), QIODevice::read(), seek(), and QIODevice::setErrorString().

bool Upload::seek ( qint64  pos)
overridevirtual

Reimplemented from QIODevice::seek().

Reimplemented from QIODevice.

Definition at line 159 of file upload.cpp.

References pos(), QIODevice::seek(), and size().

Referenced by createTemporaryFile(), and save().

qint64 Upload::size ( ) const
overridevirtual

Reimplemented from QIODevice::size().

Reimplemented from QIODevice.

Definition at line 153 of file upload.cpp.

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

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

Reimplemented from QIODevice::writeData().

Implements QIODevice.

Definition at line 232 of file upload.cpp.