57 Drives = QDir::Drives,
58 NoSymLinks = QDir::NoSymLinks,
59 AllEntries = QDir::AllEntries,
60 TypeMask = QDir::TypeMask,
62 Readable = QDir::Readable,
63 Writable = QDir::Writable,
64 Executable = QDir::Executable,
65 PermissionMask = QDir::PermissionMask,
67 Modified = QDir::Modified,
68 Hidden = QDir::Hidden,
69 System = QDir::System,
71 AccessMask = QDir::AccessMask,
73 AllDirs = QDir::AllDirs,
74 CaseSensitive = QDir::CaseSensitive,
76 NoDotDot = QDir::NoDotDot,
77 NoDotAndDotDot = QDir::NoDotAndDotDot,
79 NoFilter = QDir::NoFilter
81 Q_DECLARE_FLAGS(Filters,
Filter)
88 Unsorted = QDir::Unsorted,
89 SortByMask = QDir::SortByMask,
91 DirsFirst = QDir::DirsFirst,
92 Reversed = QDir::Reversed,
93 IgnoreCase = QDir::IgnoreCase,
94 DirsLast = QDir::DirsLast,
95 LocaleAware = QDir::LocaleAware,
99 Q_DECLARE_FLAGS(SortFlags,
Sort)
106 explicit ZDir(QObject *parent =
nullptr);
118 explicit ZDir(
const QDir& dir, QObject *parent =
nullptr);
126 static void registerType();
130 Q_PROPERTY(QVariant tags READ getTags NOTIFY tagsChanged)
131 Q_PROPERTY(uint filter READ getFilter WRITE setFilter NOTIFY filterChanged)
132 Q_PROPERTY(QString path READ getPath NOTIFY pathChanged)
133 Q_PROPERTY(QString absolutePath READ getAbsolutePath NOTIFY pathChanged)
134 Q_PROPERTY(QString canonicalPath READ getCanonicalPath NOTIFY pathChanged)
135 Q_PROPERTY(QString dirName READ getDirName NOTIFY pathChanged)
136 Q_PROPERTY(uint count READ getCount)
137 Q_PROPERTY(
bool isReadable READ isReadable)
138 Q_PROPERTY(
bool exists READ exists)
139 Q_PROPERTY(
bool isRoot READ isRoot)
143 Q_INVOKABLE
void setPath(const QString & path);
144 Q_INVOKABLE
void setToCurrentPath();
145 Q_INVOKABLE
void setToHomePath();
146 Q_INVOKABLE
bool rename(const QString & oldName, const QString & newName);
147 Q_INVOKABLE
void swap(QObject* zDir);
149 Q_INVOKABLE
bool setCurrent(const QString &path);
150 Q_INVOKABLE QString currentPath();
151 Q_INVOKABLE QString homePath();
152 Q_INVOKABLE QString rootPath();
153 Q_INVOKABLE QString tempPath();
155 Q_INVOKABLE QString filePath(const QString &fileName) const;
156 Q_INVOKABLE QString absoluteFilePath(const QString &fileName) const;
157 Q_INVOKABLE QString relativeFilePath(const QString &fileName) const;
159 Q_INVOKABLE
bool cd(const QString &dirName);
160 Q_INVOKABLE
bool cdUp();
162 Q_INVOKABLE QString getChildName(
int pos);
164 Q_INVOKABLE
bool mkdir(const QString &dirName) const;
165 Q_INVOKABLE
bool rmdir(const QString &dirName) const;
166 Q_INVOKABLE
bool mkpath(const QString &dirPath) const;
167 Q_INVOKABLE
bool rmpath(const QString &dirPath) const;
169 Q_INVOKABLE
bool removeRecursively();
172 Q_INVOKABLE
bool remove(const QString &fileName);
173 Q_INVOKABLE
bool fileExists(const QString &name) const;
175 Q_INVOKABLE
void refresh() const;
177 Q_INVOKABLE
bool isRelativePath(const QString &path);
178 Q_INVOKABLE
bool isAbsolutePath(const QString &path);
179 Q_INVOKABLE
bool isRelative() const;
180 Q_INVOKABLE
bool isAbsolute() const;
181 Q_INVOKABLE
bool makeAbsolute();
183 Q_INVOKABLE QString cleanPath(const QString &path);
191 Q_INVOKABLE QObject* entryInfoList(
201 Q_INVOKABLE QStringList entryList(
int filters,
207 uint getFilter() const;
208 void setFilter(uint filters);
210 QString getPath() const;
211 QString getAbsolutePath() const;
212 QString getCanonicalPath() const;
213 QString getDirName() const;
214 uint getCount() const;
215 bool isReadable() const;
230 static void addResourceSearchPath(
const QString &path);
232 static void setSearchPaths(
const QString &prefix,
const QStringList &searchPaths);
233 static void addSearchPath(
const QString &prefix,
const QString &path);
234 static QStringList searchPaths(
const QString &prefix);
241 static QString toNativeSeparators(
const QString &pathName);
242 static QString fromNativeSeparators(
const QString &pathName);
247 QStringList nameFilters()
const;
248 void setNameFilters(
const QStringList &nameFilters);
252 SortFlags sorting()
const;
253 void setSorting(SortFlags sort);
258 static QStringList nameFiltersFromString(
const QString &nameFilter);
260 QStringList entryList(Filters filters = NoFilter, SortFlags sort = NoSort)
const;
261 QStringList entryList(
const QStringList &nameFilters, Filters filters = NoFilter,
262 SortFlags sort = NoSort)
const;
264 QFileInfoList entryInfoList(Filters filters = NoFilter, SortFlags sort = NoSort)
const;
265 QFileInfoList entryInfoList(
const QStringList &nameFilters, Filters filters = NoFilter,
266 SortFlags sort = NoSort)
const;
285 bool operator==(
const QDir &dir)
const;
286 inline bool operator!=(
const QDir &dir)
const {
return !operator==(dir); }
292 static QFileInfoList drives();
294 static QChar separator();
315 void filterChanged();
325 void validateDir()
const;
333 Q_DECLARE_OPERATORS_FOR_FLAGS(ZDir::Filters)
334 Q_DECLARE_OPERATORS_FOR_FLAGS(ZDir::SortFlags)
346 throw ZblException(
"Directory object not initialized. Use ZDir.setPath or ZDir.setToCurrentPath methods.");
#define ZBLCORESHARED_EXPORT
Access and manipulate file directories. This class is a Javascript wrapper for QDir objects...
Zuble's Qt Exception Object.