summaryrefslogtreecommitdiffabout
path: root/include/opkele/curl.h
blob: 8794ece62b1c1c52bd70cdb40f568f3d0a049979 (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
#ifndef __OPKELE_CURL_H
#define __OPKELE_CURL_H

#include <curl/curl.h>

namespace opkele {

    namespace util {

	class curl_t {
	    public:
		CURL *_c;

		curl_t() : _c(0) { }
		curl_t(CURL *c) : _c(c) { }
		~curl_t() throw() { if(_c) curl_easy_cleanup(_c); }

		curl_t& operator=(CURL *c) { if(_c) curl_easy_cleanup(_c); _c=c; return *this; }

		operator const CURL*(void) const { return _c; }
		operator CURL*(void) { return _c; }
	};

    }

}

#endif /* __OPKELE_CURL_H */