/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef BACKENDS_NETWORKING_CURL_NETWORKREADSTREAM_H #define BACKENDS_NETWORKING_CURL_NETWORKREADSTREAM_H #include "common/memstream.h" #include "common/stream.h" #include "common/str.h" #include "common/hashmap.h" #include "common/hash-str.h" typedef void CURL; struct curl_slist; namespace Networking { class NetworkReadStream: public Common::MemoryReadWriteStream { CURL *_easy; bool _eos, _requestComplete; const byte *_sendingContentsBuffer; uint32 _sendingContentsSize; uint32 _sendingContentsPos; Common::String _responseHeaders; uint64 _progressDownloaded, _progressTotal; void init(const char *url, curl_slist *headersList, const byte *buffer, uint32 bufferSize, bool uploading, bool usingPatch, bool post); void init(const char *url, curl_slist *headersList, Common::HashMap formFields, Common::HashMap formFiles); public: /** Send , using POST by default. */ NetworkReadStream(const char *url, curl_slist *headersList, Common::String postFields, bool uploading = false, bool usingPatch = false); /** Send , , using POST multipart/form. */ NetworkReadStream( const char *url, curl_slist *headersList, Common::HashMap formFields, Common::HashMap formFiles); /** Send