summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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_;
+ };
+}