From: Adam Dickmeiss Date: Wed, 1 Jun 2011 10:19:08 +0000 (+0200) Subject: Torus: add get_doc method X-Git-Tag: v1.2.6~32 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=c6105f042dd7591d8566fa590eb92476b2435bb5;p=metaproxy-moved-to-github.git Torus: add get_doc method --- diff --git a/src/torus.cpp b/src/torus.cpp index 39f87da..924781a 100644 --- a/src/torus.cpp +++ b/src/torus.cpp @@ -161,15 +161,14 @@ mp::Torus::~Torus() void mp::Torus::read_searchables(std::string url) { - if (url.length() == 0) - return; - if (doc) { xmlFreeDoc(doc); doc = 0; } - + if (url.length() == 0) + return; + int code; WRBUF w = get_url(url.c_str(), 0, 0, &code); if (code == 200) @@ -181,6 +180,11 @@ void mp::Torus::read_searchables(std::string url) wrbuf_destroy(w); } +xmlDoc *mp::Torus::get_doc() +{ + return doc; +} + /* * Local variables: * c-basic-offset: 4 diff --git a/src/torus.hpp b/src/torus.hpp index e3a54a9..e360b42 100644 --- a/src/torus.hpp +++ b/src/torus.hpp @@ -29,6 +29,7 @@ namespace metaproxy_1 { Torus(); ~Torus(); void read_searchables(std::string url); + xmlDoc *get_doc(); private: xmlDocPtr doc; };