8#include <QtCore/qiodevicebase.h>
9#include <QtCore/qchar.h>
10#include <QtCore/qstringconverter_base.h>
18#pragma qt_class(QTextStream)
22#error qtextstream.h must be included before any header file that defines Status
31#if !QT_DEPRECATED_SINCE(6
, 9
)
32# define QT_NO_INHERITABLE_TEXT_STREAM
35#ifdef QT_NO_INHERITABLE_TEXT_STREAM
36# define QT_TEXT_STREAM_FINAL final
38# define QT_TEXT_STREAM_FINAL
44 Q_DECLARE_PRIVATE(QTextStream)
47 enum RealNumberNotation {
69 UppercaseDigits = 0x10
71 Q_DECLARE_FLAGS(NumberFlags, NumberFlag)
74 explicit QTextStream(QIODevice *device);
75 explicit QTextStream(FILE *fileHandle, OpenMode openMode = ReadWrite);
76 explicit QTextStream(QString *string, OpenMode openMode = ReadWrite);
77 explicit QTextStream(QByteArray *array, OpenMode openMode = ReadWrite);
78 explicit QTextStream(
const QByteArray &array, OpenMode openMode = ReadOnly);
82 void setEncoding(QStringConverter::Encoding encoding);
83 QStringConverter::Encoding encoding()
const;
84 void setAutoDetectUnicode(
bool enabled);
85 bool autoDetectUnicode()
const;
86 void setGenerateByteOrderMark(
bool generate);
87 bool generateByteOrderMark()
const;
89 void setLocale(
const QLocale &locale);
90 QLocale locale()
const;
92 void setDevice(QIODevice *device);
93 QIODevice *device()
const;
95 void setString(QString *string, OpenMode openMode = ReadWrite);
96 QString *string()
const;
98 Status status()
const;
99 void setStatus(Status status);
105 bool seek(qint64 pos);
108 void skipWhiteSpace();
110 QString readLine(qint64 maxlen = 0);
111 bool readLineInto(QString *line, qint64 maxlen = 0);
113 QString read(qint64 maxlen);
115 void setFieldAlignment(FieldAlignment alignment);
116 FieldAlignment fieldAlignment()
const;
118 void setPadChar(QChar ch);
119 QChar padChar()
const;
121 void setFieldWidth(
int width);
122 int fieldWidth()
const;
124 void setNumberFlags(NumberFlags flags);
125 NumberFlags numberFlags()
const;
127 void setIntegerBase(
int base);
128 int integerBase()
const;
130 void setRealNumberNotation(RealNumberNotation notation);
131 RealNumberNotation realNumberNotation()
const;
133 void setRealNumberPrecision(
int precision);
134 int realNumberPrecision()
const;
136 QTextStream &operator>>(QChar &ch);
137 QTextStream &operator>>(
char &ch);
138 QTextStream &operator>>(
char16_t &ch)
139 { QChar c; *
this >> c; ch = c.unicode();
return *
this; }
140 QTextStream &operator>>(
signed short &i);
141 QTextStream &operator>>(
unsigned short &i);
142 QTextStream &operator>>(
signed int &i);
143 QTextStream &operator>>(
unsigned int &i);
144 QTextStream &operator>>(
signed long &i);
145 QTextStream &operator>>(
unsigned long &i);
146 QTextStream &operator>>(qlonglong &i);
147 QTextStream &operator>>(qulonglong &i);
148 QTextStream &operator>>(
float &f);
149 QTextStream &operator>>(
double &f);
150 QTextStream &operator>>(QString &s);
151 QTextStream &operator>>(QByteArray &array);
152 QTextStream &operator>>(
char *c);
154 QTextStream &operator<<(QChar ch);
155 QTextStream &operator<<(
char ch);
156 QTextStream &operator<<(
char16_t ch) {
return *
this << QChar(ch); }
157 QTextStream &operator<<(
signed short i);
158 QTextStream &operator<<(
unsigned short i);
159 QTextStream &operator<<(
signed int i);
160 QTextStream &operator<<(
unsigned int i);
161 QTextStream &operator<<(
signed long i);
162 QTextStream &operator<<(
unsigned long i);
163 QTextStream &operator<<(qlonglong i);
164 QTextStream &operator<<(qulonglong i);
165 QTextStream &operator<<(
float f);
166 QTextStream &operator<<(
double f);
167 QTextStream &operator<<(
const QString &s);
168 QTextStream &operator<<(QStringView s);
169 QTextStream &operator<<(QLatin1StringView s);
170 QTextStream &operator<<(
const QByteArray &array);
171 QTextStream &operator<<(
const char *c);
172 QTextStream &operator<<(
const void *ptr);
174 explicit operator
bool()
const noexcept {
return status() == Ok; }
177 Q_DISABLE_COPY(QTextStream)
178 friend class QDebugStateSaverPrivate;
181 std::unique_ptr<QTextStreamPrivate> d_ptr;
184Q_DECLARE_OPERATORS_FOR_FLAGS(QTextStream::NumberFlags)
187
188
190typedef QTextStream & (*QTextStreamFunction)(QTextStream &);
191typedef void (QTextStream::*QTSMFI)(
int);
192typedef void (QTextStream::*QTSMFC)(QChar);
198 constexpr QTextStreamManipulator(QTSMFI m,
int a)
noexcept : mf(m), mc(
nullptr), arg(a), ch() {}
199 constexpr QTextStreamManipulator(QTSMFC m, QChar c)
noexcept : mf(
nullptr), mc(m), arg(-1), ch(c) {}
200 void exec(QTextStream &s) {
if (mf) { (s.*mf)(arg); }
else { (s.*mc)(ch); } }
216{ m.exec(s);
return s; }
255 QTSMFI func = &QTextStream::setFieldWidth;
256 return QTextStreamManipulator(func,width);
261 QTSMFC func = &QTextStream::setPadChar;
262 return QTextStreamManipulator(func, ch);
267 QTSMFI func = &QTextStream::setRealNumberPrecision;
268 return QTextStreamManipulator(func, precision);
QFileSystemWatcherPathKey(const QFileSystemWatcherPathKey &other)
bool operator==(const QFileSystemWatcherPathKey &other) const
QFileSystemWatcherPathKey(const QString &other)
QFileSystemWatcherPathKey()
~QWindowsFileSystemWatcherEngineThread()
HandleForDirHash handleForDir
void directoryChanged(const QString &path, bool removed)
QList< Qt::HANDLE > handles
QHash< Qt::HANDLE, PathInfoHash > pathInfoForHandle
QWindowsFileSystemWatcherEngineThread()
QHash< QFileSystemWatcherPathKey, QWindowsFileSystemWatcherEngine::PathInfo > PathInfoHash
bool operator!=(const QFileInfo &fileInfo) const
QFile::Permissions permissions
PathInfo & operator=(const QFileInfo &fileInfo)
QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) override
~QWindowsFileSystemWatcherEngine()
void driveLockForRemovalFailed(const QString &)
QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) override
void driveRemoved(const QString &)
void addPath(const QString &path)
void driveLockForRemovalFailed(const QString &)
void driveLockForRemoval(const QString &)
void driveRemoved(const QString &)
~QWindowsRemovableDriveListener()
bool nativeEventFilter(const QByteArray &, void *messageIn, qintptr *) override
This method is called for every native event.
QWindowsRemovableDriveListener(QObject *parent=nullptr)
QT_FORWARD_DECLARE_CLASS(QTextStream)
static Qt::HANDLE createChangeNotification(const QString &path, uint flags)
static Iterator findByHDevNotify(Iterator i1, Iterator i2, HDEVNOTIFY hdevnotify)
static void stopDeviceNotification(QWindowsRemovableDriveListener::RemovableDriveEntry &e)
static QString pathFromEntry(const QWindowsRemovableDriveListener::RemovableDriveEntry &re)
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
Q_DECLARE_TYPEINFO(QFileSystemWatcherPathKey, Q_RELOCATABLE_TYPE)
QTextStream & operator>>(QTextStream &s, QTextStreamFunction f)
QTextStreamManipulator qSetPadChar(QChar ch)
QTextStreamManipulator qSetRealNumberPrecision(int precision)
#define QT_TEXT_STREAM_FINAL
QTextStreamManipulator qSetFieldWidth(int width)
QTextStream & operator<<(QTextStream &s, QTextStreamFunction f)