diff options
Diffstat (limited to 'backends/networking/curl/curljsonrequest.h')
-rw-r--r-- | backends/networking/curl/curljsonrequest.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/backends/networking/curl/curljsonrequest.h b/backends/networking/curl/curljsonrequest.h index 3d5dd7858b..75d4a6df81 100644 --- a/backends/networking/curl/curljsonrequest.h +++ b/backends/networking/curl/curljsonrequest.h @@ -25,19 +25,24 @@ #include "backends/networking/curl/curlrequest.h" #include "common/memstream.h" +#include "common/json.h" namespace Networking { class NetworkReadStream; -class CurlJsonRequest: public CurlRequest { +typedef RequestIdPair<Common::JSONValue*> RequestJsonPair; +typedef Common::BaseCallback<RequestJsonPair> *JsonCallback; + +class CurlJsonRequest: public CurlRequest { + JsonCallback _jsonCallback; Common::MemoryWriteStreamDynamic _contentsStream; /** Prepares raw bytes from _contentsStream to be parsed with Common::JSON::parse(). */ char *getPreparedContents(); public: - CurlJsonRequest(DataCallback cb, const char *url); //TODO: use some Callback<JSON> already + CurlJsonRequest(JsonCallback cb, const char *url); virtual ~CurlJsonRequest(); virtual void handle(); |