All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
QGpGuiTools::HttpProxy Class Reference

Brief description of class still missing. More...

#include <HttpProxy.h>

List of all members.

Public Member Functions

 HttpProxy ()
 HttpProxy (QString url)
 HttpProxy (const QNetworkProxy &proxy)
 HttpProxy (const HttpProxy &o)
bool operator< (const HttpProxy &o) const
void operator= (const HttpProxy &o)
bool operator== (const HttpProxy &o) const
void printDebug (QTextStream &s) const
const QNetworkProxy & proxy () const
 ~HttpProxy ()

Detailed Description

Brief description of class still missing.

Avoids exposure of QtNetwork in header.


Constructor & Destructor Documentation

No proxy

References TRACE.

  {
    TRACE;
    _proxy=new QNetworkProxy(QNetworkProxy::NoProxy);
  }

Proxy defined by an url: [http://][username:password@]address:port

References proxy(), and TRACE.

  {
    TRACE;
    if(!url.startsWith("http://")) {
      url.prepend("http://");
    }
    QUrl proxy(url);
    _proxy=new QNetworkProxy;
    _proxy->setHostName(proxy.host());
    _proxy->setPort(proxy.port());
    _proxy->setUser(proxy.userName());
    _proxy->setPassword(proxy.password());
    _proxy->setType(QNetworkProxy::HttpProxy);
  }
QGpGuiTools::HttpProxy::HttpProxy ( const QNetworkProxy &  proxy)

Proxy defined by proxy

References TRACE.

  {
    TRACE;
    _proxy=new QNetworkProxy(proxy);
  }

Copy constructor.

References TRACE.

  {
    TRACE;
    _proxy=new QNetworkProxy(*o._proxy);
  }

Description of destructor still missing

References TRACE.

  {
    TRACE;
    delete _proxy;
  }

Member Function Documentation

bool QGpGuiTools::HttpProxy::operator< ( const HttpProxy o) const

Comparison operator

References TRACE.

  {
    TRACE;
    return compareProxies(*_proxy, *o._proxy)<0;
  }
void QGpGuiTools::HttpProxy::operator= ( const HttpProxy o)

Assignment operator

References TRACE.

  {
    TRACE;
    delete _proxy;
    _proxy=new QNetworkProxy(*o._proxy);
  }
bool QGpGuiTools::HttpProxy::operator== ( const HttpProxy o) const

Comparison operator

References TRACE.

  {
    TRACE;
    return *_proxy==*o._proxy;
  }
void QGpGuiTools::HttpProxy::printDebug ( QTextStream &  s) const

For debug, prints proxy data

References TRACE.

  {
    TRACE;
    switch(_proxy->type()) {
    case QNetworkProxy::NoProxy:
      s << "  Direct access\n";
      break;
    default:
      if(_proxy->user().isEmpty()) {
        s << "  " << _proxy->hostName()
          << ":" << _proxy->port()
          << "(type " << _proxy->type() << ")\n";
      } else {
        s << "  " << _proxy->user()
          << ":" << _proxy->password()
          << "@" << _proxy->hostName()
          << ":" << _proxy->port()
          << "(type " << _proxy->type() << ")\n";
      }
      break;
    }
  }
const QNetworkProxy & QGpGuiTools::HttpProxy::proxy ( ) const

Returns the proxy

References TRACE.

Referenced by HttpProxy().

  {
    TRACE;
    return *_proxy;
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines