Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QIOSFileEngineFactory Class Reference

#include <qiosfileenginefactory.h>

Inheritance diagram for QIOSFileEngineFactory:
Collaboration diagram for QIOSFileEngineFactory:

Public Member Functions

 QIOSFileEngineFactory ()=default
std::unique_ptr< QAbstractFileEnginecreate (const QString &fileName) const
 If this file handler can handle fileName, this method creates a file engine and returns it wrapped in a std::unique_ptr; otherwise returns nullptr.
Public Member Functions inherited from QAbstractFileEngineHandler
 QAbstractFileEngineHandler ()
 Constructs a file handler and registers it with Qt.
virtual ~QAbstractFileEngineHandler ()
 Destroys the file handler.

Detailed Description

Definition at line 14 of file qiosfileenginefactory.h.

Constructor & Destructor Documentation

◆ QIOSFileEngineFactory()

QIOSFileEngineFactory::QIOSFileEngineFactory ( )
default

Member Function Documentation

◆ create()

std::unique_ptr< QAbstractFileEngine > QIOSFileEngineFactory::create ( const QString & fileName) const
inlinevirtual

If this file handler can handle fileName, this method creates a file engine and returns it wrapped in a std::unique_ptr; otherwise returns nullptr.

Example:

std::unique_ptr<QAbstractFileEngine> ZipEngineHandler::create(const QString &fileName) const
{
// ZipEngineHandler returns a ZipEngine for all .zip files
if (fileName.toLower().endsWith(".zip"_L1))
return std::make_unique<ZipEngine>(fileName);
else
return {};
}
See also
QAbstractFileEngine::create()

Implements QAbstractFileEngineHandler.

Definition at line 20 of file qiosfileenginefactory.h.


The documentation for this class was generated from the following file: