Files
@ 4bb54c18310b
Branch filter:
Location: libtransport.git/src/storageparser.cpp - annotation
4bb54c18310b
1016 B
text/x-c++hdr
set privacy type to deny_users
778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 778a11d5dc68 | #include "storageparser.h"
#include "Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h"
using namespace Swift;
namespace Transport {
StorageParser::StorageParser() : level(0) {
}
void StorageParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level == 1) {
currentPayloadParser.reset(new RawXMLPayloadParser());
}
if (level >= 1 && currentPayloadParser.get()) {
currentPayloadParser->handleStartElement(element, ns, attributes);
}
++level;
}
void StorageParser::handleEndElement(const std::string& element, const std::string& ns) {
--level;
if (currentPayloadParser.get()) {
if (level >= 1) {
currentPayloadParser->handleEndElement(element, ns);
}
if (level == 1) {
getPayloadInternal()->setPayload(currentPayloadParser->getPayload());
}
}
}
void StorageParser::handleCharacterData(const std::string& data) {
if (level > 1 && currentPayloadParser.get()) {
currentPayloadParser->handleCharacterData(data);
}
}
}
|