⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qtextstream.3qt

📁 Linux 下的图形编程环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QTextStream 3qt "5 March 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQTextStream \- Basic functions for reading and writing text using a.br.PP\fC#include <qtextstream.h>\fR.PPInherited by QTextIStream and QTextOStream..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBEncoding\fR { Locale, Latin1, Unicode, UnicodeNetworkOrder, UnicodeReverse, RawUnicode, UnicodeUTF8 }".br.ti -1c.BI "void \fBsetEncoding\fR ( Encoding ) ".br.ti -1c.BI "void \fBsetCodec\fR ( QTextCodec * ) ".br.ti -1c.BI "\fBQTextStream\fR () ".br.ti -1c.BI "\fBQTextStream\fR ( QIODevice * ) ".br.ti -1c.BI "\fBQTextStream\fR ( QString *, int mode ) ".br.ti -1c.BI "QTextStream ( QString &, int mode ) \fI(obsolete)\fR".br.ti -1c.BI "\fBQTextStream\fR ( QByteArray, int mode ) ".br.ti -1c.BI "\fBQTextStream\fR ( FILE *, int mode ) ".br.ti -1c.BI "virtual \fB~QTextStream\fR () ".br.ti -1c.BI "QIODevice* \fBdevice\fR () const".br.ti -1c.BI "void \fBsetDevice\fR ( QIODevice * ) ".br.ti -1c.BI "void \fBunsetDevice\fR () ".br.ti -1c.BI "bool \fBatEnd\fR () const".br.ti -1c.BI "bool eof () const \fI(obsolete)\fR".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( QChar & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( char & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( signed short & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( unsigned short & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( signed int & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( unsigned int & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( signed long & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( unsigned long & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( float & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( double & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( char * ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( QString & ) ".br.ti -1c.BI "QTextStream& \fBoperator>>\fR ( QCString & ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( QChar ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( char ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( signed short ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( unsigned short ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( signed int ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( unsigned int ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( signed long ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( unsigned long ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( float ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( double ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( const char * ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( const QString & ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( const QCString & ) ".br.ti -1c.BI "QTextStream& \fBoperator<<\fR ( void * ) ".br.ti -1c.BI "QTextStream& \fBreadRawBytes\fR ( char *, uint len ) ".br.ti -1c.BI "QTextStream& \fBwriteRawBytes\fR ( const char *, uint len ) ".br.ti -1c.BI "QString \fBreadLine\fR () ".br.ti -1c.BI "QString \fBread\fR () ".br.ti -1c.BI "void \fBskipWhiteSpace\fR () ".br.ti -1c.BI "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 }".br.ti -1c.BI "int \fBflags\fR () const".br.ti -1c.BI "int \fBflags\fR ( int f ) ".br.ti -1c.BI "int \fBsetf\fR ( int bits ) ".br.ti -1c.BI "int \fBsetf\fR ( int " "bits" ", int mask ) ".br.ti -1c.BI "int \fBunsetf\fR ( int bits ) ".br.ti -1c.BI "void \fBreset\fR () ".br.ti -1c.BI "int \fBwidth\fR () const".br.ti -1c.BI "int \fBwidth\fR ( int ) ".br.ti -1c.BI "int \fBfill\fR () const".br.ti -1c.BI "int \fBfill\fR ( int ) ".br.ti -1c.BI "int \fBprecision\fR () const".br.ti -1c.BI "int \fBprecision\fR ( int ) ".br.in -1c.SH DESCRIPTIONThe QTextStream class provides basic functions for reading and writing text using a QIODevice..PPThe text stream class has a functional interface that is very similar to that of the standard C++ iostream class. The difference between iostream and QTextStream is that our stream operates on a QIODevice, which is easily subclassed, while iostream operates on FILE * pointers, which can not be subclassed..PPQt provides several global functions similar to the ones in iostream:.TP\fCbin\fR sets the QTextStream to read/write binary numbers.TP\fCoct\fR sets the QTextStream to read/write octal numbers.TP\fCdec\fR sets the QTextStream to read/write decimal numbers.TP\fChex\fR sets the QTextStream to read/write hexadecimal numbers.TP\fCendl\fR forces a line break.TP\fCflush\fR forces the QIODevice to flush any buffered data.TP\fCws\fR eats any available white space (on input).TP\fCreset\fR resets the QTextStream to its default mode (see reset())..PP\fBWarning:\fR By default, QTextStream will automatically detect whether integers in the stream are in decimal, octal, hexadecimal or binary format when reading from the stream. In particular, a leading '0' signifies octal, ie. the sequence "0100" will be interpreted as 64..PPThe QTextStream class reads and writes text and it is not appropriate for dealing with binary data (but QDataStream is)..PPBy default output of Unicode text (ie. QString) is done using the local 8-bit encoding. This can be changed using the setEncoding() method. For input, the QTextStream will auto-detect standard Unicode "byte order marked" text files, but otherwise the local 8-bit encoding is used..PPSee also QDataStream..PPExamples:.(lgrapher/grapher.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QTextStream::QTextStream ()"Constructs a data stream that has no IO device..SH "QTextStream::QTextStream ( QByteArray a, int mode )"Constructs a text stream that operates on a byte array through an internal QBuffer device..PPExample:.PP.nf.br    QByteArray array;.br    QTextStream ts( array, IO_WriteOnly );.br    ts << "pi = " << 3.14 << '\\0';              // array == "pi = 3.14".fi.PPWriting data to the text stream will modify the contents of the array. The array will be expanded when data is written beyond the end of the string..PPSame example, using a QBuffer:.PP.nf.br    QByteArray array;.br    QBuffer buf( array );.br    buf.open( IO_WriteOnly );.br    QTextStream ts( &buf );.br    ts << "pi = " << 3.14 << '\\0';              // array == "pi = 3.14".br    buf.close();.fi.SH "QTextStream::QTextStream ( QIODevice * iod )"Constructs a text stream that uses the IO device \fIiod.\fR.SH "QTextStream::QTextStream ( QString & str, int filemode )"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPThis constructor is equivalent to the constructor taking a QString* parameter..SH "QTextStream::QTextStream ( QString * str, int filemode )"Constructs a text stream that operates on a Unicode QString through an internal device..PPIf you set an encoding or codec with setEncoding() or setCodec(), this setting is ignored for text streams that operate on QString..PPExample:.PP.nf.br    QString str;.br

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -