36 QList<QByteArray> list=
splitCSV(source);
37 foreach(QByteArray part, list)
43 int posi=part.indexOf(
'=');
46 name=part.left(posi).trimmed();
47 value=part.mid(posi+1).trimmed();
60 else if (name==
"Domain")
64 else if (name==
"Max-Age")
68 else if (name==
"Path")
72 else if (name==
"Secure")
76 else if (name==
"HttpOnly")
80 else if (name==
"Version")
85 if (this->name.isEmpty())
92 qWarning(
"HttpCookie::HttpCookie: Ignoring unknown %s=%s",name.data(),value.data());
100 QByteArray buffer(
name);
102 buffer.append(
value);
105 buffer.append(
"; Comment=");
110 buffer.append(
"; Domain=");
115 buffer.append(
"; Max-Age=");
116 buffer.append(QByteArray::number(
maxAge));
120 buffer.append(
"; Path=");
124 buffer.append(
"; Secure");
127 buffer.append(
"; HttpOnly");
129 buffer.append(
"; Version=");
130 buffer.append(QByteArray::number(
version));
222 QList<QByteArray> list;
224 for (
int i=0;
i<source.size(); ++
i)
235 QByteArray trimmed=buffer.trimmed();
236 if (!trimmed.isEmpty())
238 list.append(trimmed);
258 QByteArray trimmed=buffer.trimmed();
259 if (!trimmed.isEmpty())
261 list.append(trimmed);
void setDomain(const QByteArray domain)
QByteArray toByteArray() const
void setName(const QByteArray name)
void setPath(const QByteArray path)
QByteArray getComment() const
void setComment(const QByteArray comment)
void setSecure(const bool secure)
QByteArray getName() const
void setMaxAge(const int maxAge)
QByteArray getDomain() const
static QList< QByteArray > splitCSV(const QByteArray source)
QByteArray getValue() const
void setValue(const QByteArray value)
QByteArray getPath() const
void setHttpOnly(const bool httpOnly)