diff options
Diffstat (limited to 'src/corelib/doc/src/filestorage.qdoc')
-rw-r--r-- | src/corelib/doc/src/filestorage.qdoc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/corelib/doc/src/filestorage.qdoc b/src/corelib/doc/src/filestorage.qdoc index fb1279cea5..394d920923 100644 --- a/src/corelib/doc/src/filestorage.qdoc +++ b/src/corelib/doc/src/filestorage.qdoc @@ -30,15 +30,15 @@ \title File and Datastream Functions The QIODevice class is the base interface class of all I/O devices in -\l {Qt Core}. QIODevice provides both a common implementation and an +\l{Qt Core}. QIODevice provides both a common implementation and an abstract interface for devices that support reading and writing of blocks of data. The device can be a memory buffer, a file, or a datastream. Some subclasses like QFile have been implemented using a memory buffer for intermediate storing of data. This speeds up programs by reducing -read/write operations. Buffering makes functions like getChar() and putChar() -fast, as they can operate on the memory buffer instead of directly on the -device itself. +read/write operations. Buffering makes functions like \l{QFile::}{getChar()} and +\l{QFile::}{putChar()} fast, as they can operate on the memory buffer instead of +directly on the device itself. The QFile class provides functions for reading from and writing to files. A QFile may be used by itself or, more conveniently, with a QTextStream or @@ -48,6 +48,7 @@ QBuffer allows you to access a QByteArray using the QIODevice interface. The QByteArray is treated just as a standard random-accessed file. An example: +\code QBuffer buffer; char ch; @@ -58,12 +59,13 @@ An example: buffer.getChar(&ch); // ch == 't' buffer.getChar(&ch); // ch == ' ' buffer.getChar(&ch); // ch == 'r' +\endcode -Call open() to open the buffer. Then call write() or putChar() to write to -the buffer, and read(), readLine(), readAll(), or getChar() to read from it. -size() returns the current size of the buffer, and you can seek to arbitrary -positions in the buffer by calling seek(). When you are done with accessing -the buffer, call close(). +Call \l{QBuffer::}{open()} to open the buffer. Then call \l{QBuffer::}{write()} or \l{QBuffer::}{putChar()} to write to +the buffer, and \l{QBuffer::}{read()}, \l{QBuffer::}{readLine()}, \l{QBuffer::}{readAll()}, or \l{QBuffer::}{getChar()} to read from it. +\l{QBuffer::}{size()} returns the current size of the buffer, and you can seek to arbitrary +positions in the buffer by calling \l{QBuffer::}{seek()}. When you are done with accessing +the buffer, call \l{QBuffer::}{close()}. The QDataStream class provides serialization of binary data to a QIODevice. A data stream is a binary stream of encoded information which is 100% inde- @@ -91,7 +93,7 @@ There are three general ways to use QTextStream when reading text files: \li Character by character, by streaming into QChar or char types. This method is often used for convenient input handling when parsing files, independent of character encoding and end-of-line semantics. To skip - white space, call skipWhiteSpace(). + white space, call \l{QTextStream::}{skipWhiteSpace()}. \endlist QByteArray can be used to store both raw bytes (including \c{\0}) and traditional |