1// qfile.sip generated by MetaSIP
2//
3// This file is part of the QtCore Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
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
22
23class QFile : QFileDevice
24{
25%TypeHeaderCode
26#include <qfile.h>
27%End
28
29public:
30    QFile();
31    QFile(const QString &name);
32    explicit QFile(QObject *parent /TransferThis/);
33    QFile(const QString &name, QObject *parent /TransferThis/);
34    virtual ~QFile();
35    virtual QString fileName() const;
36    void setFileName(const QString &name);
37    static QByteArray encodeName(const QString &fileName);
38    static QString decodeName(const QByteArray &localFileName);
39    static QString decodeName(const char *localFileName /Encoding="ASCII"/);
40    bool exists() const;
41    static bool exists(const QString &fileName);
42    QString symLinkTarget() const;
43    static QString symLinkTarget(const QString &fileName);
44    bool remove() /ReleaseGIL/;
45    static bool remove(const QString &fileName) /ReleaseGIL/;
46    bool rename(const QString &newName) /ReleaseGIL/;
47    static bool rename(const QString &oldName, const QString &newName) /ReleaseGIL/;
48    bool link(const QString &newName) /ReleaseGIL/;
49    static bool link(const QString &oldname, const QString &newName) /ReleaseGIL/;
50    bool copy(const QString &newName) /ReleaseGIL/;
51    static bool copy(const QString &fileName, const QString &newName) /ReleaseGIL/;
52    virtual bool open(QIODevice::OpenMode flags) /ReleaseGIL/;
53    bool open(int fd, QIODevice::OpenMode ioFlags, QFileDevice::FileHandleFlags handleFlags = QFileDevice::FileHandleFlag::DontCloseHandle) /ReleaseGIL/;
54    virtual qint64 size() const;
55    virtual bool resize(qint64 sz);
56    static bool resize(const QString &filename, qint64 sz);
57    virtual QFileDevice::Permissions permissions() const;
58    static QFileDevice::Permissions permissions(const QString &filename);
59    virtual bool setPermissions(QFileDevice::Permissions permissionSpec);
60    static bool setPermissions(const QString &filename, QFileDevice::Permissions permissionSpec);
61%If (Qt_5_15_0 -)
62    bool moveToTrash();
63%End
64%If (Qt_5_15_0 -)
65    static bool moveToTrash(const QString &fileName, QString *pathInTrash /Out/ = 0);
66%End
67};
68