Qt 4.8
Public Functions | List of all members
QNetworkAccessHttpBackendFactory Class Reference

#include <qnetworkaccesshttpbackend_p.h>

Inheritance diagram for QNetworkAccessHttpBackendFactory:
QNetworkAccessBackendFactory

Public Functions

virtual QNetworkAccessBackendcreate (QNetworkAccessManager::Operation op, const QNetworkRequest &request) const
 
- Public Functions inherited from QNetworkAccessBackendFactory
 QNetworkAccessBackendFactory ()
 
virtual ~QNetworkAccessBackendFactory ()
 

Detailed Description

Definition at line 162 of file qnetworkaccesshttpbackend_p.h.

Functions

◆ create()

QNetworkAccessBackend * QNetworkAccessHttpBackendFactory::create ( QNetworkAccessManager::Operation  op,
const QNetworkRequest request 
) const
virtual

Implements QNetworkAccessBackendFactory.

Definition at line 167 of file qnetworkaccesshttpbackend.cpp.

169 {
170  // check the operation
171  switch (op) {
178  break;
179 
180  default:
181  // no, we can't handle this request
182  return 0;
183  }
184 
185  QUrl url = request.url();
186  QString scheme = url.scheme().toLower();
187  if (scheme == QLatin1String("http") || scheme == QLatin1String("https"))
188  return new QNetworkAccessHttpBackend;
189 
190  return 0;
191 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
QUrl url() const
Returns the URL this network request is referring to.
QString scheme() const
Returns the scheme of the URL.
Definition: qurl.cpp:4550
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
Definition: qstring.cpp:5389

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