summaryrefslogtreecommitdiffstats
blob: 77e5c2cb95c76f997b578bbc6b8387500afa3b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * Copyright (c) 2012 Mateusz Piękos
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#include <Swiften/Parser/PayloadParsers/WhiteboardParser.h>

namespace Swift {
	WhiteboardParser::WhiteboardParser() : level_(0) {
	}
	void WhiteboardParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) {
		++level_;
	}

	void WhiteboardParser::handleEndElement(const std::string& element, const std::string&) {
		--level_;
		if(level_ == 0) {
			getPayloadInternal()->setData(data_);
		}
	}

	void WhiteboardParser::handleCharacterData(const std::string& data) {
		data_ += data;
	}
}