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; }
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; }