Files
@ 96476b9a8a3e
Branch filter:
Location: libtransport.git/include/Swiften/Parser/StringTreeParser.cpp - annotation
96476b9a8a3e
888 B
text/x-c++hdr
Merge branch 'master' of git://github.com/hanzz/libtransport into twitter-backend
593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 593cb59ea6ee 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>
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;
XMLParser *parser = factory.createXMLParser(&client);
parser->parse(xml);
ParserElement::ref root = client.getRoot();
delete parser;
return root;
}
}
|