aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-02-04 15:33:33 +0100
committerLinus Jahn <lnj@kaidan.im>2020-02-04 16:13:02 +0100
commit99c0df8616056318eb94539cfde497d3b10f3ae0 (patch)
tree60ffc4652a3b189c40decbc4e80d49ab5c16ff80 /src/base
parent79cdfa5c0e66edbc2b12033739e22d6dcc4fd045 (diff)
downloadqxmpp-99c0df8616056318eb94539cfde497d3b10f3ae0.tar.gz
Fix missing documentation for for QXmppStanza::Error
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppStanza.cpp45
-rw-r--r--src/base/QXmppStanza.h59
2 files changed, 70 insertions, 34 deletions
diff --git a/src/base/QXmppStanza.cpp b/src/base/QXmppStanza.cpp
index c4db071b..3148181e 100644
--- a/src/base/QXmppStanza.cpp
+++ b/src/base/QXmppStanza.cpp
@@ -56,14 +56,9 @@ QXmppExtendedAddress::QXmppExtendedAddress()
///
/// \param other
///
-QXmppExtendedAddress::QXmppExtendedAddress(const QXmppExtendedAddress &other)
- : d(other.d)
-{
-}
+QXmppExtendedAddress::QXmppExtendedAddress(const QXmppExtendedAddress &other) = default;
-QXmppExtendedAddress::~QXmppExtendedAddress()
-{
-}
+QXmppExtendedAddress::~QXmppExtendedAddress() = default;
/// Assigns the other address to this one.
///
@@ -185,13 +180,20 @@ QXmppStanzaErrorPrivate::QXmppStanzaErrorPrivate()
{
}
+///
+/// Default constructor
+///
QXmppStanza::Error::Error()
: d(new QXmppStanzaErrorPrivate)
{
}
+/// Copy constructor
QXmppStanza::Error::Error(const QXmppStanza::Error &) = default;
+///
+/// Initializes an error with a type, condition and text.
+///
QXmppStanza::Error::Error(Type type, Condition cond, const QString &text)
: d(new QXmppStanzaErrorPrivate)
{
@@ -200,6 +202,9 @@ QXmppStanza::Error::Error(Type type, Condition cond, const QString &text)
d->text = text;
}
+///
+/// Initializes an error with a type, condition and text (all from strings).
+///
QXmppStanza::Error::Error(const QString &type, const QString &cond,
const QString &text)
: d(new QXmppStanzaErrorPrivate)
@@ -209,45 +214,71 @@ QXmppStanza::Error::Error(const QString &type, const QString &cond,
setConditionFromStr(cond);
}
+/// Default destructor
QXmppStanza::Error::~Error() = default;
+/// Copy operator
QXmppStanza::Error &QXmppStanza::Error::operator=(const QXmppStanza::Error &) = default;
+///
+/// Returns the human-readable description of the error.
+///
QString QXmppStanza::Error::text() const
{
return d->text;
}
+///
+/// Sets the description of the error.
+///
void QXmppStanza::Error::setText(const QString &text)
{
d->text = text;
}
+///
+/// Returns the error code.
+///
int QXmppStanza::Error::code() const
{
return d->code;
}
+///
+/// Sets the error code.
+///
void QXmppStanza::Error::setCode(int code)
{
d->code = code;
}
+///
+/// Returns the error condition.
+///
QXmppStanza::Error::Condition QXmppStanza::Error::condition() const
{
return d->condition;
}
+///
+/// Sets the error condition.
+///
void QXmppStanza::Error::setCondition(QXmppStanza::Error::Condition cond)
{
d->condition = cond;
}
+///
+/// Returns the type of the error.
+///
QXmppStanza::Error::Type QXmppStanza::Error::type() const
{
return d->type;
}
+///
+/// Sets the type of the error.
+///
void QXmppStanza::Error::setType(QXmppStanza::Error::Type type)
{
d->type = type;
diff --git a/src/base/QXmppStanza.h b/src/base/QXmppStanza.h
index 9a1d0521..11db8f27 100644
--- a/src/base/QXmppStanza.h
+++ b/src/base/QXmppStanza.h
@@ -102,37 +102,42 @@ public:
class QXMPP_EXPORT Error
{
public:
+ /// The type represents the error type of stanza errors.
+ ///
+ /// The error descriptions are not detailed in here. The exact meaning
+ /// can be found in the particular protocols using them.
enum Type {
- Cancel,
- Continue,
- Modify,
- Auth,
- Wait
+ Cancel, ///< The error is not temporary.
+ Continue, ///< The error was only a warning.
+ Modify, ///< The request needs to be changed and resent.
+ Auth, ///< The request needs to be resent after authentication.
+ Wait ///< The error is temporary, you should wait and resend.
};
+ /// A detailed condition of the error
enum Condition {
- BadRequest,
- Conflict,
- FeatureNotImplemented,
- Forbidden,
- Gone,
- InternalServerError,
- ItemNotFound,
- JidMalformed,
- NotAcceptable,
- NotAllowed,
- NotAuthorized,
- PaymentRequired,
- RecipientUnavailable,
- Redirect,
- RegistrationRequired,
- RemoteServerNotFound,
- RemoteServerTimeout,
- ResourceConstraint,
- ServiceUnavailable,
- SubscriptionRequired,
- UndefinedCondition,
- UnexpectedRequest
+ BadRequest, ///< The request does not contain a valid schema.
+ Conflict, ///< The request conflicts with another.
+ FeatureNotImplemented, ///< The feature is not implemented.
+ Forbidden, ///< The requesting entity does not posses the necessary privileges to perform the request.
+ Gone, ///< The user or server can not be contacted at the address.
+ InternalServerError, ///< The server has expierienced an internal error and can not process the request.
+ ItemNotFound, ///< The requested item could not be found.
+ JidMalformed, ///< The given JID is not valid.
+ NotAcceptable, ///< The request does not meet the defined critera.
+ NotAllowed, ///< No entity is allowed to perform the request.
+ NotAuthorized, ///< The request should be resent after authentication.
+ PaymentRequired, ///< Payment is required to perform the request.
+ RecipientUnavailable, ///< The recipient is unavailable.
+ Redirect, ///< The requested resource is available elsewhere.
+ RegistrationRequired, ///< The requesting entity needs to register first.
+ RemoteServerNotFound, ///< The remote server could not be found.
+ RemoteServerTimeout, ///< The connection to the server could not be established or timed out.
+ ResourceConstraint, ///< The recipient lacks system resources to perform the request.
+ ServiceUnavailable, ///< The service is currently not available.
+ SubscriptionRequired, ///< The requester needs to subscribe first.
+ UndefinedCondition, ///< An undefined condition was hit.
+ UnexpectedRequest ///< The request was unexpected.
};
Error();