mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Added documentation for FileUtils API
This commit is contained in:
parent
68201ffe59
commit
dfb7efee5e
@ -19,13 +19,33 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The QmlFileUtils class, exposed to QML as FileUtils
|
||||||
|
*/
|
||||||
class QmlFileUtils : public QObject
|
class QmlFileUtils : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QmlFileUtils(QString filePath, QObject *parent = nullptr);
|
explicit QmlFileUtils(QString filePath, QObject *parent = nullptr);
|
||||||
|
/**
|
||||||
|
* @brief 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
|
||||||
|
* @param file path within the plugin directory
|
||||||
|
* @return resolved path
|
||||||
|
*/
|
||||||
Q_INVOKABLE QString resolve(const QString &filePath);
|
Q_INVOKABLE QString resolve(const QString &filePath);
|
||||||
|
/**
|
||||||
|
* @brief Read the contents of the file within the plugin directory
|
||||||
|
* @param file path within the plugin directory
|
||||||
|
* @return contents of the file
|
||||||
|
*/
|
||||||
Q_INVOKABLE QString readAllFileContents(const QString &fileName);
|
Q_INVOKABLE QString readAllFileContents(const QString &fileName);
|
||||||
|
/**
|
||||||
|
* @brief Checks if the file exists within the plugin directory
|
||||||
|
* @param file path within the plugin directory
|
||||||
|
* @return true if file exists, otherwise false
|
||||||
|
*/
|
||||||
Q_INVOKABLE bool exists(const QString &filePath);
|
Q_INVOKABLE bool exists(const QString &filePath);
|
||||||
private:
|
private:
|
||||||
QString m_path;
|
QString m_path;
|
||||||
|
Loading…
Reference in New Issue
Block a user