diff options
author | Simon Sasburg <simon.sasburg@gmail.com> | 2014-07-21 19:28:43 +0100 |
---|---|---|
committer | Simon Sasburg <simon.sasburg@gmail.com> | 2014-07-23 07:20:40 +0200 |
commit | 3905c6f00d9d11e01d6e211565d5ed58a59fc2d8 (patch) | |
tree | b78f3e518bd879cd7c163da26162e595ad2ade9c /src/corelib/io/qfiledevice.cpp | |
parent | f713bd3e19406e02502fe1dc877f09ae57eca8df (diff) |
Add QFileDevice::MemoryMapFlags::MapPrivateOption flag.
Passing this flag to QFileDevice::map() will allow writes to the mapped memory
without modifying the file that was mapped. These writes will be lost when the
memory is unmapped.
Change-Id: I7d46b044fc370585de8c06fdb4059f1f1be12d7d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/corelib/io/qfiledevice.cpp')
-rw-r--r-- | src/corelib/io/qfiledevice.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp index f7e58a7bed..33cb6037f5 100644 --- a/src/corelib/io/qfiledevice.cpp +++ b/src/corelib/io/qfiledevice.cpp @@ -680,6 +680,13 @@ bool QFileDevice::setPermissions(Permissions permissions) function. \value NoOptions No options. + \value MapPrivateOption The mapped memory will be private, so any + modifications will not be visible to other processes and will not + be written to disk. Any such modifications will be lost when the + memory is unmapped. It is unspecified whether modifications made + to the file made after the mapping is created will be visible through + the mapped memory. This flag is not supported on Windows CE. + This enum value was introduced in Qt 5.4. */ /*! @@ -689,6 +696,10 @@ bool QFileDevice::setPermissions(Permissions permissions) or a new file is opened with this object, any maps that have not been unmapped will automatically be unmapped. + The mapping will have the same open mode as the file (read and/or write), + except when using MapPrivateOption, in which case it is always possible + to write to the mapped memory. + Any mapping options can be passed through \a flags. Returns a pointer to the memory or 0 if there is an error. |