Qx v0.5.8
Qt Extensions Library
|
The TextStream class is a more robust variant of QTextStream, which provides a convenient interface for reading and writing text. More...
#include <qx/io/qx-textstream.h>
Additional Inherited Members | |
Public Types inherited from QTextStream | |
enum | FieldAlignment |
enum | NumberFlag |
enum | RealNumberNotation |
enum | Status |
Public Types inherited from QIODeviceBase | |
enum | OpenModeFlag |
Public Attributes inherited from QTextStream | |
AlignAccountingStyle | |
AlignCenter | |
AlignLeft | |
AlignRight | |
FixedNotation | |
ForcePoint | |
ForceSign | |
typedef | NumberFlags |
Ok | |
ReadCorruptData | |
ReadPastEnd | |
ScientificNotation | |
ShowBase | |
SmartNotation | |
UppercaseBase | |
UppercaseDigits | |
WriteFailed | |
Public Attributes inherited from QIODeviceBase | |
Append | |
ExistingOnly | |
NewOnly | |
NotOpen | |
typedef | OpenMode |
ReadOnly | |
ReadWrite | |
Text | |
Truncate | |
Unbuffered | |
WriteOnly | |
TextStream derives from QTextStream and therefore shares all of its functionality, but this Qx variant provides additional facilities not present in its base class.
Qx::TextStream::TextStream | ( | const QByteArray & | array, |
QIODevice::OpenMode | openMode = QIODevice::ReadOnly ) |
Constructs a QTextStream that operates on array, using openMode to define the open mode. The array is accessed as read-only, regardless of the values in openMode.
Qx::TextStream::TextStream | ( | QByteArray * | array, |
QIODevice::OpenMode | openMode = QIODevice::ReadWrite ) |
Constructs a QTextStream that operates on array, using openMode to define the open mode. Internally, the array is wrapped by a QBuffer.
Qx::TextStream::TextStream | ( | QString * | string, |
QIODevice::OpenMode | openMode = QIODevice::ReadWrite ) |
Constructs a QTextStream that operates on string, using openMode to define the open mode.
Qx::TextStream::TextStream | ( | FILE * | fileHandle, |
QIODevice::OpenMode | openMode = QIODevice::ReadWrite ) |
Constructs a QTextStream that operates on fileHandle, using openMode to define the open mode. Internally, a QFile is created to handle the FILE pointer.
Qx::TextStream::TextStream | ( | QIODevice * | device | ) |
Constructs a QTextStream that operates on device.
bool Qx::TextStream::precedingBreak | ( | ) |
Returns true
if the character at the stream's current position - 1 is the line feed character ('\n'
), or rather, that the stream is currently positioned immediately after a line break; otherwise returns false
.
QString Qx::TextStream::readLineWithBreak | ( | qint64 | maxlen = 0 | ) |
Same as readLine() except that trailing new line characters are not discarded.