qtextstream
public:
enum RealNumberNotation {
SmartNotation,
FixedNotation,
ScientificNotation
};
enum FieldAlignment {
AlignLeft,
AlignRight,
AlignCenter,
AlignAccountingStyle
};
enum Status {
Ok,
ReadPastEnd,
ReadCorruptData,
WriteFailed
};
enum NumberFlag {
ShowBase = 0x1,
ForcePoint = 0x2,
ForceSign = 0x4,
UppercaseBase = 0x8,
UppercaseDigits = 0x10
};
Q_DECLARE_FLAGS(NumberFlags, NumberFlag)
QTextStream();
explicit QTextStream(QIODevice *device);
explicit QTextStream(FILE *fileHandle, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
explicit QTextStream(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
explicit QTextStream(QByteArray *array, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
explicit QTextStream(const QByteArray &array, QIODevice::OpenMode openMode = QIODevice::ReadOnly);
virtual ~QTextStream();
#ifndef QT_NO_TEXTCODEC
void setCodec(QTextCodec *codec);
void setCodec(const char *codecName);
QTextCodec *codec() const;
void setAutoDetectUnicode(bool enabled);
bool autoDetectUnicode() const;
void setGenerateByteOrderMark(bool generate);
bool generateByteOrderMark() const;
#endif
void setLocale(const QLocale &locale);
QLocale locale() const;
void setDevice(QIODevice *device);
QIODevice *device() const;
void setString(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
QString *string() const;
Status status() const;
void setStatus(Status status);
void resetStatus();
bool atEnd() const;
void reset();
void flush();
bool seek(qint64 pos);
qint64 pos() const;
void skipWhiteSpace();
QString readLine(qint64 maxlen = 0);
QString readAll();
QString read(qint64 maxlen);
void setFieldAlignment(FieldAlignment alignment);
FieldAlignment fieldAlignment() const;
void setPadChar(QChar ch);
QChar padChar() const;
void setFieldWidth(int width);
int fieldWidth() const;
void setNumberFlags(NumberFlags flags);
NumberFlags numberFlags() const;
void setIntegerBase(int base);
int integerBase() const;
void setRealNumberNotation(RealNumberNotation notation);
RealNumberNotation realNumberNotation() const;
void setRealNumberPrecision(int precision);
int realNumberPrecision() const;
QTextStream &operator>>(QChar &ch);
QTextStream &operator>>(char &ch);
QTextStream &operator>>(signed short &i);
QTextStream &operator>>(unsigned short &i);
QTextStream &operator>>(signed int &i);
QTextStream &operator>>(unsigned int &i);
QTextStream &operator>>(signed long &i);
QTextStream &operator>>(unsigned long &i);
QTextStream &operator>>(qlonglong &i);
QTextStream &operator>>(qulonglong &i);
QTextStream &operator>>(float &f);
QTextStream &operator>>(double &f);
QTextStream &operator>>(QString &s);
QTextStream &operator>>(QByteArray &array);
QTextStream &operator>>(char *c);
QTextStream &operator<<(QBool b);
QTextStream &operator<<(QChar ch);
QTextStream &operator<<(char ch);
QTextStream &operator<<(signed short i);
QTextStream &operator<<(unsigned short i);
QTextStream &operator<<(signed int i);
QTextStream &operator<<(unsigned int i);
QTextStream &operator<<(signed long i);
QTextStream &operator<<(unsigned long i);
QTextStream &operator<<(qlonglong i);
QTextStream &operator<<(qulonglong i);
QTextStream &operator<<(float f);
QTextStream &operator<<(double f);
QTextStream &operator<<(const QString &s);
QTextStream &operator<<(const QByteArray &array);
QTextStream &operator<<(const char *c);
QTextStream &operator<<(const void *ptr);
#ifdef QT3_SUPPORT
inline QT3_SUPPORT int flags() const { return flagsInternal(); }
inline QT3_SUPPORT int flags(int f) { return flagsInternal(f); }
inline QT3_SUPPORT int setf(int bits)
{ int old = flagsInternal(); flagsInternal(flagsInternal() | bits); return old; }
inline QT3_SUPPORT int setf(int bits, int mask)
{ int old = flagsInternal(); flagsInternal(flagsInternal() | (bits & mask)); return old; }
inline QT3_SUPPORT int unsetf(int bits)
{ int old = flagsInternal(); flagsInternal(flagsInternal() & ~bits); return old; }
inline QT3_SUPPORT int width(int w)
{ int old = fieldWidth(); setFieldWidth(w); return old; }
inline QT3_SUPPORT int fill(int f)
{ QChar ch = padChar(); setPadChar(QChar(f)); return ch.unicode(); }
inline QT3_SUPPORT int precision(int p)
{ int old = realNumberPrecision(); setRealNumberPrecision(p); return old; }
enum {
skipws = 0x0001,
left = 0x0002,
right = 0x0004,
internal = 0x0008,
bin = 0x0010,
oct = 0x0020,
dec = 0x0040,
hex = 0x0080,
showbase = 0x0100,
showpoint = 0x0200,
uppercase = 0x0400,
showpos = 0x0800,
scientific = 0x1000,
fixed = 0x2000
};
enum {
basefield = bin | oct | dec | hex,
adjustfield = left | right | internal,
floatfield = scientific | fixed
};
#ifndef QT_NO_TEXTCODEC
enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder,
UnicodeReverse, RawUnicode, UnicodeUTF8 };
QT3_SUPPORT void setEncoding(Encoding encoding);
#endif
inline QT3_SUPPORT QString read() { return readAll(); }
inline QT3_SUPPORT void unsetDevice() { setDevice(0); }
#endif