diff options
author | Richard Moore <rich@kde.org> | 2012-02-19 15:55:29 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-22 00:07:31 +0100 |
commit | 28401bf747d8ca81c9fe3179e8e59f779828a4a3 (patch) | |
tree | 5325c62e6f05f69a78b79880fa8d5509e5b8fad9 | |
parent | 5f5f9f33be4f21cdf925482898042bb792d53a78 (diff) |
Merge overloads
Fixes ### Qt 5
Change-Id: I2846593616635440e17c8a9ce518780561992b84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/io/qfile.cpp | 79 | ||||
-rw-r--r-- | src/corelib/io/qfile.h | 6 |
2 files changed, 2 insertions, 83 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 58935fad3b..1879e8b36a 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -1028,52 +1028,6 @@ bool QFile::open(OpenMode mode) Example: \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 3 - When a QFile is opened using this function, close() does not actually - close the file, but only flushes it. - - \bold{Warning:} - \list 1 - \o If \a fh does not refer to a regular file, e.g., it is \c stdin, - \c stdout, or \c stderr, you may not be able to seek(). size() - returns \c 0 in those cases. See QIODevice::isSequential() for - more information. - \o Since this function opens the file without specifying the file name, - you cannot use this QFile with a QFileInfo. - \endlist - - \note For Windows CE you may not be able to call resize(). - - \sa close(), {qmake Variable Reference#CONFIG}{qmake Variable Reference} - - \bold{Note for the Windows Platform} - - \a fh must be opened in binary mode (i.e., the mode string must contain - 'b', as in "rb" or "wb") when accessing files and other random-access - devices. Qt will translate the end-of-line characters if you pass - QIODevice::Text to \a mode. Sequential devices, such as stdin and stdout, - are unaffected by this limitation. - - You need to enable support for console applications in order to use the - stdin, stdout and stderr streams at the console. To do this, add the - following declaration to your application's project file: - - \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 4 -*/ -// ### Qt5: merge this into new overload with a default parameter -bool QFile::open(FILE *fh, OpenMode mode) -{ - return open(fh, mode, DontCloseHandle); -} - -/*! - \overload - - Opens the existing file handle \a fh in the given \a mode. - Returns true if successful; otherwise returns false. - - Example: - \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 3 - When a QFile is opened using this function, behaviour of close() is controlled by the AutoCloseHandle flag. If AutoCloseHandle is specified, and this function succeeds, @@ -1142,39 +1096,6 @@ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags) Opens the existing file descriptor \a fd in the given \a mode. Returns true if successful; otherwise returns false. - When a QFile is opened using this function, close() does not - actually close the file. - - The QFile that is opened using this function is automatically set - to be in raw mode; this means that the file input/output functions - are slow. If you run into performance issues, you should try to - use one of the other open functions. - - \warning If \a fd is not a regular file, e.g, it is 0 (\c stdin), - 1 (\c stdout), or 2 (\c stderr), you may not be able to seek(). In - those cases, size() returns \c 0. See QIODevice::isSequential() - for more information. - - \warning For Windows CE you may not be able to call seek(), setSize(), - fileTime(). size() returns \c 0. - - \warning Since this function opens the file without specifying the file name, - you cannot use this QFile with a QFileInfo. - - \sa close() -*/ -// ### Qt5: merge this into new overload with a default parameter -bool QFile::open(int fd, OpenMode mode) -{ - return open(fd, mode, DontCloseHandle); -} - -/*! - \overload - - Opens the existing file descriptor \a fd in the given \a mode. - Returns true if successful; otherwise returns false. - When a QFile is opened using this function, behaviour of close() is controlled by the AutoCloseHandle flag. If AutoCloseHandle is specified, and this function succeeds, diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h index bf7290dda2..7f370d4214 100644 --- a/src/corelib/io/qfile.h +++ b/src/corelib/io/qfile.h @@ -144,10 +144,8 @@ public: bool isSequential() const; bool open(OpenMode flags); - bool open(FILE *f, OpenMode flags); - bool open(int fd, OpenMode flags); - bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags); - bool open(int fd, OpenMode ioFlags, FileHandleFlags handleFlags); + bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags=DontCloseHandle); + bool open(int fd, OpenMode ioFlags, FileHandleFlags handleFlags=DontCloseHandle); virtual void close(); qint64 size() const; |