summaryrefslogtreecommitdiffabout
path: root/include
Unidiff
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
@@ -1,16 +1,17 @@
1nobase_include_HEADERS = \ 1nobase_include_HEADERS = \
2 opkele/acconfig.h \ 2 opkele/acconfig.h \
3 opkele/opkele-config.h \ 3 opkele/opkele-config.h \
4 opkele/types.h \ 4 opkele/types.h \
5 opkele/association.h \ 5 opkele/association.h \
6 opkele/exception.h \ 6 opkele/exception.h \
7 opkele/server.h \ 7 opkele/server.h \
8 opkele/consumer.h \ 8 opkele/consumer.h \
9 opkele/extension.h \ 9 opkele/extension.h \
10 opkele/sreg.h \ 10 opkele/sreg.h \
11 opkele/extension_chain.h \ 11 opkele/extension_chain.h \
12 opkele/xconsumer.h \ 12 opkele/xconsumer.h \
13 opkele/xserver.h 13 opkele/xserver.h
14EXTRA_DIST = \ 14EXTRA_DIST = \
15 opkele/data.h \ 15 opkele/data.h \
16 opkele/util.h 16 opkele/util.h \
17 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 @@
1#ifndef __OPKELE_CURL_H
2#define __OPKELE_CURL_H
3
4#include <curl/curl.h>
5
6namespace opkele {
7
8 namespace util {
9
10 class curl_t {
11 public:
12 CURL *_c;
13
14 curl_t() : _c(0) { }
15 curl_t(CURL *c) : _c(c) { }
16 ~curl_t() throw() { if(_c) curl_easy_cleanup(_c); }
17
18 curl_t& operator=(CURL *c) { if(_c) curl_easy_cleanup(_c); _c=c; return *this; }
19
20 operator const CURL*(void) const { return _c; }
21 operator CURL*(void) { return _c; }
22 };
23
24 }
25
26}
27
28#endif /* __OPKELE_CURL_H */