mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Added documentation for FileUtils API
This commit is contained in:
parent
68201ffe59
commit
dfb7efee5e
@ -19,13 +19,33 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
/**
|
||||
* @brief The QmlFileUtils class, exposed to QML as FileUtils
|
||||
*/
|
||||
class QmlFileUtils : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
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);
|
||||
/**
|
||||
* @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);
|
||||
/**
|
||||
* @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);
|
||||
private:
|
||||
QString m_path;
|
||||
|
Loading…
Reference in New Issue
Block a user