8#include "QXmppGlobal.h"
32 return error.type().hash_code() ==
typeid(T).hash_code();
39 return std::any_cast<T>(
error);
40 }
catch (std::bad_any_cast) {
49 if (
error.type().hash_code() ==
typeid(T).hash_code()) {
50 auto value = std::any_cast<T>(std::move(
error));
Definition QXmppError.h:17
QString description
Definition QXmppError.h:18
bool isStanzaError() const
Definition QXmppError.cpp:92
bool isFileError() const
Definition QXmppError.cpp:76
std::optional< T > takeValue()
Definition QXmppError.h:45
static QXmppError fromFileDevice(const QFileDevice &file)
Constructs a QXmppError from a QFileDevice.
Definition QXmppError.cpp:68
static QXmppError fromIoDevice(const QIODevice &device)
Definition QXmppError.cpp:42
std::any error
Definition QXmppError.h:19
std::optional< T > value() const
Definition QXmppError.h:35
bool holdsType() const
Definition QXmppError.h:30
static QXmppError fromNetworkReply(const QNetworkReply &reply)
Constructs a QXmppError from a QNetworkReply.
Definition QXmppError.cpp:58
bool isNetworkError() const
Definition QXmppError.cpp:84