LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
urloperator.cpp
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#include "
urloperator.h
"
10
11
namespace
LC
12
{
13
namespace
Util
14
{
15
UrlOperator::UrlOperator
(QUrl& url)
16
: Url_ (url)
17
, Query_ (url)
18
{
19
}
20
21
UrlOperator::~UrlOperator
()
22
{
23
Flush
();
24
}
25
26
void
UrlOperator::Flush
()
27
{
28
Url_.setQuery (Query_);
29
}
30
31
UrlOperator
&
UrlOperator::operator()
(
const
QString& key,
const
QString& value)
32
{
33
Query_.addQueryItem (key, value);
34
return
*
this
;
35
}
36
37
UrlOperator
&
UrlOperator::operator()
(
const
QString& key,
const
QByteArray& value)
38
{
39
return
(*
this
) (key, QString::fromUtf8 (value));
40
}
41
42
UrlOperator
&
UrlOperator::operator()
(
const
QString& key,
const
char
*value)
43
{
44
return
(*
this
) (key, QString::fromLatin1 (value));
45
}
46
47
UrlOperator
&
UrlOperator::operator()
(
const
QString& key,
int
value)
48
{
49
return
(*
this
) (key, QString::number (value));
50
}
51
52
UrlOperator
&
UrlOperator::operator-=
(
const
QString& key)
53
{
54
Query_.removeQueryItem (key);
55
return
*
this
;
56
}
57
58
QUrl
UrlOperator::operator()
()
59
{
60
Flush
();
61
return
Url_;
62
}
63
}
64
}
LC::Util::UrlOperator::Flush
void Flush()
Flushes any pending changes to the QUrl query.
Definition
urloperator.cpp:26
LC::Util::UrlOperator::operator-=
UrlOperator & operator-=(const QString &key)
Returns the first query parameter under the key.
Definition
urloperator.cpp:52
LC::Util::UrlOperator::operator()
QUrl operator()()
Flushes any pending changes to the QUrl query.
Definition
urloperator.cpp:58
LC::Util::UrlOperator::UrlOperator
UrlOperator(QUrl &url)
Constructs the object modifying the query of url.
Definition
urloperator.cpp:15
LC::Util::UrlOperator::~UrlOperator
~UrlOperator()
Flushes any pending changes to the QUrl query and destroys the UrlOperator.
Definition
urloperator.cpp:21
LC::Util
Definition
icoreproxy.h:34
LC
Definition
constants.h:15
urloperator.h
src
util
sll
urloperator.cpp
Generated by
1.17.0