Library: Foundation
Package: Streams
Header: Poco/LineEndingConverter.h
This stream buffer performs line ending conversion on text streams. The converter can convert from and to the Unix (LF), Mac (CR) and DOS/Windows/Network (CF-LF) endings.
Any newline sequence in the source will be replaced by the target newline sequence.
Direct Base Classes: UnbufferedStreamBuf
All Base Classes: UnbufferedStreamBuf
Member Functions: getNewLine, readFromDevice, setNewLine, writeToDevice
LineEndingConverterStreamBuf(
std::istream & istr
);
Creates the LineEndingConverterStreamBuf and connects it to the given input stream.
LineEndingConverterStreamBuf(
std::ostream & ostr
);
Creates the LineEndingConverterStreamBuf and connects it to the given output stream.
~LineEndingConverterStreamBuf();
Destroys the LineEndingConverterStream.
const std::string & getNewLine() const;
Returns the line ending currently in use.
void setNewLine(
const std::string & newLineCharacters
);
Sets the target line ending for the converter.
Possible values are:
In theory, any character sequence can be used as newline sequence. In practice, however, only the above three make sense.
int readFromDevice();
int writeToDevice(
char c
);