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));
59 #endif // QXMPPERROR_H std::optional< T > value() const
Definition: QXmppError.h:36
Definition: QXmppError.h:17
bool holdsType() const
Definition: QXmppError.h:31
std::any error
Definition: QXmppError.h:20
std::optional< T > takeValue()
Definition: QXmppError.h:46
QString description
Definition: QXmppError.h:19