summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-12-09 21:00:03 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-12-09 21:32:08 (GMT)
commitedabab9987aa7fd74f7db5dcfc77677472406180 (patch)
tree4512825cc540ea9412671f3bc8f970d90415568f /Swiften/Elements
parentf0fec4f31afcc91a55d72aad462a0cc571aacf5d (diff)
downloadswift-edabab9987aa7fd74f7db5dcfc77677472406180.zip
swift-edabab9987aa7fd74f7db5dcfc77677472406180.tar.bz2
Added Stream error parserialement.
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/StreamError.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/Swiften/Elements/StreamError.h b/Swiften/Elements/StreamError.h
new file mode 100644
index 0000000..a480d5a
--- /dev/null
+++ b/Swiften/Elements/StreamError.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <boost/shared_ptr.hpp>
+
+#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/String.h>
+
+namespace Swift {
+ class StreamError : public Element {
+ public:
+ typedef boost::shared_ptr<StreamError> ref;
+
+ enum Type {
+ BadFormat,
+ BadNamespacePrefix,
+ Conflict,
+ ConnectionTimeout,
+ HostGone,
+ HostUnknown,
+ ImproperAddressing,
+ InternalServerError,
+ InvalidFrom,
+ InvalidID,
+ InvalidNamespace,
+ InvalidXML,
+ NotAuthorized,
+ PolicyViolation,
+ RemoteConnectionFailed,
+ ResourceConstraint,
+ RestrictedXML,
+ SeeOtherHost,
+ SystemShutdown,
+ UndefinedCondition,
+ UnsupportedEncoding,
+ UnsupportedStanzaType,
+ UnsupportedVersion,
+ XMLNotWellFormed,
+ };
+
+ StreamError(Type type = UndefinedCondition, const String& text = String()) : type_(type), text_(text) { }
+
+ Type getType() const {
+ return type_;
+ }
+
+ void setType(Type type) {
+ type_ = type;
+ }
+
+ void setText(const String& text) {
+ text_ = text;
+ }
+
+ const String& getText() const {
+ return text_;
+ }
+
+ private:
+ Type type_;
+ String text_;
+ };
+}