
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQUrlInfo class stores information about URLs.More...
| Header: | #include <QUrlInfo> |
| enum | PermissionSpec { ReadOwner, WriteOwner, ExeOwner, ReadGroup, ..., ExeOther } |
| QUrlInfo() | |
| QUrlInfo(const QUrlInfo & ui) | |
| QUrlInfo(const QString & name, int permissions, const QString & owner, const QString & group, qint64 size, const QDateTime & lastModified, const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable) | |
| QUrlInfo(const QUrl & url, int permissions, const QString & owner, const QString & group, qint64 size, const QDateTime & lastModified, const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable) | |
| virtual | ~QUrlInfo() |
| QString | group() const |
| bool | isDir() const |
| bool | isExecutable() const |
| bool | isFile() const |
| bool | isReadable() const |
| bool | isSymLink() const |
| bool | isValid() const |
| bool | isWritable() const |
| QDateTime | lastModified() const |
| QDateTime | lastRead() const |
| QString | name() const |
| QString | owner() const |
| int | permissions() const |
| virtual void | setDir(bool b) |
| virtual void | setFile(bool b) |
| virtual void | setGroup(const QString & s) |
| virtual void | setLastModified(const QDateTime & dt) |
| void | setLastRead(const QDateTime & dt) |
| virtual void | setName(const QString & name) |
| virtual void | setOwner(const QString & s) |
| virtual void | setPermissions(int p) |
| virtual void | setReadable(bool b) |
| virtual void | setSize(qint64 size) |
| virtual void | setSymLink(bool b) |
| virtual void | setWritable(bool b) |
| qint64 | size() const |
| bool | operator!=(const QUrlInfo & other) const |
| QUrlInfo & | operator=(const QUrlInfo & ui) |
| bool | operator==(const QUrlInfo & other) const |
| bool | equal(const QUrlInfo & i1, const QUrlInfo & i2, int sortBy) |
| bool | greaterThan(const QUrlInfo & i1, const QUrlInfo & i2, int sortBy) |
| bool | lessThan(const QUrlInfo & i1, const QUrlInfo & i2, int sortBy) |
TheQUrlInfo class stores information about URLs.
The information about a URL that can be retrieved includesname(),permissions(),owner(),group(),size(),lastModified(),lastRead(),isDir(),isFile(),isSymLink(),isWritable(),isReadable() andisExecutable().
You can create your ownQUrlInfo objects passing in all the relevant information in the constructor, and you can modify aQUrlInfo; for each getter mentioned above there is an equivalent setter. Note that setting values does not affect the underlying resource that theQUrlInfo provides information about; for example if you callsetWritable(true) on a read-only resource the only thing changed is theQUrlInfo object, not the resource.
See alsoQUrl andFTP Example.
This enum is used by thepermissions() function to report the permissions of a file.
| Constant | Value | Description |
|---|---|---|
QUrlInfo::ReadOwner | 00400 | The file is readable by the owner of the file. |
QUrlInfo::WriteOwner | 00200 | The file is writable by the owner of the file. |
QUrlInfo::ExeOwner | 00100 | The file is executable by the owner of the file. |
QUrlInfo::ReadGroup | 00040 | The file is readable by the group. |
QUrlInfo::WriteGroup | 00020 | The file is writable by the group. |
QUrlInfo::ExeGroup | 00010 | The file is executable by the group. |
QUrlInfo::ReadOther | 00004 | The file is readable by anyone. |
QUrlInfo::WriteOther | 00002 | The file is writable by anyone. |
QUrlInfo::ExeOther | 00001 | The file is executable by anyone. |
Constructs an invalidQUrlInfo object with default values.
See alsoisValid().
Copy constructor, copiesui to this URL info object.
Constructs aQUrlInfo object by specifying all the URL's information.
The information that is passed is thename, filepermissions,owner andgroup and the file'ssize. Also passed is thelastModified date/time and thelastRead date/time. Flags are also passed, specifically,isDir,isFile,isSymLink,isWritable,isReadable andisExecutable.
Constructs aQUrlInfo object by specifying all the URL's information.
The information that is passed is theurl, filepermissions,owner andgroup and the file'ssize. Also passed is thelastModified date/time and thelastRead date/time. Flags are also passed, specifically,isDir,isFile,isSymLink,isWritable,isReadable andisExecutable.
[virtual]QUrlInfo::~QUrlInfo()Destroys the URL info object.
[static]bool QUrlInfo::equal(constQUrlInfo & i1, constQUrlInfo & i2,int sortBy)Returns true ifi1 equals toi2; otherwise returns false. The objects are compared by the value, which is specified bysortBy. This must be one ofQDir::Name,QDir::Time orQDir::Size.
[static]bool QUrlInfo::greaterThan(constQUrlInfo & i1, constQUrlInfo & i2,int sortBy)Returns true ifi1 is greater thani2; otherwise returns false. The objects are compared by the value, which is specified bysortBy. This must be one ofQDir::Name,QDir::Time orQDir::Size.
Returns the group of the URL.
See alsosetGroup() andisValid().
Returns true if the URL is a directory; otherwise returns false.
See alsoisValid().
Returns true if the URL is executable; otherwise returns false.
See alsoisValid().
Returns true if the URL is a file; otherwise returns false.
See alsoisValid().
Returns true if the URL is readable; otherwise returns false.
See alsoisValid().
Returns true if the URL is a symbolic link; otherwise returns false.
See alsoisValid().
Returns true if the URL info is valid; otherwise returns false. Valid means that theQUrlInfo contains real information.
You should always check if the URL info is valid before relying on the values.
Returns true if the URL is writable; otherwise returns false.
See alsoisValid().
Returns the last modification date of the URL.
See alsosetLastModified() andisValid().
Returns the date when the URL was last read.
See alsosetLastRead() andisValid().
[static]bool QUrlInfo::lessThan(constQUrlInfo & i1, constQUrlInfo & i2,int sortBy)Returns true ifi1 is less thani2; otherwise returns false. The objects are compared by the value, which is specified bysortBy. This must be one ofQDir::Name,QDir::Time orQDir::Size.
Returns the file name of the URL.
See alsosetName() andisValid().
Returns the owner of the URL.
See alsosetOwner() andisValid().
Returns the permissions of the URL. You can use thePermissionSpec flags to test for certain permissions.
See alsosetPermissions() andisValid().
[virtual]void QUrlInfo::setDir(bool b)Ifb is true then the URL is set to be a directory; ifb is false then the URL is set not to be a directory (which normally means it is a file). (Note that a URL can refer to both a file and a directory even though most file systems do not support this.)
If you call this function for an invalid URL info, this function turns it into a valid one.
[virtual]void QUrlInfo::setFile(bool b)Ifb is true then the URL is set to be a file; ifis false then the URL is set not to be a file (which normally means it is a directory). (Note that a URL can refer to both a file and a directory even though most file systems do not support this.)
If you call this function for an invalid URL info, this function turns it into a valid one.
See alsoisFile() andisValid().
[virtual]void QUrlInfo::setGroup(constQString & s)Specifies that the owning group of the URL is calleds.
If you call this function for an invalid URL info, this function turns it into a valid one.
[virtual]void QUrlInfo::setLastModified(constQDateTime & dt)Specifies that the object the URL refers to was last modified atdt.
If you call this function for an invalid URL info, this function turns it into a valid one.
See alsolastModified() andisValid().
Specifies that the object the URL refers to was last read atdt.
If you call this function for an invalid URL info, this function turns it into a valid one.
This function was introduced in Qt 4.4.
See alsolastRead() andisValid().
[virtual]void QUrlInfo::setName(constQString & name)Sets the name of the URL toname. The name is the full text, for example, "http://qt.nokia.com/doc/qurlinfo.html".
If you call this function for an invalid URL info, this function turns it into a valid one.
[virtual]void QUrlInfo::setOwner(constQString & s)Specifies that the owner of the URL is calleds.
If you call this function for an invalid URL info, this function turns it into a valid one.
[virtual]void QUrlInfo::setPermissions(int p)Specifies that the URL has access permissionsp.
If you call this function for an invalid URL info, this function turns it into a valid one.
See alsopermissions() andisValid().
[virtual]void QUrlInfo::setReadable(bool b)Specifies that the URL is readable ifb is true and not readable ifb is false.
If you call this function for an invalid URL info, this function turns it into a valid one.
See alsoisReadable() andisValid().
[virtual]void QUrlInfo::setSize(qint64 size)Specifies thesize of the URL.
If you call this function for an invalid URL info, this function turns it into a valid one.
[virtual]void QUrlInfo::setSymLink(bool b)Specifies that the URL refers to a symbolic link ifb is true and that it does not ifb is false.
If you call this function for an invalid URL info, this function turns it into a valid one.
See alsoisSymLink() andisValid().
[virtual]void QUrlInfo::setWritable(bool b)Specifies that the URL is writable ifb is true and not writable ifb is false.
If you call this function for an invalid URL info, this function turns it into a valid one.
See alsoisWritable() andisValid().
Returns the size of the URL.
See alsosetSize() andisValid().
Returns true if thisQUrlInfo is not equal toother; otherwise returns false.
This function was introduced in Qt 4.2.
See alsolessThan() andequal().
Assigns the values ofui to thisQUrlInfo object.
Returns true if thisQUrlInfo is equal toother; otherwise returns false.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.