diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-03-28 13:40:14 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-03-28 13:40:43 (GMT) |
commit | b61486fefe602e0d18fa5279021006f87b965307 (patch) | |
tree | 437585cbef1179e1ec31f79789591d5610200c29 /Swiften/Parser/PayloadParsers/ErrorParser.cpp | |
parent | dae28dd45e43fc6e6ef2ec4c6c65d5d736ed86f8 (diff) | |
download | swift-contrib-b61486fefe602e0d18fa5279021006f87b965307.zip swift-contrib-b61486fefe602e0d18fa5279021006f87b965307.tar.bz2 |
Moved Swiften to a separate module.
Diffstat (limited to 'Swiften/Parser/PayloadParsers/ErrorParser.cpp')
m--------- | Swiften | 0 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/ErrorParser.cpp | 109 |
2 files changed, 0 insertions, 109 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Parser/PayloadParsers/ErrorParser.cpp b/Swiften/Parser/PayloadParsers/ErrorParser.cpp deleted file mode 100644 index ae85265..0000000 --- a/Swiften/Parser/PayloadParsers/ErrorParser.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include "Swiften/Parser/PayloadParsers/ErrorParser.h" - -namespace Swift { - -ErrorParser::ErrorParser() : level_(TopLevel) { -} - -void ErrorParser::handleStartElement(const String&, const String&, const AttributeMap& attributes) { - if (level_ == TopLevel) { - String type = attributes.getAttribute("type"); - if (type == "continue") { - getPayloadInternal()->setType(ErrorPayload::Continue); - } - else if (type == "modify") { - getPayloadInternal()->setType(ErrorPayload::Modify); - } - else if (type == "auth") { - getPayloadInternal()->setType(ErrorPayload::Auth); - } - else if (type == "wait") { - getPayloadInternal()->setType(ErrorPayload::Wait); - } - else { - getPayloadInternal()->setType(ErrorPayload::Cancel); - } - } - ++level_; -} - -void ErrorParser::handleEndElement(const String& element, const String&) { - --level_; - if (level_ == PayloadLevel) { - if (element == "text") { - getPayloadInternal()->setText(currentText_); - } - else if (element == "bad-request") { - getPayloadInternal()->setCondition(ErrorPayload::BadRequest); - } - else if (element == "conflict") { - getPayloadInternal()->setCondition(ErrorPayload::Conflict); - } - else if (element == "feature-not-implemented") { - getPayloadInternal()->setCondition(ErrorPayload::FeatureNotImplemented); - } - else if (element == "forbidden") { - getPayloadInternal()->setCondition(ErrorPayload::Forbidden); - } - else if (element == "gone") { - getPayloadInternal()->setCondition(ErrorPayload::Gone); - } - else if (element == "internal-server-error") { - getPayloadInternal()->setCondition(ErrorPayload::InternalServerError); - } - else if (element == "item-not-found") { - getPayloadInternal()->setCondition(ErrorPayload::ItemNotFound); - } - else if (element == "jid-malformed") { - getPayloadInternal()->setCondition(ErrorPayload::JIDMalformed); - } - else if (element == "not-acceptable") { - getPayloadInternal()->setCondition(ErrorPayload::NotAcceptable); - } - else if (element == "not-allowed") { - getPayloadInternal()->setCondition(ErrorPayload::NotAllowed); - } - else if (element == "not-authorized") { - getPayloadInternal()->setCondition(ErrorPayload::NotAuthorized); - } - else if (element == "payment-required") { - getPayloadInternal()->setCondition(ErrorPayload::PaymentRequired); - } - else if (element == "recipient-unavailable") { - getPayloadInternal()->setCondition(ErrorPayload::RecipientUnavailable); - } - else if (element == "redirect") { - getPayloadInternal()->setCondition(ErrorPayload::Redirect); - } - else if (element == "registration-required") { - getPayloadInternal()->setCondition(ErrorPayload::RegistrationRequired); - } - else if (element == "remote-server-not-found") { - getPayloadInternal()->setCondition(ErrorPayload::RemoteServerNotFound); - } - else if (element == "remote-server-timeout") { - getPayloadInternal()->setCondition(ErrorPayload::RemoteServerTimeout); - } - else if (element == "resource-constraint") { - getPayloadInternal()->setCondition(ErrorPayload::ResourceConstraint); - } - else if (element == "service-unavailable") { - getPayloadInternal()->setCondition(ErrorPayload::ServiceUnavailable); - } - else if (element == "subscription-required") { - getPayloadInternal()->setCondition(ErrorPayload::SubscriptionRequired); - } - else if (element == "unexpected-request") { - getPayloadInternal()->setCondition(ErrorPayload::UnexpectedRequest); - } - else { - getPayloadInternal()->setCondition(ErrorPayload::UndefinedCondition); - } - } -} - -void ErrorParser::handleCharacterData(const String& data) { - currentText_ += data; -} - -} |