Albert
Loading...
Searching...
No Matches
networkutil.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Manuel Schneider
2
3#pragma once
4#include <albert/export.h>
5#include <memory>
6class QByteArray;
7class QNetworkAccessManager;
8class QNetworkReply;
9class QNetworkRequest;
10class QString;
11class QUrlQuery;
12
13namespace albert::util
14{
15
19ALBERT_EXPORT QNetworkAccessManager &network();
20
24ALBERT_EXPORT QNetworkReply *await(QNetworkReply *reply);
25
29ALBERT_EXPORT QString percentEncoded(const QString &string);
30
34ALBERT_EXPORT QString percentDecoded(const QString &string);
35
36}
37
38namespace albert::detail {
39
41class ALBERT_EXPORT RateLimiter
42{
43public:
44 RateLimiter(unsigned int ms);
46
49 const bool &debounce(const bool &valid);
50
51private:
52
53 class Private;
54 std::unique_ptr<Private> d;
55
56};
57
58}
Blocks execution.
Definition networkutil.h:42
RateLimiter(unsigned int ms)
const bool & debounce(const bool &valid)
Blocks until the next request is allowed.
Albert private namespace.
Definition albert.h:17
Albert utility namespace.
Definition albert.h:14
QString percentDecoded(const QString &string)
Returns string percent decoded.
QNetworkAccessManager & network()
Returns a global, threadlocal QNetworkAccessManager.
QString percentEncoded(const QString &string)
Returns string percent encoded.
QNetworkReply * await(QNetworkReply *reply)
Blocks until reply is finished.