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