MapExtensionOption. If the engine does not support this extension, 0 is
returned.
- \a flags is currently not used, but could be used in the future.
-
\sa unmap(), supportsExtension()
*/
-uchar *QAbstractFileEngine::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
+uchar *QAbstractFileEngine::map(qint64 offset, qint64 size)
{
MapExtensionOption option;
option.offset = offset;
option.size = size;
- option.flags = flags;
MapExtensionReturn r;
if (!extension(MapExtension, &option, &r))
return 0;
virtual void setFileName(const QString &file);
virtual int handle() const;
bool atEnd() const;
- uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
+ uchar *map(qint64 offset, qint64 size);
bool unmap(uchar *ptr);
typedef QAbstractFileEngineIterator Iterator;
public:
qint64 offset;
qint64 size;
- QFile::MemoryMapFlags flags;
};
class MapExtensionReturn : public ExtensionReturn {
public:
}
/*!
- \enum QFile::MemoryMapFlags
- \since 4.4
-
- This enum describes special options that may be used by the map()
- function.
-
- \value NoOptions No options.
-*/
-
-/*!
\since 4.4
Maps \a size bytes of the file into memory starting at \a offset. A file
should be open for a map to succeed but the file does not need to stay
or a new file is opened with this object, any maps that have not been
unmapped will automatically be unmapped.
- Any mapping options can be passed through \a flags.
-
Returns a pointer to the memory or 0 if there is an error.
\sa unmap(), QAbstractFileEngine::supportsExtension()
*/
-uchar *QFile::map(qint64 offset, qint64 size, MemoryMapFlags flags)
+uchar *QFile::map(qint64 offset, qint64 size)
{
Q_D(QFile);
if (fileEngine()
&& d->fileEngine->supportsExtension(QAbstractFileEngine::MapExtension)) {
unsetError();
- uchar *address = d->fileEngine->map(offset, size, flags);
+ uchar *address = d->fileEngine->map(offset, size);
if (address == 0)
d->setError(d->fileEngine->error(), d->fileEngine->errorString());
return address;
int handle() const;
- enum MemoryMapFlags {
- NoOptions = 0
- };
-
- uchar *map(qint64 offset, qint64 size, MemoryMapFlags flags = NoOptions);
+ uchar *map(qint64 offset, qint64 size);
bool unmap(uchar *address);
virtual QAbstractFileEngine *fileEngine() const;
if (extension == MapExtension) {
const MapExtensionOption *options = (MapExtensionOption*)(option);
MapExtensionReturn *returnValue = static_cast<MapExtensionReturn*>(output);
- returnValue->address = d->map(options->offset, options->size, options->flags);
+ returnValue->address = d->map(options->offset, options->size);
return (returnValue->address != 0);
}
if (extension == UnMapExtension) {
bool nativeIsSequential() const;
bool isSequentialFdFh() const;
- uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
+ uchar *map(qint64 offset, qint64 size);
bool unmap(uchar *ptr);
mutable QFileSystemMetaData metaData;
return QDateTime();
}
-uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
+uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size)
{
Q_Q(QFSFileEngine);
- Q_UNUSED(flags);
if (openMode == QIODevice::NotOpen) {
q->setError(QFile::PermissionsError, qt_error_string(int(EACCES)));
return 0;
protected:
Q_DECLARE_PUBLIC(QResourceFileEngine)
private:
- uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
+ uchar *map(qint64 offset, qint64 size);
bool unmap(uchar *ptr);
qint64 offset;
QResource resource;
if (extension == MapExtension) {
const MapExtensionOption *options = (MapExtensionOption*)(option);
MapExtensionReturn *returnValue = static_cast<MapExtensionReturn*>(output);
- returnValue->address = d->map(options->offset, options->size, options->flags);
+ returnValue->address = d->map(options->offset, options->size);
return (returnValue->address != 0);
}
if (extension == UnMapExtension) {
return (extension == UnMapExtension || extension == MapExtension);
}
-uchar *QResourceFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
+uchar *QResourceFileEnginePrivate::map(qint64 offset, qint64 size)
{
Q_Q(QResourceFileEngine);
- Q_UNUSED(flags);
if (offset < 0 || size <= 0 || !resource.isValid() || offset + size > resource.size()) {
q->setError(QFile::UnspecifiedError, QString());
return 0;