summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/http_request.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dropbox/src/http_request.h')
-rw-r--r--plugins/Dropbox/src/http_request.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/plugins/Dropbox/src/http_request.h b/plugins/Dropbox/src/http_request.h
index 9980945b66..dc0c006b47 100644
--- a/plugins/Dropbox/src/http_request.h
+++ b/plugins/Dropbox/src/http_request.h
@@ -31,7 +31,7 @@ public:
}
};
-class HttpRequest : protected NETLIBHTTPREQUEST//, public MZeroedObject
+class HttpRequest : protected NETLIBHTTPREQUEST
{
private:
CMStringA m_szUrl;
@@ -163,4 +163,26 @@ public:
}
};
+class NetlibPtr
+{
+protected:
+ NETLIBHTTPREQUEST *_p;
+
+public:
+ __inline explicit NetlibPtr(NETLIBHTTPREQUEST *p) : _p(p) {}
+ __inline NETLIBHTTPREQUEST* operator=(NETLIBHTTPREQUEST *p)
+ {
+ if (p)
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)(NETLIBHTTPREQUEST*)p);
+ _p = p;
+ return _p;
+ }
+ __inline operator NETLIBHTTPREQUEST*() const { return _p; }
+ __inline NETLIBHTTPREQUEST* operator->() const { return _p; }
+ __inline ~NetlibPtr()
+ {
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)(NETLIBHTTPREQUEST*)this);
+ }
+};
+
#endif //_HTTP_REQUEST_H_ \ No newline at end of file