![]() |
Qt 6.x
The Qt SDK
|
#include <qtextstream_p.h>
Classes | |
struct | PaddingResult |
class | Params |
Public Types | |
enum | TokenDelimiter { Space , NotSpace , EndOfLine } |
enum | NumberParsingStatus { npsOk , npsMissingDigit , npsInvalidPrefix } |
Public Attributes | |
QIODevice * | device |
QDeviceClosedNotifier | deviceClosedNotifier |
QString * | string |
int | stringOffset |
QIODevice::OpenMode | stringOpenMode |
QStringConverter::Encoding | encoding = QStringConverter::Utf8 |
QStringEncoder | fromUtf16 |
QStringDecoder | toUtf16 |
QStringDecoder | savedToUtf16 |
QString | writeBuffer |
QString | readBuffer |
int | readBufferOffset |
int | readConverterSavedStateOffset |
qint64 | readBufferStartDevicePos |
Params | params |
QTextStream::Status | status |
QLocale | locale |
QTextStream * | q_ptr |
int | lastTokenSize |
bool | deleteDevice |
bool | autoDetectUnicode |
bool | hasWrittenData = false |
bool | generateBOM = false |
Definition at line 56 of file qtextstream_p.h.
Enumerator | |
---|---|
npsOk | |
npsMissingDigit | |
npsInvalidPrefix |
Definition at line 131 of file qtextstream_p.h.
Enumerator | |
---|---|
Space | |
NotSpace | |
EndOfLine |
Definition at line 115 of file qtextstream_p.h.
QTextStreamPrivate::QTextStreamPrivate | ( | QTextStream * | q_ptr | ) |
Definition at line 256 of file qtextstream.cpp.
References q_ptr, and reset().
QTextStreamPrivate::~QTextStreamPrivate | ( | ) |
Definition at line 267 of file qtextstream.cpp.
References QObject::blockSignals(), deleteDevice, and device.
|
inline |
Definition at line 635 of file qtextstream.cpp.
References device, QIODevice::pos(), qDebug, QTEXTSTREAM_BUFFERSIZE, readBufferOffset, readConverterSavedStateOffset, saveConverterState(), and stringOffset.
Referenced by consumeLastToken(), and getChar().
|
inline |
Definition at line 625 of file qtextstream.cpp.
References consume(), and lastTokenSize.
Referenced by getNumber(), getReal(), and read().
bool QTextStreamPrivate::fillReadBuffer | ( | qint64 | maxBytes = -1 | ) |
Definition at line 316 of file qtextstream.cpp.
References autoDetectUnicode, ch, QByteArray::constData(), device, e, encoding, QStringConverter::encodingForData(), file, fromUtf16, QFileDevice::handle(), QIODevice::isSequential(), QIODevice::isTextModeEnabled(), QStringConverter::nameForEncoding(), Q_ASSERT, Q_UNUSED, qDebug, QTEXTSTREAM_BUFFERSIZE, QIODevice::read(), readBufferOffset, QIODevice::readLine(), readPtr(), QIODevice::setTextModeEnabled(), QtDebugUtils::toPrintable(), and toUtf16.
Referenced by getChar(), read(), and scan().
void QTextStreamPrivate::flushWriteBuffer | ( | ) |
Definition at line 435 of file qtextstream.cpp.
References QByteArray::constData(), device, file, QFileDevice::flush(), fromUtf16, hasWrittenData, QIODevice::isTextModeEnabled(), qDebug, QIODevice::setTextModeEnabled(), status, QtDebugUtils::toPrintable(), and QIODevice::write().
Referenced by write(), write(), write(), and writePadding().
|
inline |
Definition at line 744 of file qtextstream.cpp.
References ch, consume(), device, fillReadBuffer(), readPtr(), and stringOffset.
Referenced by getNumber(), and getReal().
QTextStreamPrivate::NumberParsingStatus QTextStreamPrivate::getNumber | ( | qulonglong * | ret | ) |
Definition at line 1610 of file qtextstream.cpp.
References base, QLocale::c(), ch, consumeLastToken(), QChar::digitValue(), QtMiscUtils::fromHex(), getChar(), QLocale::groupSeparator(), QChar::isDigit(), QtMiscUtils::isOctalDigit(), locale, QLocale::negativeSign(), NotSpace, npsInvalidPrefix, npsMissingDigit, npsOk, QLocale::positiveSign(), ret, scan(), sign(), QChar::toLower(), ungetChar(), and QChar::unicode().
bool QTextStreamPrivate::getReal | ( | double * | f | ) |
(hihi)
Definition at line 1784 of file qtextstream.cpp.
References BufferSize, QLocale::c(), consumeLastToken(), QLocale::decimalPoint(), Dot, QLocale::exponential(), QString::fromLatin1(), getChar(), QLocale::groupSeparator(), i, locale, QLocale::negativeSign(), None, NotSpace, ok, QLocale::positiveSign(), qInf(), qQNaN(), qstricmp(), scan(), state, QLocale::toDouble(), QString::toLower(), QChar::toLower(), and ungetChar().
QTextStreamPrivate::PaddingResult QTextStreamPrivate::padding | ( | qsizetype | len | ) | const |
Definition at line 794 of file qtextstream.cpp.
References Q_ASSERT.
Referenced by putString(), and putString().
Definition at line 782 of file qtextstream.cpp.
References ch, putString(), and write().
void QTextStreamPrivate::putNumber | ( | qulonglong | number, |
bool | negative | ||
) |
Definition at line 2194 of file qtextstream.cpp.
References QLocaleData::AlwaysShowSign, base, QLocale::c(), QLocaleData::CapitalEorX, QLocaleData::GroupDigits, locale, QLocaleData::longLongToString(), QLocalePrivate::m_data, QLocale::negativeSign(), number, QLocale::numberOptions(), QLocale::OmitGroupSeparator, QString::prepend(), putString(), QLocaleData::ShowBase, QLocaleData::unsLongLongToString(), and QLocaleData::UppercaseBase.
Definition at line 821 of file qtextstream.cpp.
References QTextStreamPrivate::PaddingResult::left, locale, QLocale::negativeSign(), number, padding(), QLocale::positiveSign(), Q_UNLIKELY, QTextStreamPrivate::PaddingResult::right, sign(), write(), and writePadding().
void QTextStreamPrivate::putString | ( | QLatin1StringView | data, |
bool | number = false |
||
) |
Definition at line 850 of file qtextstream.cpp.
References QTextStreamPrivate::PaddingResult::left, locale, QLocale::negativeSign(), number, padding(), QLocale::positiveSign(), Q_UNLIKELY, QTextStreamPrivate::PaddingResult::right, sign(), write(), and writePadding().
|
inline |
Definition at line 147 of file qtextstream_p.h.
References number, and putString().
Referenced by putChar(), putNumber(), putString(), and putString().
void QTextStreamPrivate::putString | ( | QUtf8StringView | data, |
bool | number = false |
||
) |
Definition at line 875 of file qtextstream.cpp.
References number, and putString().
QString QTextStreamPrivate::read | ( | int | maxlen | ) |
Definition at line 497 of file qtextstream.cpp.
References consumeLastToken(), fillReadBuffer(), lastTokenSize, qDebug, qMin(), readBufferOffset, ret, and stringOffset.
|
inline |
Definition at line 614 of file qtextstream.cpp.
References Q_ASSERT, readBufferOffset, and stringOffset.
Referenced by fillReadBuffer(), getChar(), and scan().
void QTextStreamPrivate::reset | ( | ) |
Definition at line 291 of file qtextstream.cpp.
References autoDetectUnicode, deleteDevice, device, encoding, fromUtf16, generateBOM, hasWrittenData, lastTokenSize, readBufferOffset, readBufferStartDevicePos, stringOffset, stringOpenMode, toUtf16, and QStringConverter::Utf8.
Referenced by QTextStreamPrivate().
void QTextStreamPrivate::resetReadBuffer | ( | ) |
Definition at line 425 of file qtextstream.cpp.
References device, QIODevice::pos(), readBufferOffset, and readBufferStartDevicePos.
|
inline |
Definition at line 672 of file qtextstream.cpp.
References QStringConverter::isValid(), QStringConverter::resetState(), savedToUtf16, and toUtf16.
Definition at line 661 of file qtextstream.cpp.
References readBufferStartDevicePos, readConverterSavedStateOffset, savedToUtf16, and toUtf16.
Referenced by consume().
bool QTextStreamPrivate::scan | ( | const QChar ** | ptr, |
int * | length, | ||
int | maxlen, | ||
TokenDelimiter | delimiter | ||
) |
Scans no more than maxlen QChars in the current buffer for the first delimiter. Stores a pointer to the start offset of the token in ptr, and the length in QChars in length.
Definition at line 523 of file qtextstream.cpp.
References QIODevice::atEnd(), ch, device, EndOfLine, fillReadBuffer(), lastTokenSize, NotSpace, ptr(), qDebug, readBufferOffset, readPtr(), Space, and stringOffset.
Referenced by getNumber(), and getReal().
Definition at line 761 of file qtextstream.cpp.
References ch, readBufferOffset, and stringOffset.
Referenced by getNumber(), and getReal().
Definition at line 684 of file qtextstream.cpp.
References flushWriteBuffer(), and QTEXTSTREAM_BUFFERSIZE.
Definition at line 699 of file qtextstream.cpp.
References ch, flushWriteBuffer(), and QTEXTSTREAM_BUFFERSIZE.
void QTextStreamPrivate::write | ( | QLatin1StringView | data | ) |
Definition at line 714 of file qtextstream.cpp.
References flushWriteBuffer(), and QTEXTSTREAM_BUFFERSIZE.
|
inline |
Definition at line 142 of file qtextstream_p.h.
References write().
Referenced by putChar(), putString(), putString(), and write().
Definition at line 729 of file qtextstream.cpp.
References flushWriteBuffer(), and QTEXTSTREAM_BUFFERSIZE.
Referenced by putString(), and putString().
bool QTextStreamPrivate::autoDetectUnicode |
Definition at line 110 of file qtextstream_p.h.
Referenced by fillReadBuffer(), and reset().
bool QTextStreamPrivate::deleteDevice |
Definition at line 109 of file qtextstream_p.h.
Referenced by ~QTextStreamPrivate(), and reset().
QIODevice* QTextStreamPrivate::device |
Definition at line 80 of file qtextstream_p.h.
Referenced by ~QTextStreamPrivate(), consume(), fillReadBuffer(), flushWriteBuffer(), getChar(), reset(), resetReadBuffer(), and scan().
QDeviceClosedNotifier QTextStreamPrivate::deviceClosedNotifier |
Definition at line 82 of file qtextstream_p.h.
QStringConverter::Encoding QTextStreamPrivate::encoding = QStringConverter::Utf8 |
Definition at line 90 of file qtextstream_p.h.
Referenced by fillReadBuffer(), and reset().
QStringEncoder QTextStreamPrivate::fromUtf16 |
Definition at line 91 of file qtextstream_p.h.
Referenced by fillReadBuffer(), flushWriteBuffer(), and reset().
bool QTextStreamPrivate::generateBOM = false |
Definition at line 112 of file qtextstream_p.h.
Referenced by reset().
bool QTextStreamPrivate::hasWrittenData = false |
Definition at line 111 of file qtextstream_p.h.
Referenced by flushWriteBuffer(), and reset().
int QTextStreamPrivate::lastTokenSize |
Definition at line 108 of file qtextstream_p.h.
Referenced by consumeLastToken(), read(), reset(), and scan().
QLocale QTextStreamPrivate::locale |
Definition at line 105 of file qtextstream_p.h.
Referenced by getNumber(), getReal(), putNumber(), putString(), and putString().
Params QTextStreamPrivate::params |
Definition at line 101 of file qtextstream_p.h.
QTextStream* QTextStreamPrivate::q_ptr |
Definition at line 106 of file qtextstream_p.h.
Referenced by QTextStreamPrivate().
QString QTextStreamPrivate::readBuffer |
Definition at line 96 of file qtextstream_p.h.
int QTextStreamPrivate::readBufferOffset |
Definition at line 97 of file qtextstream_p.h.
Referenced by consume(), fillReadBuffer(), read(), readPtr(), reset(), resetReadBuffer(), scan(), and ungetChar().
qint64 QTextStreamPrivate::readBufferStartDevicePos |
Definition at line 99 of file qtextstream_p.h.
Referenced by reset(), resetReadBuffer(), and saveConverterState().
int QTextStreamPrivate::readConverterSavedStateOffset |
Definition at line 98 of file qtextstream_p.h.
Referenced by consume(), and saveConverterState().
QStringDecoder QTextStreamPrivate::savedToUtf16 |
Definition at line 93 of file qtextstream_p.h.
Referenced by restoreToSavedConverterState(), and saveConverterState().
QTextStream::Status QTextStreamPrivate::status |
Definition at line 104 of file qtextstream_p.h.
Referenced by flushWriteBuffer().
QString* QTextStreamPrivate::string |
Definition at line 86 of file qtextstream_p.h.
int QTextStreamPrivate::stringOffset |
Definition at line 87 of file qtextstream_p.h.
Referenced by consume(), getChar(), read(), readPtr(), reset(), scan(), and ungetChar().
QIODevice::OpenMode QTextStreamPrivate::stringOpenMode |
Definition at line 88 of file qtextstream_p.h.
Referenced by reset().
QStringDecoder QTextStreamPrivate::toUtf16 |
Definition at line 92 of file qtextstream_p.h.
Referenced by fillReadBuffer(), reset(), restoreToSavedConverterState(), and saveConverterState().
QString QTextStreamPrivate::writeBuffer |
Definition at line 95 of file qtextstream_p.h.