KIOSlave
kcookiejar.cpp
Go to the documentation of this file.
63 #define IP_ADDRESS_EXPRESSION "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
105 "%:B%t%d%t%H:%M:%S%t%Y%t%Z", /* ANSI C's asctime() format (#145244): Jan 01 00:00:00 1970 GMT */
106 "%:B%t%d%t%Y%t%H:%M:%S%t%Z", /* A variation on the above format seen @ amazon.com: Jan 01 1970 00:00:00 GMT */
315 static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie& cookiePtr, bool nameMatchOnly=false, bool updateWindowId=false)
350 QString KCookieJar::findCookies(const QString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies)
1320 cookie.name().isEmpty() ? cookie.value().toLatin1().constData() : cookie.name().toLatin1().constData(),
1534 m_preferredPolicy = static_cast<KCookieDefaultPolicy>(dlgGroup.readEntry("PreferredPolicy", 0));
1541 m_globalAdvice = strToAdvice(policyGroup.readEntry("CookieGlobalAdvice", QString(QL1S("Accept"))));
1548 for (QStringList::ConstIterator it = domainSettings.constBegin(), itEnd = domainSettings.constEnd();
KHttpCookieList * getCookieList(const QString &_domain, const QString &_fqdn)
Get a list of all cookies in the cookie jar originating from _domain.
Definition: kcookiejar.cpp:1144
void clear()
KHttpCookieList makeDOMCookies(const QString &_url, const QByteArray &cookie_domstr, long windowId)
This function parses cookie_headers and returns a linked list of valid KHttpCookie objects for all co...
Definition: kcookiejar.cpp:863
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
bool match(const QString &fqdn, const QStringList &domainList, const QString &path, int port=-1) const
Definition: kcookiejar.cpp:238
void sync()
static QString extractHostAndPorts(const QString &str, QList< int > *ports=0)
Definition: kcookiejar.cpp:1363
iterator insert(const Key &key, const T &value)
void truncate(int position)
qint64 toMSecsSinceEpoch() const
void setDomainAdvice(const QString &_domain, KCookieAdvice _advice)
This function sets the advice for all cookies originating from _domain.
Definition: kcookiejar.cpp:1080
bool isValid() const
QString longDayName(int weekday)
static KCookieAdvice strToAdvice(const QString &_str)
Definition: kcookiejar.cpp:143
int toInt(bool *ok, int base) const
short toShort(bool *ok, int base) const
QByteArray trimmed() const
void push_back(const T &value)
Definition: kcookiejar.h:49
int length() const
static const char * parseNameValue(const char *header, QString &Name, QString &Value, bool keepQuotes=false, bool rfcQuotes=false)
Definition: kcookiejar.cpp:461
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
QString & prepend(QChar ch)
bool isExpired(qint64 currentDate=-1) const
If currentDate is -1, the default, then the current timestamp in UTC is used for comparison against t...
Definition: kcookiejar.cpp:196
void removeFirst()
Definition: kcookiejar.h:43
const T & at(int i) const
QString host() const
virtual bool open(OpenMode flags=QIODevice::ReadWrite)
bool contains(const QString &str, Qt::CaseSensitivity cs) const
static const char * parseField(char *&buffer, bool keepQuotes=false)
Definition: kcookiejar.cpp:1332
const char * name(StandardAction id)
static KDateTime fromString(const QString &string, TimeFormat format=ISODate, bool *negZero=0)
QDebug & nospace()
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
iterator erase(iterator pos)
KHttpCookie(const QString &_host=QString(), const QString &_domain=QString(), const QString &_path=QString(), const QString &_name=QString(), const QString &_value=QString(), qint64 _expireDate=0, int _protocolVersion=0, bool _secure=false, bool _httpOnly=false, bool _explicitPath=false)
Definition: kcookiejar.cpp:168
bool setPermissions(QFlags< QFile::Permission > permissions)
QString join(const QString &separator) const
int port() const
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void stripDomain(const QString &_fqdn, QString &_domain) const
Definition: kcookiejar.cpp:547
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
bool isNull() const
int indexOf(const T &value, int from) const
void clear()
QString number(int n, int base)
int count(const T &value) const
Definition: kcookiejar.h:45
void append(const T &value)
void addCookie(KHttpCookie &cookie)
This function hands a KHttpCookie object over to the cookie jar.
Definition: kcookiejar.cpp:934
void setGlobalAdvice(KCookieAdvice _advice)
This function sets the global advice for cookies.
Definition: kcookiejar.cpp:1126
void loadConfig(KConfig *_config, bool reparse=false)
Load the cookie configuration.
Definition: kcookiejar.cpp:1527
void eatCookie(KHttpCookieList::iterator cookieIterator)
Remove & delete a cookie from the jar.
Definition: kcookiejar.cpp:1161
QString protocol() const
int toInt(bool *ok, int base) const
bool isEmpty() const
bool isEmpty() const
int removeAll(const T &value)
QString trimmed() const
const char * constData() const
KDateTime toUtc() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
QDateTime dateTime() const
bool cookieIsPersistent(const KHttpCookie &cookie) const
This function tells whether a single KHttpCookie object should be considered persistent.
Definition: kcookiejar.cpp:1046
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
void remove()
T & first()
QString shortDayName(int weekday)
Definition: kcookiejar.h:113
QString path(AdjustPathOption trailing=LeaveTrailingSlash) const
QString fromPercentEncoding(const QByteArray &input)
bool saveCookies(const QString &_filename)
Store all the cookies in a safe(?) place.
Definition: kcookiejar.cpp:1267
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
iterator end()
QString toLower() const
const T value(const Key &key) const
QByteArray toLocal8Bit() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
QDebug & space()
bool finalize()
bool hasNext() const
bool contains(const T &value) const
KGuiItem ok()
bool contains(const T &value) const
const QStringList & getDomainList()
Get a list of all domains known to the cookie jar.
Definition: kcookiejar.cpp:1136
bool isValid() const
void extractDomains(const QString &_fqdn, QStringList &_domainList) const
Returns a list of domains in _domainList relevant for this host.
Definition: kcookiejar.cpp:594
QHash< QString, KHttpCookieList * > m_cookieDomains
Definition: kcookiejar.h:385
KCookieAdvice cookieAdvice(const KHttpCookie &cookie) const
This function advices whether a single KHttpCookie object should be added to the cookie jar...
Definition: kcookiejar.cpp:1010
bool isValid() const
QByteArray toLatin1() const
Definition: kcookiejar.h:44
QString mid(int position, int n) const
T take(const Key &key)
T & next()
unsigned int version()
int count() const
QString findCookies(const QString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies=0)
Looks for cookies in the cookie jar which are appropriate for _url.
Definition: kcookiejar.cpp:350
QString & sprintf(const char *cformat,...)
void reparseConfiguration()
T & last()
typedef ConstIterator
QSet< T > fromList(const QList< T > &list)
KCookieAdvice getDomainAdvice(const QString &_domain) const
This function gets the advice for all cookies originating from _domain.
Definition: kcookiejar.cpp:1063
bool loadCookies(const QString &_filename)
Load all the cookies from file and add them to the cookie jar.
Definition: kcookiejar.cpp:1390
int length() const
char * data()
QString left(int n) const
KHttpCookieList makeCookies(const QString &_url, const QByteArray &cookie_headers, long windowId)
This function parses cookie_headers and returns a linked list of valid KHttpCookie objects for all co...
Definition: kcookiejar.cpp:665
void eatCookiesForDomain(const QString &domain)
Remove & delete all cookies for domain.
Definition: kcookiejar.cpp:1181
Definition: kcookiejar.h:42
const_iterator constEnd() const
const_iterator constBegin() const
KCookieAdvice getUserSelectedAdvice() const
Definition: kcookiejar.h:107
int compare(const QString &other) const
static bool compareCookies(const KHttpCookie &item1, const KHttpCookie &item2)
Definition: kcookiejar.cpp:908
T readEntry(const QString &key, const T &aDefault) const
qlonglong toLongLong(bool *ok, int base) const
iterator begin()
QDateTime currentDateTimeUtc()
void eatSessionCookies(long windowId)
Removes all end of session cookies set by the session windId.
Definition: kcookiejar.cpp:1196
static bool parseUrl(const QString &_url, QString &_fqdn, QString &_path, int *port=0)
Parses _url and returns the FQDN (_fqdn) and path (_path).
Definition: kcookiejar.cpp:569
qint64 readLine(char *data, qint64 maxSize)
static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie &cookiePtr, bool nameMatchOnly=false, bool updateWindowId=false)
Definition: kcookiejar.cpp:315
QStringList list(const QString &fileClass)
static QString adviceToStr(KCookieAdvice _advice)
Definition: kcookiejar.cpp:131
Definition: kcookiejar.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.