From c6105f042dd7591d8566fa590eb92476b2435bb5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 1 Jun 2011 12:19:08 +0200 Subject: [PATCH] Torus: add get_doc method --- src/torus.cpp | 12 ++++++++---- src/torus.hpp | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) 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; }; -- 1.7.10.4