diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-09-17 10:16:22 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-09-17 10:16:22 (GMT) |
commit | 49cf3d398309c933460e2be2de31c9b2217d9ab8 (patch) | |
tree | da17d48cbd2d9e8d3a204cae87f255373f008998 /Swiften/Parser/XMPPParser.h | |
parent | 83d55c4e8ffdc5e0efb41a2b4f0cd76cc1e5d8d1 (diff) | |
download | swift-contrib-49cf3d398309c933460e2be2de31c9b2217d9ab8.zip swift-contrib-49cf3d398309c933460e2be2de31c9b2217d9ab8.tar.bz2 |
Cleaning up XMPP parser a bit.
Diffstat (limited to 'Swiften/Parser/XMPPParser.h')
-rw-r--r-- | Swiften/Parser/XMPPParser.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Swiften/Parser/XMPPParser.h b/Swiften/Parser/XMPPParser.h index 45d005c..c1a9323 100644 --- a/Swiften/Parser/XMPPParser.h +++ b/Swiften/Parser/XMPPParser.h @@ -37,21 +37,18 @@ namespace Swift { virtual void handleEndElement(const String& element, const String& ns); virtual void handleCharacterData(const String& data); - bool inStream() const { - return currentDepth_ > 0; - } - - bool inElement() const { - return currentDepth_ > 1; - } - ElementParser* createElementParser(const String& element, const String& xmlns); private: XMLParser* xmlParser_; XMPPParserClient* client_; PayloadParserFactoryCollection* payloadParserFactories_; - int currentDepth_; + enum Level { + TopLevel = 0, + StreamLevel = 1, + ElementLevel = 2 + }; + int level_; ElementParser* currentElementParser_; bool parseErrorOccurred_; }; |