# Poco

# class LineEndingConverterIOS

Library: Foundation
Package: Streams
Header: Poco/LineEndingConverter.h

## Description

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.

## Inheritance

Direct Base Classes: std::ios

All Base Classes: std::ios

Known Derived Classes: InputLineEndingConverter, OutputLineEndingConverter

## Member Summary

Member Functions: getNewLine, rdbuf, setNewLine

## Constructors

### LineEndingConverterIOS

LineEndingConverterIOS(
std::istream & istr
);

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

### LineEndingConverterIOS

LineEndingConverterIOS(
std::ostream & ostr
);

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

## Destructor

### ~LineEndingConverterIOS

~LineEndingConverterIOS();

Destroys the stream.

## Member Functions

### getNewLine

const std::string & getNewLine() const;

Returns the line ending currently in use.

### rdbuf

LineEndingConverterStreamBuf * rdbuf();

Returns a pointer to the underlying streambuf.

### setNewLine

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.

## Variables

### _buf

LineEndingConverterStreamBuf _buf;