summaryrefslogtreecommitdiff
path: root/project2/urlRows.h
blob: ca1894d5b1bb88c8d81cf09b75fe566083aa116c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef URLROWS_H
#define URLROWS_H

#include <libxml++/nodes/element.h>
#include <boost/intrusive_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <map>
#include "streamRows.h"
#include "curlHelper.h"

/// Project2 component to create a row set from the contents of a file accessible via libcurl
class UrlRows : public StreamRows, CurlHelper {
	public:
		UrlRows(const xmlpp::Element * p);
		~UrlRows();

		virtual void loadComplete(const CommonObjects *);
		void execute(const RowProcessor *) const;
		virtual void setFilter(const Glib::ustring &);

	private:
		struct callback {
			callback(const UrlRows * urlRows, const RowProcessor * rp);
			const UrlRows * urlRows;
			const RowProcessor * rp;
		};
		static size_t handleDataHelper(const char * ptr, size_t size, size_t nmemb, void * stream);
		size_t handleData(const RowProcessor * rp, const char * bytes, size_t bytesLen) const;
		bool convertRequired;

};

#endif