class Poco::LineEndingConverterIOS

Overview

The base class for InputLineEndingConverter and OutputLineEndingConverter. Moreā€¦

#include <LineEndingConverter.h>

class LineEndingConverterIOS: public ios
{
public:
    // construction

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

    // methods

    void
    setNewLine(const std::string& newLineCharacters);

    const std::string&
    getNewLine() const;

    LineEndingConverterStreamBuf*
    rdbuf();

protected:
    // fields

    LineEndingConverterStreamBuf _buf;
};

// direct descendants

class InputLineEndingConverter;
class OutputLineEndingConverter;

Detailed Documentation

The base class for InputLineEndingConverter and OutputLineEndingConverter.

This class provides common methods and is also needed to ensure the correct initialization order of the stream buffer and base classes.

Construction

LineEndingConverterIOS(std::istream& istr)

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

LineEndingConverterIOS(std::ostream& ostr)

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

Methods

void
setNewLine(const std::string& newLineCharacters)

Sets the target line ending for the converter.

Possible values are:

* NEWLINE_DEFAULT (whatever is appropriate for the current platform)
* NEWLINE_CRLF    (Windows),
* NEWLINE_LF      (Unix),
* NEWLINE_CR      (Macintosh)

In theory, any character sequence can be used as newline sequence. In practice, however, only the above three make sense.

If an empty string is given, all newline characters are removed from the stream.

const std::string&
getNewLine() const

Returns the line ending currently in use.

LineEndingConverterStreamBuf*
rdbuf()

Returns a pointer to the underlying streambuf.