mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-07 13:27:13 +01:00
4a6bfc086c
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
89 lines
1.3 KiB
C++
89 lines
1.3 KiB
C++
//
|
|
// HTTPIOStream.h
|
|
//
|
|
// Library: Net
|
|
// Package: HTTP
|
|
// Module: HTTPIOStream
|
|
//
|
|
// Definition of the HTTPIOStream class.
|
|
//
|
|
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#ifndef Net_HTTPIOStream_INCLUDED
|
|
#define Net_HTTPIOStream_INCLUDED
|
|
|
|
|
|
#include "Poco/Net/Net.h"
|
|
#include "Poco/Net/HTTPResponse.h"
|
|
#include "Poco/UnbufferedStreamBuf.h"
|
|
|
|
|
|
namespace Poco {
|
|
namespace Net {
|
|
|
|
|
|
class HTTPClientSession;
|
|
|
|
|
|
class Net_API HTTPResponseStreamBuf: public Poco::UnbufferedStreamBuf
|
|
{
|
|
public:
|
|
HTTPResponseStreamBuf(std::istream& istr);
|
|
|
|
~HTTPResponseStreamBuf();
|
|
|
|
private:
|
|
int readFromDevice();
|
|
|
|
std::istream& _istr;
|
|
};
|
|
|
|
|
|
inline int HTTPResponseStreamBuf::readFromDevice()
|
|
{
|
|
return _istr.get();
|
|
}
|
|
|
|
|
|
class Net_API HTTPResponseIOS: public virtual std::ios
|
|
{
|
|
public:
|
|
HTTPResponseIOS(std::istream& istr);
|
|
|
|
~HTTPResponseIOS();
|
|
|
|
HTTPResponseStreamBuf* rdbuf();
|
|
|
|
protected:
|
|
HTTPResponseStreamBuf _buf;
|
|
};
|
|
|
|
|
|
inline HTTPResponseStreamBuf* HTTPResponseIOS::rdbuf()
|
|
{
|
|
return &_buf;
|
|
}
|
|
|
|
|
|
class Net_API HTTPResponseStream: public HTTPResponseIOS, public std::istream
|
|
{
|
|
public:
|
|
HTTPResponseStream(std::istream& istr, HTTPClientSession* pSession);
|
|
|
|
~HTTPResponseStream();
|
|
|
|
private:
|
|
HTTPClientSession* _pSession;
|
|
};
|
|
|
|
|
|
} } // namespace Poco::Net
|
|
|
|
|
|
#endif // Net_HTTPIOStream_INCLUDED
|