aboutsummaryrefslogtreecommitdiff
path: root/backends/networking
diff options
context:
space:
mode:
authorAlexander Tkachev2016-05-21 14:06:50 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitca456a7241fb4b46f9c76c86eeecc273ca31d8f6 (patch)
tree0c2ea21d76d86376ea865a5104770979def98e7f /backends/networking
parent17eb5f91433f2414dc73f89abfdd316407259b61 (diff)
downloadscummvm-rg350-ca456a7241fb4b46f9c76c86eeecc273ca31d8f6.tar.gz
scummvm-rg350-ca456a7241fb4b46f9c76c86eeecc273ca31d8f6.tar.bz2
scummvm-rg350-ca456a7241fb4b46f9c76c86eeecc273ca31d8f6.zip
CLOUD: Add object-oriented Callbacks
These callbacks can call object's methods, not some global C functions. DropboxStorage::info2() and DropboxStorage::infoMethodCallback() demonstrate the idea.
Diffstat (limited to 'backends/networking')
-rw-r--r--backends/networking/curl/curljsonrequest.cpp2
-rw-r--r--backends/networking/curl/curljsonrequest.h2
-rw-r--r--backends/networking/curl/request.h6
3 files changed, 5 insertions, 5 deletions
diff --git a/backends/networking/curl/curljsonrequest.cpp b/backends/networking/curl/curljsonrequest.cpp
index 929723c671..fe6e218269 100644
--- a/backends/networking/curl/curljsonrequest.cpp
+++ b/backends/networking/curl/curljsonrequest.cpp
@@ -31,7 +31,7 @@
namespace Networking {
-CurlJsonRequest::CurlJsonRequest(Callback cb, const char *url) : Request(cb), _stream(0), _headersList(0), _contentsStream(DisposeAfterUse::YES) {
+CurlJsonRequest::CurlJsonRequest(SimpleCallback cb, const char *url) : Request(cb), _stream(0), _headersList(0), _contentsStream(DisposeAfterUse::YES) {
_url = url;
}
diff --git a/backends/networking/curl/curljsonrequest.h b/backends/networking/curl/curljsonrequest.h
index cbf3f6dd56..56e7205512 100644
--- a/backends/networking/curl/curljsonrequest.h
+++ b/backends/networking/curl/curljsonrequest.h
@@ -43,7 +43,7 @@ class CurlJsonRequest : public Request {
char *getPreparedContents();
public:
- CurlJsonRequest(Callback cb, const char *url);
+ CurlJsonRequest(SimpleCallback cb, const char *url);
virtual ~CurlJsonRequest();
virtual bool handle();
diff --git a/backends/networking/curl/request.h b/backends/networking/curl/request.h
index d405ec8551..b9571075cb 100644
--- a/backends/networking/curl/request.h
+++ b/backends/networking/curl/request.h
@@ -27,14 +27,14 @@ namespace Networking {
class Request {
protected:
- typedef void(*Callback)(Request* request, void *result);
+ typedef void(*SimpleCallback)(Request* request, void *result);
/**
* Callback, which should be called before Request returns true in handle().
* That's the way Requests pass the result to the code which asked to create this request.
*/
- Callback _callback;
+ SimpleCallback _callback;
/**
* Pointer, which could be set by Request creating code. It might be accessed
@@ -44,7 +44,7 @@ protected:
void *_pointer;
public:
- Request(Callback cb): _callback(cb) {};
+ Request(SimpleCallback cb): _callback(cb) {};
virtual ~Request() {};
/**