tufao  1.3.0
An asynchronous web framework for C++ built on top of Qt
Tufao Namespace Reference

This is the namespace where all Tufão facilities are grouped. More...

Classes

class  AbstractHttpServerRequestHandler
 This class provides an interface for HttpServerRequest handlers. More...
 
class  AbstractHttpUpgradeHandler
 This class provides an interface for HTTP Upgrade handlers. More...
 
class  AbstractMessageSocket
 The Tufao::AbstractMessageSocket class represents a socket that sends and receives messages. More...
 
class  ClassHandler
 The ClassHandler class Define the interface to implement when creating a plugin. More...
 
class  ClassHandlerManager
 This class serves as the HttpServerRequestHandler for all ClassHandler plugins. More...
 
struct  ClassHandlerPluginInfo
 
struct  Headers
 This class provides a representation of HTTP headers. More...
 
class  HttpFileServer
 You can use this class to serve static files under Tufão. More...
 
class  HttpPluginServer
 This class provides a plugin-based request handler. More...
 
class  HttpServer
 The Tufao::HttpServer class provides an implementation of the HTTP protocol. More...
 
class  HttpServerPlugin
 This class provides a factory interface to create request handlers and comunicate with factories of other plugins. More...
 
class  HttpServerRequest
 The Tufao::HttpServer represents a HTTP request received by Tufao::HttpServer. More...
 
class  HttpServerRequestRouter
 This class provides a robust and high performance HTTP request router. More...
 
class  HttpServerResponse
 The Tufao::HttpServerResponse is used to respond to a Tufao::HttpServerRequest. More...
 
class  HttpsServer
 Tufao::HttpsServer is a subclass of Tufao::HttpServer that provides secure communication with the client. More...
 
class  HttpUpgradeRouter
 This class provides a robust and high performance HTTP request router. More...
 
class  IByteArray
 This class provides a case insensitive QByteArray. More...
 
class  NotFoundHandler
 A handler that responds with "Not found" to every request. More...
 
class  Session
 This class provides easier access to the session's properties. More...
 
struct  SessionSettings
 The SessionSettings class exposes details that sessions use to handle cookies. More...
 
class  SessionStore
 SessionStore class can be used to store data that must persist among different requests. More...
 
class  SimpleSessionStore
 SimpleSessionStore implements a simple storage mechanism to SessionStore. More...
 
class  UrlRewriterHandler
 This class provides a handler to internally (only seen by your application) rewrite the URL. More...
 
class  WebSocket
 This class represents a WebSocket connection. More...
 

Enumerations

enum  HttpVersion { HTTP_1_0, HTTP_1_1 }
 
enum  HttpResponseStatus {
  CONTINUE = 100, SWITCHING_PROTOCOLS = 101, PROCESSING = 102, CHECKPOINT = 103,
  OK = 200, CREATED = 201, ACCEPTED = 202, NON_AUTHORITATIVE_INFORMATION = 203,
  NO_CONTENT = 204, RESET_CONTENT = 205, PARTIAL_CONTENT = 206, MULTI_STATUS = 207,
  ALREADY_REPORTED = 208, IM_USED = 226, MULTIPLE_CHOICES = 300, MOVED_PERMANENTLY = 301,
  FOUND = 302, SEE_OTHER = 303, NOT_MODIFIED = 304, USE_PROXY = 305,
  SWITCH_PROXY = 306, TEMPORARY_REDIRECT = 307, RESUME_INCOMPLETE = 308, BAD_REQUEST = 400,
  UNAUTHORIZED = 401, PAYMENT_REQUIRED = 402, FORBIDDEN = 403, NOT_FOUND = 404,
  METHOD_NOT_ALLOWED = 405, NOT_ACCEPTABLE = 406, PROXY_AUTHENTICATION_REQUIRED = 407, REQUEST_TIMEOUT = 408,
  CONFLICT = 409, GONE = 410, LENGTH_REQUIRED = 411, PRECONDITION_FAILED = 412,
  REQUEST_ENTITY_TOO_LARGE = 413, REQUEST_URI_TOO_LONG = 414, UNSUPPORTED_MEDIA_TYPE = 415, REQUESTED_RANGE_NOT_SATISFIABLE = 416,
  EXPECTATION_FAILED = 417, I_AM_A_TEAPOT = 418, UNPROCESSABLE_ENTITY = 422, LOCKED = 423,
  FAILED_DEPENDENCY = 424, UNORDERED_COLLECTION = 425, UPGRADE_REQUIRED = 426, PRECONDITION_REQUIRED = 428,
  TOO_MANY_REQUESTS = 429, REQUEST_HEADER_FIELDS_TOO_LARGE = 431, NO_RESPONSE = 444, RETRY_WITH = 449,
  CLIENT_CLOSED_REQUEST = 499, INTERNAL_SERVER_ERROR = 500, NOT_IMPLEMENTED = 501, BAD_GATEWAY = 502,
  SERVICE_UNAVAILABLE = 503, GATEWAY_TIMEOUT = 504, HTTP_VERSION_NOT_SUPPORTED = 505, VARIANT_ALSO_NEGOTIATES = 506,
  INSUFFICIENT_STORAGE = 507, LOOP_DETECTED = 508, BANDWIDTH_LIMIT_EXCEEDED = 509, NOT_EXTENDED = 510
}
 The values in this enum represents a HTTP status code. More...
 
enum  WebSocketError {
  WebSocketError::NO_ERROR = 0, WebSocketError::CONNECTION_REFUSED, WebSocketError::REMOTE_HOST_CLOSED, WebSocketError::HOST_NOT_FOUND,
  WebSocketError::ACCESS_ERROR, WebSocketError::OUT_OF_RESOURCES, WebSocketError::SOCKET_TIMEOUT, WebSocketError::NETWORK_ERROR,
  WebSocketError::UNSUPPORTED_SOCKET_OPERATION, WebSocketError::PROXY_AUTHENTICATION_REQUIRED, WebSocketError::SSL_HANDSHAKE_FAILED, WebSocketError::PROXY_CONNECTION_REFUSED,
  WebSocketError::PROXY_CONNECTION_CLOSED, WebSocketError::PROXY_CONNECTION_TIMEOUT, WebSocketError::PROXY_NOT_FOUND, WebSocketError::PROXY_PROTOCOL_ERROR,
  WebSocketError::WEBSOCKET_HANDSHAKE_FAILED, WebSocketError::WEBSOCKET_PROTOCOL_ERROR, WebSocketError::UNKNOWN_ERROR
}
 This enum describes the possible erros tha can occur. More...
 
enum  WebSocketMessageType { WebSocketMessageType::TEXT_MESSAGE, WebSocketMessageType::BINARY_MESSAGE }
 This enum represents the possible message's types that WebSocket supports. More...
 

Functions

TUFAO_EXPORT QDebug operator<< (QDebug dbg, const Headers &headers)
 
HttpServerResponseoperator<< (HttpServerResponse &response, const QByteArray &chunk)
 This overload allows you to use a HttpServerResponse object as a stream. More...
 
bool operator!= (const IByteArray &lhs, const IByteArray &rhs)
 
bool operator< (const IByteArray &lhs, const IByteArray &rhs)
 
bool operator<= (const IByteArray &lhs, const IByteArray &rhs)
 
bool operator== (const IByteArray &lhs, const IByteArray &rhs)
 
bool operator> (const IByteArray &lhs, const IByteArray &rhs)
 
bool operator>= (const IByteArray &lhs, const IByteArray &rhs)
 
uint qHash (const IByteArray &key)
 

Detailed Description

This is the namespace where all Tufão facilities are grouped.

It's purpose is isolate its symbols from symbols of other packages, avoiding collision problems.

Enumeration Type Documentation

The values in this enum represents a HTTP status code.

These are sent in the first line of a HTTP response message. You should consult external doc (rfc 2616) to know when to use each value. The HTTP status code most used is OK.

You can use the values in this enum in Tufao::HttpServerResponse::writeHead(int).

Since
1.0
enum Tufao::WebSocketError
strong

This enum describes the possible erros tha can occur.

Note
Avoid to directly test against NO_ERROR, because Windows API defines the NO_ERROR macro and your code might fail to build under this plataform. You can safely make a test using code like the following:
if (int(ws.error()))
/* ... */;
Since
1.0
Enumerator
NO_ERROR 

No error.

CONNECTION_REFUSED 

See QAbstractSocket::ConnectionRefusedError.

It can happen during the opening handshake (only when acting as client).

REMOTE_HOST_CLOSED 

See QAbstractSocket::RemoteHostClosedError.

It can happen during the opening handshake (only when acting as client).

HOST_NOT_FOUND 

See QAbstractSocket::HostNotFoundError.

It can happen during the opening handshake (only when acting as client).

ACCESS_ERROR 

See QAbstractSocket::SocketAccessError.

It can happen during the opening handshake (only when acting as client).

OUT_OF_RESOURCES 

See QAbstractSocket::SocketResourceError.

It can happen during the opening handshake (only when acting as client).

SOCKET_TIMEOUT 

See QAbstractSocket::SocketTimeoutError.

It can happen during the opening handshake (only when acting as client).

NETWORK_ERROR 

See QAbstractSocket::NetworkError.

It can happen during the opening handshake (only when acting as client).

UNSUPPORTED_SOCKET_OPERATION 

See QAbstractSocket::UnsupportedSocketOperationError.

It can happen during the opening handshake (only when acting as client).

PROXY_AUTHENTICATION_REQUIRED 

See QAbstractSocket::ProxyAuthenticationRequiredError.

It can happen during the opening handshake (only when acting as client).

SSL_HANDSHAKE_FAILED 

See QAbstractSocket::SslHandshakeFailedError.

It can happen during the opening handshake (only when acting as client).

PROXY_CONNECTION_REFUSED 

See QAbstractSocket::ProxyConnectionRefusedError.

It can happen during the opening handshake (only when acting as client).

PROXY_CONNECTION_CLOSED 

See QAbstractSocket::ProxyConnectionClosedError.

It can happen during the opening handshake (only when acting as client).

PROXY_CONNECTION_TIMEOUT 

See QAbstractSocket::ProxyConnectionTimeoutError.

It can happen during the opening handshake (only when acting as client).

PROXY_NOT_FOUND 

See QAbstractSocket::ProxyNotFoundError.

It can happen during the opening handshake (only when acting as client).

PROXY_PROTOCOL_ERROR 

See QAbstractSocket::ProxyProtocolError.

It can happen during the opening handshake (only when acting as client).

WEBSOCKET_HANDSHAKE_FAILED 

It occurs when the server doesn't support WebSocket for the resource asked for (or for any resource at all).

It can happen during the opening handshake (only when acting as client).

WEBSOCKET_PROTOCOL_ERROR 

It occurs when the remote peer (or an intermediary) violates the WebSocket protocol.

UNKNOWN_ERROR 

Uknown error.

You found the chaos.

This enum represents the possible message's types that WebSocket supports.

Since
1.0
Enumerator
TEXT_MESSAGE 

UTF8 messages.

BINARY_MESSAGE 

Binary messages.

Function Documentation

HttpServerResponse& Tufao::operator<< ( HttpServerResponse response,
const QByteArray &  chunk 
)
inline

This overload allows you to use a HttpServerResponse object as a stream.

Note
You still need to call HttpServerResponse::end when done with the connection and HttpServerResponse::writeHead before use this operator.
Since
1.0