File indexing completed on 2024-04-14 14:08:46

0001 /* GCompris - Directory.h
0002  *
0003  * SPDX-FileCopyrightText: 2017 Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>
0004  *
0005  * Authors:
0006  *   Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>
0007  *
0008  *   SPDX-License-Identifier: GPL-3.0-or-later
0009  */
0010 
0011 #ifndef DIRECTORY_H
0012 #define DIRECTORY_H
0013 
0014 #include <QString>
0015 #include <QStringList>
0016 #include <QObject>
0017 
0018 /**
0019  * @class Directory
0020  * @short A helper component for accessing directories from QML.
0021  * @ingroup components
0022  */
0023 class Directory : public QObject
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     /**
0029      * Constructor
0030      */
0031     explicit Directory(QObject *parent = nullptr);
0032 
0033     /**
0034      * Returns the names of all the files and directories in a given path
0035      *
0036      * @param location the path of the directory
0037      * @param nameFilters name filters to apply to the filenames
0038      *
0039      * @returns list of the names of all the files and directories
0040      *          in the directory.
0041      */
0042     Q_INVOKABLE QStringList getFiles(const QString &location, const QStringList &nameFilters = QStringList());
0043 };
0044 
0045 #endif