8#include "QXmppGlobal.h"
21 static QXmppError fromIoDevice(
const QIODevice &device);
22 static QXmppError fromNetworkReply(
const QNetworkReply &reply);
23 static QXmppError fromFileDevice(
const QFileDevice &file);
25 bool isFileError()
const;
26 bool isNetworkError()
const;
27 bool isStanzaError()
const;
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
std::any error
Definition: QXmppError.h:19
QString description
Definition: QXmppError.h:18
std::optional< T > takeValue()
Definition: QXmppError.h:45
std::optional< T > value() const
Definition: QXmppError.h:35
bool holdsType() const
Definition: QXmppError.h:30