97 Q_DECLARE_PRIVATE(
QFile)
104#elif QT_CONFIG(cxx17_filesystem)
105 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
117#elif QT_CONFIG(cxx17_filesystem)
118 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
127#if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
128 std::filesystem::path filesystemFileName()
const
129 {
return QtPrivate::toFilesystemPath(
fileName()); }
134#elif QT_CONFIG(cxx17_filesystem)
135 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
142#if defined(Q_OS_DARWIN)
153 static inline QString decodeName(
const char *localFileName)
175 static bool exists(
const std::filesystem::path &
fileName);
176#elif QT_CONFIG(cxx17_filesystem)
177 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
178 static bool exists(
const T &
fileName)
180 return exists(QtPrivate::fromFilesystemPath(
fileName));
187 std::filesystem::path filesystemSymLinkTarget()
const;
188 static std::filesystem::path filesystemSymLinkTarget(
const std::filesystem::path &
fileName);
189#elif QT_CONFIG(cxx17_filesystem)
190 std::filesystem::path filesystemSymLinkTarget()
const
192 return QtPrivate::toFilesystemPath(symLinkTarget());
194 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
195 static std::filesystem::path filesystemSymLinkTarget(
const T &
fileName)
197 return QtPrivate::toFilesystemPath(symLinkTarget(QtPrivate::fromFilesystemPath(
fileName)));
205#elif QT_CONFIG(cxx17_filesystem)
206 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
216 static bool moveToTrash(
const std::filesystem::path &
fileName,
QString *pathInTrash =
nullptr);
217#elif QT_CONFIG(cxx17_filesystem)
218 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
219 static bool moveToTrash(
const T &
fileName,
QString *pathInTrash =
nullptr)
221 return moveToTrash(QtPrivate::fromFilesystemPath(
fileName), pathInTrash);
225 bool rename(
const QString &newName);
226 static bool rename(
const QString &oldName,
const QString &newName);
228 bool rename(
const std::filesystem::path &newName);
229 static bool rename(
const std::filesystem::path &oldName,
230 const std::filesystem::path &newName);
231#elif QT_CONFIG(cxx17_filesystem)
232 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
233 bool rename(
const T &newName)
235 return rename(QtPrivate::fromFilesystemPath(newName));
237 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
238 static bool rename(
const T &oldName,
const T &newName)
240 return rename(QtPrivate::fromFilesystemPath(oldName),
241 QtPrivate::fromFilesystemPath(newName));
245 bool link(
const QString &newName);
248 bool link(
const std::filesystem::path &newName);
249 static bool link(
const std::filesystem::path &
fileName,
250 const std::filesystem::path &newName);
251#elif QT_CONFIG(cxx17_filesystem)
252 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
253 bool link(
const T &newName)
255 return link(QtPrivate::fromFilesystemPath(newName));
257 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
258 static bool link(
const T &
fileName,
const T &newName)
260 return link(QtPrivate::fromFilesystemPath(
fileName),
261 QtPrivate::fromFilesystemPath(newName));
268 bool copy(
const std::filesystem::path &newName);
270 const std::filesystem::path &newName);
271#elif QT_CONFIG(cxx17_filesystem)
272 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
273 bool copy(
const T &newName)
275 return copy(QtPrivate::fromFilesystemPath(newName));
277 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
281 QtPrivate::fromFilesystemPath(newName));
295 Permissions permissions()
const override;
296 static Permissions permissions(
const QString &filename);
297 bool setPermissions(Permissions permissionSpec)
override;
298 static bool setPermissions(
const QString &filename, Permissions permissionSpec);
300 static Permissions permissions(
const std::filesystem::path &filename);
301 static bool setPermissions(
const std::filesystem::path &filename, Permissions permissionSpec);
302#elif QT_CONFIG(cxx17_filesystem)
303 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
304 static Permissions permissions(
const T &filename)
306 return permissions(QtPrivate::fromFilesystemPath(filename));
308 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
309 static bool setPermissions(
const T &filename, Permissions permissionSpec)
311 return setPermissions(QtPrivate::fromFilesystemPath(filename), permissionSpec);
323 friend class QTemporaryFile;
324 Q_DISABLE_COPY(
QFile)