summaryrefslogtreecommitdiffabout
path: root/include
authorMichael Krelin <hacker@klever.net>2007-11-24 12:02:50 (UTC)
committer Michael Krelin <hacker@klever.net>2007-11-24 12:02:50 (UTC)
commit986274e9f9a8e2ef0f92b08d2d2c9485bd19adec (patch) (side-by-side diff)
tree72b3d134d9d635b2aadbdebf615e1717dd9d683b /include
parentef66d79bf58f099179a932ca80d07ca93a42909c (diff)
downloadlibopkele-986274e9f9a8e2ef0f92b08d2d2c9485bd19adec.zip
libopkele-986274e9f9a8e2ef0f92b08d2d2c9485bd19adec.tar.gz
libopkele-986274e9f9a8e2ef0f92b08d2d2c9485bd19adec.tar.bz2
moved curl_t wrapper to util namespace
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'include') (more/less context) (ignore whitespace changes)
-rw-r--r--include/Makefile.am3
-rw-r--r--include/opkele/curl.h28
2 files changed, 30 insertions, 1 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index f3551f5..b31786d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -10,7 +10,8 @@ nobase_include_HEADERS = \
opkele/sreg.h \
opkele/extension_chain.h \
opkele/xconsumer.h \
opkele/xserver.h
EXTRA_DIST = \
opkele/data.h \
- opkele/util.h
+ opkele/util.h \
+ opkele/curl.h
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 */