1 // Written by James Turner
3 // Copyright (C) 2013 James Turner <zakalawe@mac.com>
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Library General Public
7 // License as published by the Free Software Foundation; either
8 // version 2 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef SG_HTTP_CONTENT_DECODER_HXX
21 #define SG_HTTP_CONTENT_DECODER_HXX
27 #include <simgear/io/HTTPRequest.hxx>
44 void initWithRequest(Request_ptr req);
48 void setEncoding(const std::string& encoding);
50 void receivedBytes(const char* n, size_t s);
53 bool consumeGZipHeader();
56 void consumeBytes(size_t consumed);
57 void reallocateInputBuffer(size_t newSize);
60 unsigned char* _output;
63 unsigned char* _input;
64 size_t _inputAllocated, _inputSize;
65 bool _contentDeflate, _needGZipHeader;
68 } // of namespace HTTP
70 } // of namespace simgear
72 #endif // of SG_HTTP_CONTENT_DECODER_HXX