-rw-r--r-- | include/opkele/curl.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/opkele/curl.h b/include/opkele/curl.h new file mode 100644 index 0000000..8794ece --- a/dev/null +++ b/include/opkele/curl.h @@ -0,0 +1,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 */ |