summaryrefslogtreecommitdiffstats
blob: e5898ff8d08cca1ee2e3ca57b56b800ee103890c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "Swiften/Parser/PayloadParsers/BodyParser.h"

namespace Swift {

BodyParser::BodyParser() : level_(0) {
}

void BodyParser::handleStartElement(const String&, const String&, const AttributeMap&) {
	++level_;
}

void BodyParser::handleEndElement(const String&, const String&) {
	--level_;
	if (level_ == 0) {
		getPayloadInternal()->setText(text_);
	}
}

void BodyParser::handleCharacterData(const String& data) {
	text_ += data;
}

}