1 /*
2 * Replacement fot QT Bindings that were removed from QT5
3 * Copyright (C) 2020 Pedro de Carvalho Gomes <pedrogomes81@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "CoreUrl.h"
20
21 using namespace QtBindings::Core;
22
Url()23 Url::Url()
24 {
25 }
26
Url(const QUrl & copy)27 Url::Url(const QUrl ©) : QUrl(copy)
28 {
29 }
30
Url(const Url & copy)31 Url::Url(const Url ©) : QObject(), QUrl(copy)
32 {
33 }
34
Url(const QString & url,QUrl::ParsingMode mode)35 Url::Url(const QString &url, QUrl::ParsingMode mode) : QUrl(url, mode)
36 {
37 }
38
Url(QUrl && other)39 Url::Url(QUrl &&other) : QUrl(other)
40 {
41 }
42
adjusted(QUrl::FormattingOptions options) const43 QUrl Url::adjusted(QUrl::FormattingOptions options) const
44 {
45 return QUrl::adjusted(options);
46 }
47
authority(QUrl::ComponentFormattingOptions options) const48 QString Url::authority(QUrl::ComponentFormattingOptions options) const
49 {
50 return QUrl::authority(options);
51 }
52
clear()53 void Url::clear()
54 {
55 QUrl::clear();
56 }
57
detach()58 void Url::detach()
59 {
60 QUrl::detach();
61 }
62
errorString() const63 QString Url::errorString() const
64 {
65 return QUrl::errorString();
66 }
67
fileName(QUrl::ComponentFormattingOptions options) const68 QString Url::fileName(QUrl::ComponentFormattingOptions options) const
69 {
70 return QUrl::fileName(options);
71 }
72
fragment(QUrl::ComponentFormattingOptions options) const73 QString Url::fragment(QUrl::ComponentFormattingOptions options) const
74 {
75 return QUrl::fragment(options);
76 }
77
hasFragment() const78 bool Url::hasFragment() const
79 {
80 return QUrl::hasFragment();
81 }
82
hasQuery() const83 bool Url::hasQuery() const
84 {
85 return QUrl::hasQuery();
86 }
87
host(QUrl::ComponentFormattingOptions options) const88 QString Url::host(QUrl::ComponentFormattingOptions options) const
89 {
90 return QUrl::host(options);
91 }
92
isDetached() const93 bool Url::isDetached() const
94 {
95 return QUrl::isDetached();
96 }
97
isEmpty() const98 bool Url::isEmpty() const
99 {
100 return QUrl::isEmpty();
101 }
102
isLocalFile() const103 bool Url::isLocalFile() const
104 {
105 return QUrl::isLocalFile();
106 }
107
isParentOf(const QUrl & url) const108 bool Url::isParentOf(const QUrl &url) const
109 {
110 return QUrl::isParentOf(url);
111 }
112
isRelative() const113 bool Url::isRelative() const
114 {
115 return QUrl::isRelative();
116 }
117
isValid() const118 bool Url::isValid() const
119 {
120 return QUrl::isValid();
121 }
122
matches(const QUrl & url,QUrl::FormattingOptions options) const123 bool Url::matches(const QUrl &url, QUrl::FormattingOptions options) const
124 {
125 return QUrl::matches(url, options);
126 }
127
password(QUrl::ComponentFormattingOptions options) const128 QString Url::password(QUrl::ComponentFormattingOptions options) const
129 {
130 return QUrl::password(options);
131 }
132
path(QUrl::ComponentFormattingOptions options) const133 QString Url::path(QUrl::ComponentFormattingOptions options) const
134 {
135 return QUrl::path(options);
136 }
137
port(int defaultPort) const138 int Url::port(int defaultPort) const
139 {
140 return QUrl::port(defaultPort);
141 }
142
query(QUrl::ComponentFormattingOptions options) const143 QString Url::query(QUrl::ComponentFormattingOptions options) const
144 {
145 return QUrl::query(options);
146 }
147
resolved(const QUrl & relative) const148 QUrl Url::resolved(const QUrl &relative) const
149 {
150 return QUrl::resolved(relative);
151 }
152
scheme() const153 QString Url::scheme() const
154 {
155 return QUrl::scheme();
156 }
157
setAuthority(const QString & authority,QUrl::ParsingMode mode)158 void Url::setAuthority(const QString &authority, QUrl::ParsingMode mode)
159 {
160 QUrl::setAuthority(authority, mode);
161 }
162
setFragment(const QString & fragment,QUrl::ParsingMode mode)163 void Url::setFragment(const QString &fragment, QUrl::ParsingMode mode)
164 {
165 QUrl::setFragment(fragment, mode);
166 }
167
setHost(const QString & host,QUrl::ParsingMode mode)168 void Url::setHost(const QString &host, QUrl::ParsingMode mode)
169 {
170 QUrl::setHost(host, mode);
171 }
172
setPassword(const QString & password,QUrl::ParsingMode mode)173 void Url::setPassword(const QString &password, QUrl::ParsingMode mode)
174 {
175 QUrl::setPassword(password, mode);
176 }
177
setPath(const QString & path,QUrl::ParsingMode mode)178 void Url::setPath(const QString &path, QUrl::ParsingMode mode)
179 {
180 QUrl::setPath(path, mode);
181 }
182
setPort(int port)183 void Url::setPort(int port)
184 {
185 QUrl::setPort(port);
186 }
187
setQuery(const QString & query,QUrl::ParsingMode mode)188 void Url::setQuery(const QString &query, QUrl::ParsingMode mode)
189 {
190 QUrl::setQuery(query, mode);
191 }
192
setQuery(const QUrlQuery & query)193 void Url::setQuery(const QUrlQuery &query)
194 {
195 QUrl::setQuery(query);
196 }
197
setScheme(const QString & scheme)198 void Url::setScheme(const QString &scheme)
199 {
200 QUrl::setScheme(scheme);
201 }
202
setUrl(const QString & url,QUrl::ParsingMode mode)203 void Url::setUrl(const QString &url, QUrl::ParsingMode mode)
204 {
205 QUrl::setUrl(url, mode);
206 }
207
setUserInfo(const QString & userInfo,QUrl::ParsingMode mode)208 void Url::setUserInfo(const QString &userInfo, QUrl::ParsingMode mode)
209 {
210 QUrl::setUserInfo(userInfo, mode);
211 }
212
setUserName(const QString & userName,QUrl::ParsingMode mode)213 void Url::setUserName(const QString &userName, QUrl::ParsingMode mode)
214 {
215 QUrl::setUserName(userName, mode);
216 }
217
swap(QUrl & other)218 void Url::swap(QUrl &other)
219 {
220 QUrl::swap(other);
221 }
222
toDisplayString(QUrl::FormattingOptions options) const223 QString Url::toDisplayString(QUrl::FormattingOptions options) const
224 {
225 return QUrl::toDisplayString(options);
226 }
227
toEncoded(QUrl::FormattingOptions options) const228 QByteArray Url::toEncoded(QUrl::FormattingOptions options) const
229 {
230 return QUrl::toEncoded(options);
231 }
232
toLocalFile() const233 QString Url::toLocalFile() const
234 {
235 return QUrl::toLocalFile();
236 }
237
topLevelDomain(QUrl::ComponentFormattingOptions options) const238 QString Url::topLevelDomain(QUrl::ComponentFormattingOptions options) const
239 {
240 return QUrl::topLevelDomain(options);
241 }
242
toString(QUrl::FormattingOptions options) const243 QString Url::toString(QUrl::FormattingOptions options) const
244 {
245 return QUrl::toString(options);
246 }
247
url(QUrl::FormattingOptions options) const248 QString Url::url(QUrl::FormattingOptions options) const
249 {
250 return QUrl::url(options);
251 }
252
userInfo(QUrl::ComponentFormattingOptions options) const253 QString Url::userInfo(QUrl::ComponentFormattingOptions options) const
254 {
255 return QUrl::userInfo(options);
256 }
257
userName(QUrl::ComponentFormattingOptions options) const258 QString Url::userName(QUrl::ComponentFormattingOptions options) const
259 {
260 return QUrl::userName(options);
261 }
262
fromAce(const QByteArray & domain)263 QString Url::fromAce(const QByteArray &domain)
264 {
265 return QUrl::fromAce(domain);
266 }
267
fromEncoded(const QByteArray & url,QUrl::ParsingMode mode)268 QUrl Url::fromEncoded(const QByteArray &url, QUrl::ParsingMode mode)
269 {
270 return QUrl::fromEncoded(url,mode);
271 }
272
fromLocalFile(const QString & localfile)273 QUrl Url::fromLocalFile(const QString &localfile)
274 {
275 return QUrl::fromLocalFile(localfile);
276 }
277
fromPercentEncoding(const QByteArray & input)278 QString Url::fromPercentEncoding(const QByteArray &input)
279 {
280 return QUrl::fromPercentEncoding(input);
281 }
282
fromStringList(const QStringList & uris,QUrl::ParsingMode mode)283 QList<QUrl> Url::fromStringList(const QStringList &uris, QUrl::ParsingMode mode)
284 {
285 return QUrl::fromStringList(uris,mode);
286 }
287
fromUserInput(const QString & userInput)288 QUrl Url::fromUserInput(const QString &userInput)
289 {
290 return QUrl::fromUserInput(userInput);
291 }
292
fromUserInput(const QString & userInput,const QString & workingDirectory,QUrl::UserInputResolutionOptions options)293 QUrl Url::fromUserInput(const QString &userInput, const QString &workingDirectory,
294 QUrl::UserInputResolutionOptions options)
295 {
296 return QUrl::fromUserInput(userInput,workingDirectory,options);
297 }
298
idnWhitelist()299 QStringList Url::idnWhitelist()
300 {
301 return QUrl::idnWhitelist();
302 }
303
setIdnWhitelist(const QStringList & list)304 void Url::setIdnWhitelist(const QStringList &list)
305 {
306 QUrl::setIdnWhitelist(list);
307 }
308
toAce(const QString & domain)309 QByteArray Url::toAce(const QString &domain)
310 {
311 return QUrl::toAce(domain);
312 }
313
toPercentEncoding(const QString & input,const QByteArray & exclude,const QByteArray & include)314 QByteArray Url::toPercentEncoding(const QString &input, const QByteArray &exclude,
315 const QByteArray &include)
316 {
317 return QUrl::toPercentEncoding(input,exclude,include);
318 }
319
toStringList(const QList<QUrl> & uris,QUrl::FormattingOptions options)320 QStringList Url::toStringList(const QList<QUrl> &uris, QUrl::FormattingOptions options)
321 {
322 return QUrl::toStringList(uris,options);
323 }
324
operator =(const Url & other)325 Url &Url::operator=(const Url &other)
326 {
327 if (this != &other)
328 QUrl::operator=(other);
329 return *this;
330 }
331