8#include "QXmppGlobal.h"
22 static QXmppError fromIoDevice(
const QIODevice &device);
23 static QXmppError fromNetworkReply(
const QNetworkReply &reply);
24 static QXmppError fromFileDevice(
const QFileDevice &file);
26 bool isFileError()
const;
27 bool isNetworkError()
const;
28 bool isStanzaError()
const;
33 return error.type().hash_code() ==
typeid(T).hash_code();
40 return std::any_cast<T>(error);
41 }
catch (std::bad_any_cast) {
50 if (error.type().hash_code() ==
typeid(T).hash_code()) {
51 auto value = std::any_cast<T>(std::move(error));
Definition QXmppError.h:18
std::any error
Definition QXmppError.h:20
QString description
Definition QXmppError.h:19
std::optional< T > takeValue()
Definition QXmppError.h:46
std::optional< T > value() const
Definition QXmppError.h:36
bool holdsType() const
Definition QXmppError.h:31