1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00
SqMod/vendor/POCO/Net/include/Poco/Net/QuotedPrintableDecoder.h
Sandu Liviu Catalin 4a6bfc086c Major plugin refactor and cleanup.
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.
2021-01-30 08:51:39 +02:00

87 lines
2.0 KiB
C++

//
// QuotedPrintableDecoder.h
//
// Library: Net
// Package: Messages
// Module: QuotedPrintableDecoder
//
// Definition of the QuotedPrintableDecoder class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_QuotedPrintableDecoder_INCLUDED
#define Net_QuotedPrintableDecoder_INCLUDED
#include "Poco/Net/Net.h"
#include "Poco/UnbufferedStreamBuf.h"
#include <istream>
namespace Poco {
namespace Net {
class Net_API QuotedPrintableDecoderBuf: public Poco::UnbufferedStreamBuf
/// This streambuf decodes all quoted-printable (see RFC 2045)
/// encoded data read from the istream connected to it.
///
/// Note: For performance reasons, the characters
/// are read directly from the given istream's
/// underlying streambuf, so the state
/// of the istream will not reflect that of
/// its streambuf.
{
public:
QuotedPrintableDecoderBuf(std::istream& istr);
~QuotedPrintableDecoderBuf();
private:
int readFromDevice();
std::streambuf& _buf;
};
class Net_API QuotedPrintableDecoderIOS: public virtual std::ios
/// The base class for QuotedPrintableDecoder.
///
/// This class is needed to ensure the correct initialization
/// order of the stream buffer and base classes.
{
public:
QuotedPrintableDecoderIOS(std::istream& istr);
~QuotedPrintableDecoderIOS();
QuotedPrintableDecoderBuf* rdbuf();
protected:
QuotedPrintableDecoderBuf _buf;
};
class Net_API QuotedPrintableDecoder: public QuotedPrintableDecoderIOS, public std::istream
/// This istream decodes all quoted-printable (see RFC 2045)
/// encoded data read from the istream connected to it.
///
/// Note: For performance reasons, the characters
/// are read directly from the given istream's
/// underlying streambuf, so the state
/// of the istream will not reflect that of
/// its streambuf.
{
public:
QuotedPrintableDecoder(std::istream& istr);
~QuotedPrintableDecoder();
};
} } // namespace Poco::Net
#endif // Net_QuotedPrintableDecoder_INCLUDED