Falkon Develop
Cross-platform Qt-based web browser
QmlFileUtils Class Reference

The QmlFileUtils class, exposed to QML as FileUtils. More...

#include <qmlfileutils.h>

Inheritance diagram for QmlFileUtils:

Public Member Functions

 QmlFileUtils (const QString &filePath, QObject *parent=nullptr)
 
Q_INVOKABLE QString resolve (const QString &filePath)
 Get the path of the file within the plugin directory. If the filePath provided is resolved to be outside the plugin directory then empty string is returned. More...
 
Q_INVOKABLE QByteArray readAllFileContents (const QString &fileName)
 Read the contents of the file within the plugin directory. More...
 
Q_INVOKABLE bool exists (const QString &filePath)
 Checks if the file exists within the plugin directory. More...
 

Detailed Description

The QmlFileUtils class, exposed to QML as FileUtils.

Definition at line 25 of file qmlfileutils.h.

Constructor & Destructor Documentation

◆ QmlFileUtils()

QmlFileUtils::QmlFileUtils ( const QString &  filePath,
QObject *  parent = nullptr 
)
explicit

Definition at line 25 of file qmlfileutils.cpp.

Member Function Documentation

◆ exists()

bool QmlFileUtils::exists ( const QString &  filePath)

Checks if the file exists within the plugin directory.

Parameters
filepath within the plugin directory
Returns
true if file exists, otherwise false

Definition at line 47 of file qmlfileutils.cpp.

◆ readAllFileContents()

QByteArray QmlFileUtils::readAllFileContents ( const QString &  fileName)

Read the contents of the file within the plugin directory.

Parameters
filepath within the plugin directory
Returns
contents of the file

Definition at line 41 of file qmlfileutils.cpp.

◆ resolve()

QString QmlFileUtils::resolve ( const QString &  filePath)

Get the path of the file within the plugin directory. If the filePath provided is resolved to be outside the plugin directory then empty string is returned.

Parameters
filepath within the plugin directory
Returns
resolved path

Definition at line 31 of file qmlfileutils.cpp.


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