diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-22 16:46:37 (GMT) | 
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-22 16:54:51 (GMT) | 
| commit | 497dd9b099e5810057ebcd8a3f6755819cfecdef (patch) | |
| tree | a65ecc29c3f86d2ed6b6050d4650708abceafa3d /Swiften/Parser/AuthSuccessParser.cpp | |
| parent | d9ca66fa828e99ec5b4067d954c97d882b9ab8fe (diff) | |
| download | swift-contrib-497dd9b099e5810057ebcd8a3f6755819cfecdef.zip swift-contrib-497dd9b099e5810057ebcd8a3f6755819cfecdef.tar.bz2  | |
Added auth success value support.
Diffstat (limited to 'Swiften/Parser/AuthSuccessParser.cpp')
| -rw-r--r-- | Swiften/Parser/AuthSuccessParser.cpp | 24 | 
1 files changed, 24 insertions, 0 deletions
diff --git a/Swiften/Parser/AuthSuccessParser.cpp b/Swiften/Parser/AuthSuccessParser.cpp new file mode 100644 index 0000000..2dc2aa2 --- /dev/null +++ b/Swiften/Parser/AuthSuccessParser.cpp @@ -0,0 +1,24 @@ +#include "Swiften/Parser/AuthSuccessParser.h" +#include "Swiften/StringCodecs/Base64.h" + +namespace Swift { + +AuthSuccessParser::AuthSuccessParser() : GenericElementParser<AuthSuccess>(), depth(0) { +} + +void AuthSuccessParser::handleStartElement(const String&, const String&, const AttributeMap&) { +	++depth; +} + +void AuthSuccessParser::handleEndElement(const String&, const String&) { +	--depth; +	if (depth == 0) { +		getElementGeneric()->setValue(Base64::decode(text)); +	} +} + +void AuthSuccessParser::handleCharacterData(const String& text) { +	this->text += text; +} + +}  | 
 Swift