class Poco::Net::MailStreamBuf

Overview

The sole purpose of this stream buffer is to replace a “rn.rn” character sequence with a “rn..rn” sequence for output streams and vice-versa for input streams. More…

#include <MailStream.h>

class MailStreamBuf: public Poco::BasicUnbufferedStreamBuf
{
public:
    // construction

    MailStreamBuf(std::istream& istr);
    MailStreamBuf(std::ostream& ostr);

    // methods

    void
    close();

protected:
    // methods

    virtual
    int
    readFromDevice();

    int
    writeToDevice(char c);

    int
    readOne();
};

Inherited Members

public:
    // methods

    virtual
    int_type
    overflow(int_type c);

    virtual
    int_type
    underflow();

    virtual
    int_type
    uflow();

    virtual
    int_type
    pbackfail(int_type c);

    virtual
    std::streamsize
    xsgetn(
        char_type* p,
        std::streamsize count
        );

protected:
    // typedefs

    typedef std::basic_streambuf<ch, tr> Base;
    typedef std::basic_ios<ch, tr> IOS;
    typedef ch char_type;
    typedef tr char_traits;
    typedef Base::int_type int_type;
    typedef Base::pos_type pos_type;
    typedef Base::off_type off_type;
    typedef IOS::openmode openmode;

    // methods

    static
    int_type
    charToInt(char_type c);

Detailed Documentation

The sole purpose of this stream buffer is to replace a “rn.rn” character sequence with a “rn..rn” sequence for output streams and vice-versa for input streams.

This is used when sending mail messages to SMTP servers, or receiving mail messages from POP servers.

See RFC 2181 (Simple Mail Transfer Protocol) and RFC 1939 (Post Office Protocol - Version 3) for more information.

Construction

MailStreamBuf(std::istream& istr)

Creates the MailStreamBuf and connects it to the given input stream.

MailStreamBuf(std::ostream& ostr)

Creates the MailStreamBuf and connects it to the given output stream.

Methods

void
close()

Writes the terminating period, followed by CR-LF.