45 #include <QtCore/qiodevice.h> 46 #include <QtCore/qstring.h> 53 #error qfile.h must be included before any header file that defines open 88 PermissionsError = 13,
96 ReadOwner = 0x4000, WriteOwner = 0x2000, ExeOwner = 0x1000,
97 ReadUser = 0x0400, WriteUser = 0x0200, ExeUser = 0x0100,
98 ReadGroup = 0x0040, WriteGroup = 0x0020, ExeGroup = 0x0010,
99 ReadOther = 0x0004, WriteOther = 0x0002, ExeOther = 0x0001
104 AutoCloseHandle = 0x0001,
111 #ifndef QT_NO_QOBJECT 128 {
return decodeName(
QByteArray(localFileName)); }
129 static void setEncodingFunction(EncoderFn);
130 static void setDecodingFunction(DecoderFn);
143 bool rename(
const QString &newName);
144 static bool rename(
const QString &oldName,
const QString &newName);
146 bool link(
const QString &newName);
149 bool copy(
const QString &newName);
150 static bool copy(
const QString &fileName,
const QString &newName);
154 bool open(OpenMode flags);
155 bool open(FILE *f, OpenMode flags);
156 bool open(
int fd, OpenMode flags);
158 bool open(
const RFile &f, OpenMode flags, FileHandleFlags handleFlags = DontCloseHandle);
160 bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags);
161 bool open(
int fd, OpenMode ioFlags, FileHandleFlags handleFlags);
162 virtual void close();
173 Permissions permissions()
const;
174 static Permissions permissions(
const QString &filename);
175 bool setPermissions(Permissions permissionSpec);
176 static bool setPermissions(
const QString &filename, Permissions permissionSpec);
185 bool unmap(
uchar *address);
192 inline QT3_SUPPORT
void setName(
const QString &aName) { setFileName(aName); }
193 inline QT3_SUPPORT
bool open(OpenMode aFlags, FILE *f) {
return open(f, aFlags); }
194 inline QT3_SUPPORT
bool open(OpenMode aFlags,
int fd) {
return open(fd, aFlags); }
virtual qint64 size() const
For open random-access devices, this function returns the size of the device.
Permission
This enum is used by the permission() function to report the permissions and ownership of a file...
#define QT_END_NAMESPACE
This macro expands to.
static QString symLinkTarget(const QString &fileName)
Returns the absolute path of the file or directory referred to by the symlink (or shortcut on Windows...
virtual void close()
First emits aboutToClose(), then closes the device and sets its OpenMode to NotOpen.
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
virtual qint64 writeData(const char *data, qint64 len)=0
Writes up to maxSize bytes from data to the device.
The QByteArray class provides an array of bytes.
virtual qint64 pos() const
For random-access devices, this function returns the position that data is written to or read from...
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual bool atEnd() const
Returns true if the current read and write position is at the end of the device (i.e.
virtual qint64 readLineData(char *data, qint64 maxlen)
Reads up to maxSize characters into data and returns the number of characters read.
static QString readLink(const QFileSystemEntry &link)
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
The QAbstractFileEngine class provides an abstraction for accessing the filesystem.
static const char * data(const QByteArray &arr)
FileHandleFlag
This enum is used when opening a file to specify additional options which only apply to files and not...
static QString decodeName(const char *localFileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool isSequential() const
Returns true if this device is sequential; otherwise returns false.
virtual qint64 readData(char *data, qint64 maxlen)=0
Reads up to maxSize bytes from the device into data, and returns the number of bytes read or -1 if an...
The QFile class provides an interface for reading from and writing to files.
virtual bool open(OpenMode mode)
Opens the device and sets its OpenMode to mode.
Q_CORE_EXPORT QTextStream & flush(QTextStream &s)
QString symLinkTarget() const
Returns the absolute path of the file or directory a symlink (or shortcut on Windows) points to...
#define Q_DECLARE_PRIVATE(Class)
MemoryMapFlags
This enum describes special options that may be used by the map() function.
FileError
This enum describes the errors that may be returned by the error() function.
The QIODevice class is the base interface class of all I/O devices in Qt.
virtual bool seek(qint64 pos)
For random-access devices, this function sets the current position to pos, returning true on success...
static QString fileName(const QString &fileUrl)