qfileinfo.sip 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // qfileinfo.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 QFileInfo
  22. {
  23. %TypeHeaderCode
  24. #include <qfileinfo.h>
  25. %End
  26. public:
  27. QFileInfo();
  28. explicit QFileInfo(const QFileDevice &file);
  29. explicit QFileInfo(const QString &file);
  30. QFileInfo(const QDir &dir, const QString &file);
  31. QFileInfo(const QFileInfo &fileinfo);
  32. ~QFileInfo();
  33. %If (- Qt_6_8_0)
  34. bool operator==(const QFileInfo &fileinfo) const;
  35. %End
  36. %If (- Qt_6_8_0)
  37. bool operator!=(const QFileInfo &fileinfo) const;
  38. %End
  39. void setFile(const QString &file);
  40. void setFile(const QFileDevice &file);
  41. void setFile(const QDir &dir, const QString &file);
  42. bool exists() const;
  43. void refresh();
  44. QString filePath() const;
  45. SIP_PYOBJECT __fspath__();
  46. %MethodCode
  47. sipRes = qpycore_PyObject_FromQString(QDir::toNativeSeparators(sipCpp->filePath()));
  48. %End
  49. QString absoluteFilePath() const;
  50. QString canonicalFilePath() const;
  51. QString fileName() const;
  52. QString baseName() const;
  53. QString completeBaseName() const;
  54. QString suffix() const;
  55. QString completeSuffix() const;
  56. QString path() const;
  57. QString absolutePath() const;
  58. QString canonicalPath() const;
  59. QDir dir() const;
  60. QDir absoluteDir() const;
  61. bool isReadable() const;
  62. bool isWritable() const;
  63. bool isExecutable() const;
  64. bool isHidden() const;
  65. bool isRelative() const;
  66. bool isAbsolute() const;
  67. bool makeAbsolute();
  68. bool isFile() const;
  69. bool isDir() const;
  70. bool isSymLink() const;
  71. bool isRoot() const;
  72. QString owner() const;
  73. uint ownerId() const;
  74. QString group() const;
  75. uint groupId() const;
  76. bool permission(QFileDevice::Permissions permissions) const;
  77. QFileDevice::Permissions permissions() const;
  78. qint64 size() const;
  79. QDateTime lastModified() const;
  80. %If (Qt_6_6_0 -)
  81. QDateTime lastModified(const QTimeZone &tz) const;
  82. %End
  83. QDateTime lastRead() const;
  84. %If (Qt_6_6_0 -)
  85. QDateTime lastRead(const QTimeZone &tz) const;
  86. %End
  87. bool caching() const;
  88. void setCaching(bool on);
  89. QString symLinkTarget() const;
  90. QString bundleName() const;
  91. bool isBundle() const;
  92. bool isNativePath() const;
  93. void swap(QFileInfo &other /Constrained/);
  94. static bool exists(const QString &file);
  95. QDateTime birthTime() const;
  96. %If (Qt_6_6_0 -)
  97. QDateTime birthTime(const QTimeZone &tz) const;
  98. %End
  99. QDateTime metadataChangeTime() const;
  100. %If (Qt_6_6_0 -)
  101. QDateTime metadataChangeTime(const QTimeZone &tz) const;
  102. %End
  103. QDateTime fileTime(QFileDevice::FileTime time) const;
  104. %If (Qt_6_6_0 -)
  105. QDateTime fileTime(QFileDevice::FileTime time, const QTimeZone &tz) const;
  106. %End
  107. bool isSymbolicLink() const;
  108. bool isShortcut() const;
  109. bool isJunction() const;
  110. void stat();
  111. %If (Qt_6_2_0 -)
  112. QString junctionTarget() const;
  113. %End
  114. %If (Qt_6_4_0 -)
  115. bool isAlias() const;
  116. %End
  117. %If (Qt_6_6_0 -)
  118. QString readSymLink() const;
  119. %End
  120. %If (Qt_6_10_0 -)
  121. bool isOther() const;
  122. %End
  123. };
  124. typedef QList<QFileInfo> QFileInfoList;
  125. %If (Qt_6_8_0 -)
  126. bool operator!=(const QFileInfo &lhs, const QFileInfo &rhs);
  127. %End
  128. %If (Qt_6_8_0 -)
  129. bool operator==(const QFileInfo &lhs, const QFileInfo &rhs);
  130. %End