summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-09-17 10:16:22 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-09-17 10:16:22 (GMT)
commit49cf3d398309c933460e2be2de31c9b2217d9ab8 (patch)
treeda17d48cbd2d9e8d3a204cae87f255373f008998 /Swiften/Parser/XMPPParser.h
parent83d55c4e8ffdc5e0efb41a2b4f0cd76cc1e5d8d1 (diff)
downloadswift-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.h15
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_;
};