Files
@ 9b5ec6eedb5a
Branch filter:
Location: libtransport.git/include/Swiften/Parser/StringTreeParser.cpp - annotation
9b5ec6eedb5a
1.0 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
593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 6b45e0e418ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 6b45e0e418ee 6b45e0e418ee 6b45e0e418ee 593cb59ea6ee 6b45e0e418ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 6b45e0e418ee 593cb59ea6ee 6b45e0e418ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee | /*
* Copyright (c) 2011 Jan Kaluza
* Licensed under the Simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
#include <Swiften/Parser/StringTreeParser.h>
#include <Swiften/Parser/PlatformXMLParserFactory.h>
#include <Swiften/Parser/Tree/ParserElement.h>
#include <Swiften/Parser/XMLParser.h>
#include <Swiften/Version.h>
namespace Swift {
class DefaultStringTreeParser : public StringTreeParser {
public:
void handleTree(ParserElement::ref root) {
root_ = root;
}
ParserElement::ref getRoot() {
return root_;
}
private:
ParserElement::ref root_;
};
ParserElement::ref StringTreeParser::parse(const std::string &xml) {
PlatformXMLParserFactory factory;
DefaultStringTreeParser client;
#if (SWIFTEN_VERSION >= 0x040000)
std::unique_ptr<XMLParser> parser = factory.createXMLParser(&client);
#else
XMLParser *parser = factory.createXMLParser(&client);
#endif
parser->parse(xml);
ParserElement::ref root = client.getRoot();
#if (SWIFTEN_VERSION < 0x040000)
delete parser;
#endif
return root;
}
}
|