Files
@ 9b5ec6eedb5a
Branch filter:
Location: libtransport.git/include/Swiften/Parser/PayloadParsers/XHTMLIMParser.cpp - annotation
9b5ec6eedb5a
1.5 KiB
text/x-c++hdr
MySQLBackend: prepared statement results buffering, fixes #183
* cleanup unused code
* use mysql error constants instead of magic numbers
* cleanup unused code
* use mysql error constants instead of magic numbers
64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 6d2f8c192761 64f1921f8d5c 64f1921f8d5c 6d2f8c192761 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c a9ccbdc50107 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 6d2f8c192761 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c 64f1921f8d5c | /*
* Copyright (c) 2011 Jan Kaluza
* Licensed under the Simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
#include <cassert>
#include <Swiften/Parser/PayloadParsers/XHTMLIMParser.h>
#include <Swiften/Parser/SerializingParser.h>
#include "Swiften/SwiftenCompat.h"
namespace Swift {
XHTMLIMParser::XHTMLIMParser() : level_(TopLevel), bodyParser_(0) {
}
void XHTMLIMParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
++level_;
if (level_ == BodyLevel) {
if (element == "body") {
assert(!bodyParser_);
bodyParser_ = new SerializingParser();
}
}
else if (level_ >= InsideBodyLevel && bodyParser_) {
bodyParser_->handleStartElement(element, "", attributes);
}
}
void XHTMLIMParser::handleEndElement(const std::string& element, const std::string& ns) {
if (level_ == BodyLevel) {
if (bodyParser_) {
if (element == "body") {
getPayloadInternal()->setBody(bodyParser_->getResult());
}
delete bodyParser_;
bodyParser_ = 0;
}
}
else if (bodyParser_ && level_ >= InsideBodyLevel) {
bodyParser_->handleEndElement(element, ns);
}
--level_;
}
void XHTMLIMParser::handleCharacterData(const std::string& data) {
if (bodyParser_) {
bodyParser_->handleCharacterData(data);
}
else {
currentText_ += data;
}
}
SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<XHTMLIMPayload> XHTMLIMParser::getLabelPayload() const {
return getPayloadInternal();
}
}
|