qfile.sip 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // qfile.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtCore Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QFile : public QFileDevice
  22. {
  23. %TypeHeaderCode
  24. #include <qfile.h>
  25. %End
  26. public:
  27. QFile();
  28. %If (Qt_6_9_0 -)
  29. explicit QFile(const QString &name);
  30. %End
  31. %If (- Qt_6_9_0)
  32. QFile(const QString &name);
  33. %End
  34. explicit QFile(QObject *parent /TransferThis/);
  35. QFile(const QString &name, QObject *parent /TransferThis/);
  36. virtual ~QFile();
  37. virtual QString fileName() const;
  38. void setFileName(const QString &name);
  39. static QByteArray encodeName(const QString &fileName);
  40. static QString decodeName(const QByteArray &localFileName);
  41. static QString decodeName(const char *localFileName /Encoding="ASCII"/);
  42. bool exists() const;
  43. static bool exists(const QString &fileName);
  44. QString symLinkTarget() const;
  45. static QString symLinkTarget(const QString &fileName);
  46. bool remove() /ReleaseGIL/;
  47. static bool remove(const QString &fileName) /ReleaseGIL/;
  48. bool rename(const QString &newName) /ReleaseGIL/;
  49. static bool rename(const QString &oldName, const QString &newName) /ReleaseGIL/;
  50. bool link(const QString &newName) /ReleaseGIL/;
  51. static bool link(const QString &oldname, const QString &newName) /ReleaseGIL/;
  52. bool copy(const QString &newName) /ReleaseGIL/;
  53. static bool copy(const QString &fileName, const QString &newName) /ReleaseGIL/;
  54. %If (Qt_6_3_0 -)
  55. bool open(QIODeviceBase::OpenMode flags, QFileDevice::Permissions permissions) /ReleaseGIL/;
  56. %End
  57. virtual bool open(QIODeviceBase::OpenMode flags) /ReleaseGIL/;
  58. bool open(int fd, QIODeviceBase::OpenMode ioFlags, QFileDevice::FileHandleFlags handleFlags = QFileDevice::DontCloseHandle) /ReleaseGIL/;
  59. virtual qint64 size() const;
  60. virtual bool resize(qint64 sz);
  61. static bool resize(const QString &filename, qint64 sz);
  62. virtual QFileDevice::Permissions permissions() const;
  63. static QFileDevice::Permissions permissions(const QString &filename);
  64. virtual bool setPermissions(QFileDevice::Permissions permissionSpec);
  65. static bool setPermissions(const QString &filename, QFileDevice::Permissions permissionSpec);
  66. bool moveToTrash();
  67. static bool moveToTrash(const QString &fileName, QString *pathInTrash /Out/ = 0);
  68. %If (Qt_6_9_0 -)
  69. static bool supportsMoveToTrash();
  70. %End
  71. };