KVIrc
4.9.2
DeveloperAPIs
|
The QUrlInfo class stores information about URLs. More...
#include <qurlinfo.h>
Public Types | |
enum | PermissionSpec { ReadOwner = 00400, WriteOwner = 00200, ExeOwner = 00100, ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010, ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 } |
Public Member Functions | |
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 |
bool | operator!= (const QUrlInfo &i) const |
QUrlInfo & | operator= (const QUrlInfo &ui) |
bool | operator== (const QUrlInfo &i) const |
QString | owner () const |
int | permissions () const |
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 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 |
virtual | ~QUrlInfo () |
Static Public Member Functions | |
static bool | equal (const QUrlInfo &i1, const QUrlInfo &i2, int sortBy) |
static bool | greaterThan (const QUrlInfo &i1, const QUrlInfo &i2, int sortBy) |
static bool | lessThan (const QUrlInfo &i1, const QUrlInfo &i2, int sortBy) |
Private Attributes | |
QUrlInfoPrivate * | d |
The QUrlInfo class stores information about URLs.
QtNetwork
The information about a URL that can be retrieved includes name(), permissions(), owner(), group(), size(), lastModified(), lastRead(), isDir(), isFile(), isSymLink(), isWritable(), isReadable() and isExecutable().
You can create your own QUrlInfo objects passing in all the relevant information in the constructor, and you can modify a QUrlInfo; for each getter mentioned above there is an equivalent setter. Note that setting values does not affect the underlying resource that the QUrlInfo provides information about; for example if you call setWritable(true) on a read-only resource the only thing changed is the QUrlInfo object, not the resource.
This enum is used by the permissions() function to report the permissions of a file.
ReadOwner The file is readable by the owner of the file. WriteOwner The file is writable by the owner of the file. ExeOwner The file is executable by the owner of the file. ReadGroup The file is readable by the group. WriteGroup The file is writable by the group. ExeGroup The file is executable by the group. ReadOther The file is readable by anyone. WriteOther The file is writable by anyone. ExeOther The file is executable by anyone.
Enumerator | |
---|---|
ReadOwner | |
WriteOwner | |
ExeOwner | |
ReadGroup | |
WriteGroup | |
ExeGroup | |
ReadOther | |
WriteOther | |
ExeOther |
QUrlInfo::QUrlInfo | ( | ) |
QUrlInfo::QUrlInfo | ( | const QUrlInfo & | ui | ) |
Copy constructor, copies ui to this URL info object.
References d.
QUrlInfo::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 | ||
) |
Constructs a QUrlInfo object by specifying all the URL's information.
The information that is passed is the name, file permissions, owner and group and the file's size. Also passed is the lastModified date/time and the lastRead date/time. Flags are also passed, specifically, isDir, isFile, isSymLink, isWritable, isReadable and isExecutable.
References d, QUrlInfoPrivate::group, group(), QUrlInfoPrivate::isDir, isDir(), QUrlInfoPrivate::isExecutable, isExecutable(), QUrlInfoPrivate::isFile, isFile(), QUrlInfoPrivate::isReadable, isReadable(), QUrlInfoPrivate::isSymLink, isSymLink(), QUrlInfoPrivate::isWritable, isWritable(), QUrlInfoPrivate::lastModified, lastModified(), QUrlInfoPrivate::lastRead, lastRead(), QUrlInfoPrivate::name, name(), QUrlInfoPrivate::owner, owner(), QUrlInfoPrivate::permissions, permissions(), QUrlInfoPrivate::size, and size().
QUrlInfo::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 | ||
) |
Constructs a QUrlInfo object by specifying all the URL's information.
The information that is passed is the url, file permissions, owner and group and the file's size. Also passed is the lastModified date/time and the lastRead date/time. Flags are also passed, specifically, isDir, isFile, isSymLink, isWritable, isReadable and isExecutable.
References d, QUrlInfoPrivate::group, group(), QUrlInfoPrivate::isDir, isDir(), QUrlInfoPrivate::isExecutable, isExecutable(), QUrlInfoPrivate::isFile, isFile(), QUrlInfoPrivate::isReadable, isReadable(), QUrlInfoPrivate::isSymLink, isSymLink(), QUrlInfoPrivate::isWritable, isWritable(), QUrlInfoPrivate::lastModified, lastModified(), QUrlInfoPrivate::lastRead, lastRead(), QUrlInfoPrivate::name, QUrlInfoPrivate::owner, owner(), QUrlInfoPrivate::permissions, permissions(), QUrlInfoPrivate::size, and size().
|
virtual |
Destroys the URL info object.
References d.
Returns true if i1 equals to i2; otherwise returns false. The objects are compared by the value, which is specified by sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size.
References lastModified(), name(), and size().
Returns true if i1 is greater than i2; otherwise returns false. The objects are compared by the value, which is specified by sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size.
References lastModified(), name(), and size().
Referenced by lessThan().
QString QUrlInfo::group | ( | ) | const |
Returns the group of the URL.
References d, and QUrlInfoPrivate::group.
Referenced by QUrlInfo().
bool QUrlInfo::isDir | ( | ) | const |
Returns true if the URL is a directory; otherwise returns false.
References d, and QUrlInfoPrivate::isDir.
Referenced by QUrlInfo().
bool QUrlInfo::isExecutable | ( | ) | const |
Returns true if the URL is executable; otherwise returns false.
References d, and QUrlInfoPrivate::isExecutable.
Referenced by QUrlInfo().
bool QUrlInfo::isFile | ( | ) | const |
Returns true if the URL is a file; otherwise returns false.
References d, and QUrlInfoPrivate::isFile.
Referenced by _q_parseDosDir(), and QUrlInfo().
bool QUrlInfo::isReadable | ( | ) | const |
Returns true if the URL is readable; otherwise returns false.
References d, and QUrlInfoPrivate::isReadable.
Referenced by QUrlInfo().
bool QUrlInfo::isSymLink | ( | ) | const |
Returns true if the URL is a symbolic link; otherwise returns false.
References d, and QUrlInfoPrivate::isSymLink.
Referenced by _q_parseUnixDir(), and QUrlInfo().
bool QUrlInfo::isValid | ( | ) | const |
bool QUrlInfo::isWritable | ( | ) | const |
Returns true if the URL is writable; otherwise returns false.
References d, and QUrlInfoPrivate::isWritable.
Referenced by QUrlInfo().
QDateTime QUrlInfo::lastModified | ( | ) | const |
Returns the last modification date of the URL.
References d, and QUrlInfoPrivate::lastModified.
Referenced by equal(), greaterThan(), and QUrlInfo().
QDateTime QUrlInfo::lastRead | ( | ) | const |
Returns the date when the URL was last read.
References d, and QUrlInfoPrivate::lastRead.
Referenced by QUrlInfo().
Returns true if i1 is less than i2; otherwise returns false. The objects are compared by the value, which is specified by sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size.
References greaterThan().
QString QUrlInfo::name | ( | ) | const |
Returns the file name of the URL.
References d, and QUrlInfoPrivate::name.
Referenced by equal(), greaterThan(), QUrlInfo(), setName(), and KvsObject_ftp::slotListInfo().
|
inline |
Returns true if this QUrlInfo is not equal to other; otherwise returns false.
References operator==().
bool QUrlInfo::operator== | ( | const QUrlInfo & | other | ) | const |
Returns true if this QUrlInfo is equal to other; otherwise returns false.
References d, QUrlInfoPrivate::group, QUrlInfoPrivate::isDir, QUrlInfoPrivate::isExecutable, QUrlInfoPrivate::isFile, QUrlInfoPrivate::isReadable, QUrlInfoPrivate::isSymLink, QUrlInfoPrivate::isWritable, QUrlInfoPrivate::lastModified, QUrlInfoPrivate::lastRead, QUrlInfoPrivate::name, QUrlInfoPrivate::owner, QUrlInfoPrivate::permissions, and QUrlInfoPrivate::size.
Referenced by operator!=().
QString QUrlInfo::owner | ( | ) | const |
Returns the owner of the URL.
References d, and QUrlInfoPrivate::owner.
Referenced by _q_parseUnixDir(), and QUrlInfo().
int QUrlInfo::permissions | ( | ) | const |
Returns the permissions of the URL. You can use the PermissionSpec
flags to test for certain permissions.
References d, and QUrlInfoPrivate::permissions.
Referenced by QUrlInfo().
|
virtual |
If b is true then the URL is set to be a directory; if b 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.
References d, and QUrlInfoPrivate::isDir.
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
|
virtual |
If b is true then the URL is set to be a file; if is 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.
References d, and QUrlInfoPrivate::isFile.
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
|
virtual |
Specifies that the owning group of the URL is called s.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, QUrlInfoPrivate::group, and s.
Referenced by _q_parseUnixDir().
|
virtual |
Specifies that the object the URL refers to was last modified at dt.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, and QUrlInfoPrivate::lastModified.
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
void QUrlInfo::setLastRead | ( | const QDateTime & | dt | ) |
Specifies that the object the URL refers to was last read at dt.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, and QUrlInfoPrivate::lastRead.
|
virtual |
Sets the name of the URL to name. 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.
References d, QUrlInfoPrivate::name, and name().
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
|
virtual |
Specifies that the owner of the URL is called s.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, QUrlInfoPrivate::owner, and s.
Referenced by _q_parseUnixDir().
|
virtual |
Specifies that the URL has access permissions p.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, p, and QUrlInfoPrivate::permissions.
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
|
virtual |
Specifies that the URL is readable if b is true and not readable if b is false.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, and QUrlInfoPrivate::isReadable.
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
|
virtual |
Specifies the size of the URL.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, QUrlInfoPrivate::size, and size().
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
|
virtual |
Specifies that the URL refers to a symbolic link if b is true and that it does not if b is false.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, and QUrlInfoPrivate::isSymLink.
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
|
virtual |
Specifies that the URL is writable if b is true and not writable if b is false.
If you call this function for an invalid URL info, this function turns it into a valid one.
References d, and QUrlInfoPrivate::isWritable.
Referenced by _q_parseDosDir(), and _q_parseUnixDir().
qint64 QUrlInfo::size | ( | ) | const |
Returns the size of the URL.
References d, and QUrlInfoPrivate::size.
Referenced by equal(), greaterThan(), QUrlInfo(), and setSize().
|
private |
Referenced by group(), isDir(), isExecutable(), isFile(), isReadable(), isSymLink(), isValid(), isWritable(), lastModified(), lastRead(), name(), operator=(), operator==(), owner(), permissions(), QUrlInfo(), setDir(), setFile(), setGroup(), setLastModified(), setLastRead(), setName(), setOwner(), setPermissions(), setReadable(), setSize(), setSymLink(), setWritable(), size(), and ~QUrlInfo().