Stellarium 0.15.2
|
HTTP cookie as defined in RFC 2109. More...
#include <httpcookie.h>
Public Member Functions | |
HttpCookie () | |
Creates an empty cookie. More... | |
HttpCookie (const QByteArray name, const QByteArray value, const int maxAge, const QByteArray path="/", const QByteArray comment=QByteArray(), const QByteArray domain=QByteArray(), const bool secure=false) | |
Create a cookie and set name/value pair. More... | |
HttpCookie (const QByteArray source) | |
Create a cookie from a string. More... | |
QByteArray | toByteArray () const |
Convert this cookie to a string that may be used in a Set-Cookie header. More... | |
void | setName (const QByteArray name) |
Set the name of this cookie. More... | |
void | setValue (const QByteArray value) |
Set the value of this cookie. More... | |
void | setComment (const QByteArray comment) |
Set the comment of this cookie. More... | |
void | setDomain (const QByteArray domain) |
Set the domain of this cookie. More... | |
void | setMaxAge (const int maxAge) |
Set the maximum age of this cookie in seconds. More... | |
void | setPath (const QByteArray path) |
Set the path for that the cookie will be sent, default="/" which means the whole domain. More... | |
void | setSecure (const bool secure) |
Set secure mode, so that the cookie will only be sent on secure connections. More... | |
QByteArray | getName () const |
Get the name of this cookie. More... | |
QByteArray | getValue () const |
Get the value of this cookie. More... | |
QByteArray | getComment () const |
Get the comment of this cookie. More... | |
QByteArray | getDomain () const |
Get the domain of this cookie. More... | |
int | getMaxAge () const |
Set the maximum age of this cookie in seconds. More... | |
QByteArray | getPath () const |
Set the path of this cookie. More... | |
bool | getSecure () const |
Get the secure flag of this cookie. More... | |
int | getVersion () const |
Returns always 1. More... | |
Static Public Member Functions | |
static QList< QByteArray > | splitCSV (const QByteArray source) |
Split a string list into parts, where each part is delimited by semicolon. More... | |
HTTP cookie as defined in RFC 2109.
This class can also parse RFC 2965 cookies, but skips fields that are not defined in RFC 2109.
Definition at line 20 of file httpcookie.h.
HttpCookie::HttpCookie | ( | ) |
Creates an empty cookie.
HttpCookie::HttpCookie | ( | const QByteArray | name, |
const QByteArray | value, | ||
const int | maxAge, | ||
const QByteArray | path = "/" , |
||
const QByteArray | comment = QByteArray() , |
||
const QByteArray | domain = QByteArray() , |
||
const bool | secure = false |
||
) |
Create a cookie and set name/value pair.
name | name of the cookie |
value | value of the cookie |
maxAge | maximum age of the cookie in seconds. 0=discard immediately |
path | Path for that the cookie will be sent, default="/" which means the whole domain |
comment | Optional comment, may be displayed by the web browser somewhere |
domain | Optional domain for that the cookie will be sent. Defaults to the current domain |
secure | If true, the cookie will only be sent on secure connections |
HttpCookie::HttpCookie | ( | const QByteArray | source | ) |
Create a cookie from a string.
source | String as received in a HTTP Cookie2 header. |
QByteArray HttpCookie::getComment | ( | ) | const |
Get the comment of this cookie.
QByteArray HttpCookie::getDomain | ( | ) | const |
Get the domain of this cookie.
int HttpCookie::getMaxAge | ( | ) | const |
Set the maximum age of this cookie in seconds.
QByteArray HttpCookie::getName | ( | ) | const |
Get the name of this cookie.
QByteArray HttpCookie::getPath | ( | ) | const |
Set the path of this cookie.
bool HttpCookie::getSecure | ( | ) | const |
Get the secure flag of this cookie.
QByteArray HttpCookie::getValue | ( | ) | const |
Get the value of this cookie.
int HttpCookie::getVersion | ( | ) | const |
Returns always 1.
void HttpCookie::setComment | ( | const QByteArray | comment | ) |
Set the comment of this cookie.
void HttpCookie::setDomain | ( | const QByteArray | domain | ) |
Set the domain of this cookie.
void HttpCookie::setMaxAge | ( | const int | maxAge | ) |
Set the maximum age of this cookie in seconds.
0=discard immediately
void HttpCookie::setName | ( | const QByteArray | name | ) |
Set the name of this cookie.
void HttpCookie::setPath | ( | const QByteArray | path | ) |
Set the path for that the cookie will be sent, default="/" which means the whole domain.
void HttpCookie::setSecure | ( | const bool | secure | ) |
Set secure mode, so that the cookie will only be sent on secure connections.
void HttpCookie::setValue | ( | const QByteArray | value | ) |
Set the value of this cookie.
|
static |
Split a string list into parts, where each part is delimited by semicolon.
Semicolons within double quotes are skipped. Double quotes are removed.
QByteArray HttpCookie::toByteArray | ( | ) | const |
Convert this cookie to a string that may be used in a Set-Cookie header.