diff options
Diffstat (limited to 'project2/xslRowsCache.h')
-rw-r--r-- | project2/xslRowsCache.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/project2/xslRowsCache.h b/project2/xslRowsCache.h new file mode 100644 index 0000000..55b8674 --- /dev/null +++ b/project2/xslRowsCache.h @@ -0,0 +1,35 @@ +#ifndef XSLROWSCACHE_H +#define XSLROWSCACHE_H + +#include <libxml/tree.h> +#include <boost/shared_ptr.hpp> +#include <map> +#include <set> +#include "../libmisc/curlsup.h" +#include <glibmm/ustring.h> + +class XslRowsCache { + protected: + typedef std::set<Glib::ustring> Queued; + typedef std::map<const Glib::ustring, boost::shared_ptr<xmlDoc> > Documents; + + static Queued queued; + static Documents documents; + + void queue(const Glib::ustring & url, const char * encoding) const; + + virtual CurlHandle::Ptr newCurl() const = 0; + virtual bool asHtml() const = 0; + virtual bool withWarnings() const = 0; + + protected: + xmlDocPtr getDocument(const Glib::ustring & url, const char * encoding) const; + + private: + static size_t handleDataHelper(const char * ptr, size_t size, size_t nmemb, void *stream); + static CurlBulkFetcher cbf; + + friend class XslCachePopulator; +}; + +#endif |