init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
42
Telegram/lib_base/base/qthelp_url.h
Normal file
42
Telegram/lib_base/base/qthelp_url.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// This file is part of Desktop App Toolkit,
|
||||
// a set of libraries for developing nice desktop applications.
|
||||
//
|
||||
// For license and copyright information please follow this link:
|
||||
// https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QRegularExpression>
|
||||
|
||||
namespace qthelp {
|
||||
|
||||
const QRegularExpression &RegExpDomain();
|
||||
const QRegularExpression &RegExpDomainExplicit();
|
||||
QRegularExpression RegExpProtocol();
|
||||
|
||||
inline QString url_encode(const QString &part) {
|
||||
return QString::fromLatin1(QUrl::toPercentEncoding(part));
|
||||
}
|
||||
|
||||
inline QString url_decode(QString encoded) {
|
||||
return QUrl::fromPercentEncoding(encoded.replace('+', ' ').toUtf8());
|
||||
}
|
||||
|
||||
enum class UrlParamNameTransform {
|
||||
NoTransform,
|
||||
ToLower,
|
||||
};
|
||||
// Parses a string like "p1=v1&p2=v2&..&pn=vn" to a map.
|
||||
QMap<QString, QString> url_parse_params(
|
||||
const QString ¶ms,
|
||||
UrlParamNameTransform transform = UrlParamNameTransform::NoTransform);
|
||||
|
||||
QString url_append_query_or_hash(const QString &url, const QString &add);
|
||||
|
||||
bool is_ipv6(const QString &ip);
|
||||
|
||||
QString validate_url(const QString &value);
|
||||
|
||||
} // namespace qthelp
|
||||
Reference in New Issue
Block a user