45 #include <QtCore/qiodevice.h> 46 #include <QtCore/qstring.h> 47 #include <QtCore/qchar.h> 48 #include <QtCore/qlocale.h> 49 #include <QtCore/qscopedpointer.h> 51 #ifndef QT_NO_TEXTCODEC 53 # include <QtCore/qtextcodec.h> 60 #error qtextstream.h must be included before any header file that defines Status 100 UppercaseDigits = 0x10
112 #ifndef QT_NO_TEXTCODEC 114 void setCodec(
const char *codecName);
116 void setAutoDetectUnicode(
bool enabled);
117 bool autoDetectUnicode()
const;
118 void setGenerateByteOrderMark(
bool generate);
119 bool generateByteOrderMark()
const;
122 void setLocale(
const QLocale &locale);
141 void skipWhiteSpace();
150 void setPadChar(
QChar ch);
151 QChar padChar()
const;
153 void setFieldWidth(
int width);
154 int fieldWidth()
const;
156 void setNumberFlags(NumberFlags flags);
157 NumberFlags numberFlags()
const;
159 void setIntegerBase(
int base);
160 int integerBase()
const;
165 void setRealNumberPrecision(
int precision);
166 int realNumberPrecision()
const;
205 inline QT3_SUPPORT
int flags()
const {
return flagsInternal(); }
206 inline QT3_SUPPORT
int flags(
int f) {
return flagsInternal(f); }
208 inline QT3_SUPPORT
int setf(
int bits)
209 {
int old = flagsInternal(); flagsInternal(flagsInternal() | bits);
return old; }
210 inline QT3_SUPPORT
int setf(
int bits,
int mask)
211 {
int old = flagsInternal(); flagsInternal(flagsInternal() | (bits & mask));
return old; }
212 inline QT3_SUPPORT
int unsetf(
int bits)
213 {
int old = flagsInternal(); flagsInternal(flagsInternal() & ~bits);
return old; }
215 inline QT3_SUPPORT
int width(
int w)
216 {
int old = fieldWidth(); setFieldWidth(w);
return old; }
217 inline QT3_SUPPORT
int fill(
int f)
219 inline QT3_SUPPORT
int precision(
int p)
220 {
int old = realNumberPrecision(); setRealNumberPrecision(p);
return old; }
244 #ifndef QT_NO_TEXTCODEC 245 enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder,
246 UnicodeReverse, RawUnicode, UnicodeUTF8 };
247 QT3_SUPPORT
void setEncoding(Encoding encoding);
249 inline QT3_SUPPORT
QString read() {
return readAll(); }
250 inline QT3_SUPPORT
void unsetDevice() {
setDevice(0); }
255 int flagsInternal()
const;
256 int flagsInternal(
int flags);
271 typedef
void (QTextStream::*
QTSMFI)(
int);
279 void exec(QTextStream &s) {
if (mf) { (s.*mf)(arg); }
else { (s.*mc)(ch); } }
295 { m.
exec(s);
return s; }
377 #endif // QTEXTSTREAM_H Q_CORE_EXPORT QTextStream & bom(QTextStream &s)
QTextStream & operator>>(QTextStream &s, QTextStreamFunction f)
QTextStream()
Constructs a QTextStream.
void(QTextStream::* QTSMFI)(int)
#define QT_END_NAMESPACE
This macro expands to.
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
Q_CORE_EXPORT QTextStream & oct(QTextStream &s)
void(QTextStream::* QTSMFC)(QChar)
The QByteArray class provides an array of bytes.
Q_CORE_EXPORT QTextStream & reset(QTextStream &s)
The QTextDecoder class provides a state-based decoder.
FieldAlignment
This enum specifies how to align text in fields when the field is wider than the text that occupies i...
static LibLoadStatus status
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
void setFieldWidth(int width)
Sets the current field width to width.
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
Q_CORE_EXPORT QTextStream & uppercasedigits(QTextStream &s)
Q_CORE_EXPORT QTextStream & lowercasebase(QTextStream &s)
The QChar class provides a 16-bit Unicode character.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Q_CORE_EXPORT QTextStream & hex(QTextStream &s)
Q_CORE_EXPORT QTextStream & dec(QTextStream &s)
Q_CORE_EXPORT QTextStream & forcepoint(QTextStream &s)
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
Q_CORE_EXPORT QTextStream & fixed(QTextStream &s)
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
QTextStreamManipulator(QTSMFI m, int a)
Q_CORE_EXPORT QTextStream & bin(QTextStream &s)
static QTextCodec * codec(MYSQL *mysql)
void setRealNumberPrecision(int precision)
Sets the precision of real numbers to precision.
const T * ptr(const T &t)
handler setDevice(device)
Q_CORE_EXPORT QTextStream & showbase(QTextStream &s)
QTextStreamManipulator qSetPadChar(QChar ch)
RealNumberNotation
This enum specifies which notations to use for expressing float and double as strings.
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
QTextStream &(* QTextStreamFunction)(QTextStream &)
QTextStream & operator<<(QTextStream &s, QTextStreamFunction f)
Status
This enum describes the current status of the text stream.
The QTextStream class provides a convenient interface for reading and writing text.
void exec(QTextStream &s)
QTextStreamManipulator(QTSMFC m, QChar c)
Q_CORE_EXPORT QTextStream & forcesign(QTextStream &s)
Q_CORE_EXPORT QTextStream & noshowbase(QTextStream &s)
Q_CORE_EXPORT QTextStream & lowercasedigits(QTextStream &s)
Q_CORE_EXPORT QTextStream & flush(QTextStream &s)
QTextStreamManipulator qSetRealNumberPrecision(int precision)
Q_CORE_EXPORT QTextStream & scientific(QTextStream &s)
#define Q_DECLARE_PRIVATE(Class)
The QTextCodec class provides conversions between text encodings.
The QIODevice class is the base interface class of all I/O devices in Qt.
QTextStreamManipulator qSetFieldWidth(int width)
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
Q_CORE_EXPORT QTextStream & noforcesign(QTextStream &s)
void setPadChar(QChar ch)
Sets the pad character to ch.
Q_CORE_EXPORT QTextStream & noforcepoint(QTextStream &s)
Q_CORE_EXPORT QTextStream & uppercasebase(QTextStream &s)
NumberFlag
This enum specifies various flags that can be set to affect the output of integers, floats, and doubles.
Q_CORE_EXPORT QTextStream & endl(QTextStream &s)