Qt 4.8
Public Types | Public Functions | Static Public Functions | Properties | List of all members
QUrlInfo Class Reference

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
}
 This enum is used by the permissions() function to report the permissions of a file. More...
 

Public Functions

QString group () const
 Returns the group of the URL. More...
 
bool isDir () const
 Returns true if the URL is a directory; otherwise returns false. More...
 
bool isExecutable () const
 Returns true if the URL is executable; otherwise returns false. More...
 
bool isFile () const
 Returns true if the URL is a file; otherwise returns false. More...
 
bool isReadable () const
 Returns true if the URL is readable; otherwise returns false. More...
 
bool isSymLink () const
 Returns true if the URL is a symbolic link; otherwise returns false. More...
 
bool isValid () const
 Returns true if the URL info is valid; otherwise returns false. More...
 
bool isWritable () const
 Returns true if the URL is writable; otherwise returns false. More...
 
QDateTime lastModified () const
 Returns the last modification date of the URL. More...
 
QDateTime lastRead () const
 Returns the date when the URL was last read. More...
 
QString name () const
 Returns the file name of the URL. More...
 
bool operator!= (const QUrlInfo &i) const
 Returns true if this QUrlInfo is not equal to other; otherwise returns false. More...
 
QUrlInfooperator= (const QUrlInfo &ui)
 Assigns the values of ui to this QUrlInfo object. More...
 
bool operator== (const QUrlInfo &i) const
 Returns true if this QUrlInfo is equal to other; otherwise returns false. More...
 
QString owner () const
 Returns the owner of the URL. More...
 
int permissions () const
 Returns the permissions of the URL. More...
 
 QUrlInfo ()
 Constructs an invalid QUrlInfo object with default values. More...
 
 QUrlInfo (const QUrlInfo &ui)
 Copy constructor, copies ui to this URL info object. More...
 
 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. More...
 
 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. More...
 
virtual void setDir (bool b)
 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). More...
 
virtual void setFile (bool b)
 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). More...
 
virtual void setGroup (const QString &s)
 Specifies that the owning group of the URL is called s. More...
 
virtual void setLastModified (const QDateTime &dt)
 Specifies that the object the URL refers to was last modified at dt. More...
 
void setLastRead (const QDateTime &dt)
 Specifies that the object the URL refers to was last read at dt. More...
 
virtual void setName (const QString &name)
 Sets the name of the URL to name. More...
 
virtual void setOwner (const QString &s)
 Specifies that the owner of the URL is called s. More...
 
virtual void setPermissions (int p)
 Specifies that the URL has access permissions p. More...
 
virtual void setReadable (bool b)
 Specifies that the URL is readable if b is true and not readable if b is false. More...
 
virtual void setSize (qint64 size)
 Specifies the size of the URL. More...
 
virtual void setSymLink (bool b)
 Specifies that the URL refers to a symbolic link if b is true and that it does not if b is false. More...
 
virtual void setWritable (bool b)
 Specifies that the URL is writable if b is true and not writable if b is false. More...
 
qint64 size () const
 Returns the size of the URL. More...
 
virtual ~QUrlInfo ()
 Destroys the URL info object. More...
 

Static Public Functions

static bool equal (const QUrlInfo &i1, const QUrlInfo &i2, int sortBy)
 Returns true if i1 equals to i2; otherwise returns false. More...
 
static bool greaterThan (const QUrlInfo &i1, const QUrlInfo &i2, int sortBy)
 Returns true if i1 is greater than i2; otherwise returns false. More...
 
static bool lessThan (const QUrlInfo &i1, const QUrlInfo &i2, int sortBy)
 Returns true if i1 is less than i2; otherwise returns false. More...
 

Properties

QUrlInfoPrivated
 

Detailed Description

The QUrlInfo class stores information about URLs.

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.

See also
QUrl, {FTP Example}

Definition at line 60 of file qurlinfo.h.

Enumerations

◆ PermissionSpec

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 

Definition at line 63 of file qurlinfo.h.

Constructors and Destructors

◆ QUrlInfo() [1/4]

QUrlInfo::QUrlInfo ( )

Constructs an invalid QUrlInfo object with default values.

See also
isValid()

Definition at line 135 of file qurlinfo.cpp.

136 {
137  d = 0;
138 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ QUrlInfo() [2/4]

QUrlInfo::QUrlInfo ( const QUrlInfo ui)

Copy constructor, copies ui to this URL info object.

Definition at line 144 of file qurlinfo.cpp.

145 {
146  if (ui.d) {
147  d = new QUrlInfoPrivate;
148  *d = *ui.d;
149  } else {
150  d = 0;
151  }
152 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ QUrlInfo() [3/4]

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.

Definition at line 166 of file qurlinfo.cpp.

170 {
171  d = new QUrlInfoPrivate;
172  d->name = name;
174  d->owner = owner;
175  d->group = group;
176  d->size = size;
178  d->lastRead = lastRead;
179  d->isDir = isDir;
180  d->isFile = isFile;
181  d->isSymLink = isSymLink;
185 }
QString owner() const
Returns the owner of the URL.
Definition: qurlinfo.cpp:495
bool isFile() const
Returns true if the URL is a file; otherwise returns false.
Definition: qurlinfo.cpp:573
bool isExecutable() const
Returns true if the URL is executable; otherwise returns false.
Definition: qurlinfo.cpp:625
bool isReadable() const
Returns true if the URL is readable; otherwise returns false.
Definition: qurlinfo.cpp:612
bool isWritable() const
Returns true if the URL is writable; otherwise returns false.
Definition: qurlinfo.cpp:599
bool isSymLink() const
Returns true if the URL is a symbolic link; otherwise returns false.
Definition: qurlinfo.cpp:586
QDateTime lastModified() const
Returns the last modification date of the URL.
Definition: qurlinfo.cpp:534
QDateTime lastModified
Definition: qurlinfo.cpp:72
QString name() const
Returns the file name of the URL.
Definition: qurlinfo.cpp:468
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString group() const
Returns the group of the URL.
Definition: qurlinfo.cpp:508
QString owner
Definition: qurlinfo.cpp:68
bool isDir() const
Returns true if the URL is a directory; otherwise returns false.
Definition: qurlinfo.cpp:560
QDateTime lastRead() const
Returns the date when the URL was last read.
Definition: qurlinfo.cpp:547
int permissions() const
Returns the permissions of the URL.
Definition: qurlinfo.cpp:482
QString name
Definition: qurlinfo.cpp:66
qint64 size() const
Returns the size of the URL.
Definition: qurlinfo.cpp:521
QString group
Definition: qurlinfo.cpp:69
QDateTime lastRead
Definition: qurlinfo.cpp:73

◆ QUrlInfo() [4/4]

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.

Definition at line 200 of file qurlinfo.cpp.

204 {
205  d = new QUrlInfoPrivate;
206  d->name = QFileInfo(url.path()).fileName();
208  d->owner = owner;
209  d->group = group;
210  d->size = size;
212  d->lastRead = lastRead;
213  d->isDir = isDir;
214  d->isFile = isFile;
215  d->isSymLink = isSymLink;
219 }
QString owner() const
Returns the owner of the URL.
Definition: qurlinfo.cpp:495
bool isFile() const
Returns true if the URL is a file; otherwise returns false.
Definition: qurlinfo.cpp:573
bool isExecutable() const
Returns true if the URL is executable; otherwise returns false.
Definition: qurlinfo.cpp:625
bool isReadable() const
Returns true if the URL is readable; otherwise returns false.
Definition: qurlinfo.cpp:612
bool isWritable() const
Returns true if the URL is writable; otherwise returns false.
Definition: qurlinfo.cpp:599
bool isSymLink() const
Returns true if the URL is a symbolic link; otherwise returns false.
Definition: qurlinfo.cpp:586
QDateTime lastModified() const
Returns the last modification date of the URL.
Definition: qurlinfo.cpp:534
QDateTime lastModified
Definition: qurlinfo.cpp:72
QString path() const
Returns the path of the URL.
Definition: qurl.cpp:4977
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString group() const
Returns the group of the URL.
Definition: qurlinfo.cpp:508
QString owner
Definition: qurlinfo.cpp:68
bool isDir() const
Returns true if the URL is a directory; otherwise returns false.
Definition: qurlinfo.cpp:560
QDateTime lastRead() const
Returns the date when the URL was last read.
Definition: qurlinfo.cpp:547
int permissions() const
Returns the permissions of the URL.
Definition: qurlinfo.cpp:482
QString name
Definition: qurlinfo.cpp:66
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
qint64 size() const
Returns the size of the URL.
Definition: qurlinfo.cpp:521
QString group
Definition: qurlinfo.cpp:69
static QString fileName(const QString &fileUrl)
QDateTime lastRead
Definition: qurlinfo.cpp:73

◆ ~QUrlInfo()

QUrlInfo::~QUrlInfo ( )
virtual

Destroys the URL info object.

Definition at line 440 of file qurlinfo.cpp.

441 {
442  delete d;
443 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

Functions

◆ equal()

bool QUrlInfo::equal ( const QUrlInfo i1,
const QUrlInfo i2,
int  sortBy 
)
static

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.

Definition at line 672 of file qurlinfo.cpp.

674 {
675  switch (sortBy) {
676  case QDir::Name:
677  return i1.name() == i2.name();
678  case QDir::Time:
679  return i1.lastModified() == i2.lastModified();
680  case QDir::Size:
681  return i1.size() == i2.size();
682  default:
683  return false;
684  }
685 }
QDateTime lastModified() const
Returns the last modification date of the URL.
Definition: qurlinfo.cpp:534
QString name() const
Returns the file name of the URL.
Definition: qurlinfo.cpp:468
qint64 size() const
Returns the size of the URL.
Definition: qurlinfo.cpp:521

◆ greaterThan()

bool QUrlInfo::greaterThan ( const QUrlInfo i1,
const QUrlInfo i2,
int  sortBy 
)
static

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.

Definition at line 639 of file qurlinfo.cpp.

641 {
642  switch (sortBy) {
643  case QDir::Name:
644  return i1.name() > i2.name();
645  case QDir::Time:
646  return i1.lastModified() > i2.lastModified();
647  case QDir::Size:
648  return i1.size() > i2.size();
649  default:
650  return false;
651  }
652 }
QDateTime lastModified() const
Returns the last modification date of the URL.
Definition: qurlinfo.cpp:534
QString name() const
Returns the file name of the URL.
Definition: qurlinfo.cpp:468
qint64 size() const
Returns the size of the URL.
Definition: qurlinfo.cpp:521

◆ group()

QString QUrlInfo::group ( ) const

Returns the group of the URL.

See also
isValid()

Definition at line 508 of file qurlinfo.cpp.

509 {
510  if (!d)
511  return QString();
512  return d->group;
513 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString group
Definition: qurlinfo.cpp:69

◆ isDir()

bool QUrlInfo::isDir ( ) const

Returns true if the URL is a directory; otherwise returns false.

See also
isValid()

Definition at line 560 of file qurlinfo.cpp.

561 {
562  if (!d)
563  return false;
564  return d->isDir;
565 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ isExecutable()

bool QUrlInfo::isExecutable ( ) const

Returns true if the URL is executable; otherwise returns false.

See also
isValid()

Definition at line 625 of file qurlinfo.cpp.

626 {
627  if (!d)
628  return false;
629  return d->isExecutable;
630 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ isFile()

bool QUrlInfo::isFile ( ) const

Returns true if the URL is a file; otherwise returns false.

See also
isValid()

Definition at line 573 of file qurlinfo.cpp.

Referenced by _q_parseDosDir().

574 {
575  if (!d)
576  return false;
577  return d->isFile;
578 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ isReadable()

bool QUrlInfo::isReadable ( ) const

Returns true if the URL is readable; otherwise returns false.

See also
isValid()

Definition at line 612 of file qurlinfo.cpp.

613 {
614  if (!d)
615  return false;
616  return d->isReadable;
617 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ isSymLink()

bool QUrlInfo::isSymLink ( ) const

Returns true if the URL is a symbolic link; otherwise returns false.

See also
isValid()

Definition at line 586 of file qurlinfo.cpp.

Referenced by _q_parseUnixDir().

587 {
588  if (!d)
589  return false;
590  return d->isSymLink;
591 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ isValid()

bool QUrlInfo::isValid ( ) const

Returns true if the URL info is valid; otherwise returns false.

Valid means that the QUrlInfo contains real information.

You should always check if the URL info is valid before relying on the values.

Definition at line 736 of file qurlinfo.cpp.

737 {
738  return d != 0;
739 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ isWritable()

bool QUrlInfo::isWritable ( ) const

Returns true if the URL is writable; otherwise returns false.

See also
isValid()

Definition at line 599 of file qurlinfo.cpp.

600 {
601  if (!d)
602  return false;
603  return d->isWritable;
604 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ lastModified()

QDateTime QUrlInfo::lastModified ( ) const

Returns the last modification date of the URL.

See also
isValid()

Definition at line 534 of file qurlinfo.cpp.

Referenced by equal(), and greaterThan().

535 {
536  if (!d)
537  return QDateTime();
538  return d->lastModified;
539 }
QDateTime lastModified
Definition: qurlinfo.cpp:72
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216

◆ lastRead()

QDateTime QUrlInfo::lastRead ( ) const

Returns the date when the URL was last read.

See also
isValid()

Definition at line 547 of file qurlinfo.cpp.

548 {
549  if (!d)
550  return QDateTime();
551  return d->lastRead;
552 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216
QDateTime lastRead
Definition: qurlinfo.cpp:73

◆ lessThan()

bool QUrlInfo::lessThan ( const QUrlInfo i1,
const QUrlInfo i2,
int  sortBy 
)
static

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.

Definition at line 660 of file qurlinfo.cpp.

662 {
663  return !greaterThan(i1, i2, sortBy);
664 }
static bool greaterThan(const QUrlInfo &i1, const QUrlInfo &i2, int sortBy)
Returns true if i1 is greater than i2; otherwise returns false.
Definition: qurlinfo.cpp:639

◆ name()

QString QUrlInfo::name ( ) const

Returns the file name of the URL.

See also
isValid()

Definition at line 468 of file qurlinfo.cpp.

Referenced by equal(), and greaterThan().

469 {
470  if (!d)
471  return QString();
472  return d->name;
473 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString name
Definition: qurlinfo.cpp:66

◆ operator!=()

bool QUrlInfo::operator!= ( const QUrlInfo other) const
inline

Returns true if this QUrlInfo is not equal to other; otherwise returns false.

Since
4.2
See also
lessThan(), equal()

Definition at line 118 of file qurlinfo.h.

119  { return !operator==(i); }
bool operator==(const QUrlInfo &i) const
Returns true if this QUrlInfo is equal to other; otherwise returns false.
Definition: qurlinfo.cpp:694

◆ operator=()

QUrlInfo & QUrlInfo::operator= ( const QUrlInfo ui)

Assigns the values of ui to this QUrlInfo object.

Definition at line 449 of file qurlinfo.cpp.

450 {
451  if (ui.d) {
452  if (!d)
453  d= new QUrlInfoPrivate;
454  *d = *ui.d;
455  } else {
456  delete d;
457  d = 0;
458  }
459  return *this;
460 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ operator==()

bool QUrlInfo::operator== ( const QUrlInfo other) const

Returns true if this QUrlInfo is equal to other; otherwise returns false.

See also
lessThan(), equal()

Definition at line 694 of file qurlinfo.cpp.

695 {
696  if (!d)
697  return other.d == 0;
698  if (!other.d)
699  return false;
700 
701  return (d->name == other.d->name &&
702  d->permissions == other.d->permissions &&
703  d->owner == other.d->owner &&
704  d->group == other.d->group &&
705  d->size == other.d->size &&
706  d->lastModified == other.d->lastModified &&
707  d->lastRead == other.d->lastRead &&
708  d->isDir == other.d->isDir &&
709  d->isFile == other.d->isFile &&
710  d->isSymLink == other.d->isSymLink &&
711  d->isWritable == other.d->isWritable &&
712  d->isReadable == other.d->isReadable &&
713  d->isExecutable == other.d->isExecutable);
714 }
QDateTime lastModified
Definition: qurlinfo.cpp:72
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString owner
Definition: qurlinfo.cpp:68
QString name
Definition: qurlinfo.cpp:66
QString group
Definition: qurlinfo.cpp:69
QDateTime lastRead
Definition: qurlinfo.cpp:73

◆ owner()

QString QUrlInfo::owner ( ) const

Returns the owner of the URL.

See also
isValid()

Definition at line 495 of file qurlinfo.cpp.

Referenced by _q_parseUnixDir().

496 {
497  if (!d)
498  return QString();
499  return d->owner;
500 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString owner
Definition: qurlinfo.cpp:68

◆ permissions()

int QUrlInfo::permissions ( ) const

Returns the permissions of the URL.

You can use the PermissionSpec flags to test for certain permissions.

See also
isValid()

Definition at line 482 of file qurlinfo.cpp.

483 {
484  if (!d)
485  return 0;
486  return d->permissions;
487 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ setDir()

void QUrlInfo::setDir ( bool  b)
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.

See also
isValid()

Definition at line 252 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

253 {
254  if (!d)
255  d = new QUrlInfoPrivate;
256  d->isDir = b;
257 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ setFile()

void QUrlInfo::setFile ( bool  b)
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.

See also
isValid()

Definition at line 272 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

273 {
274  if (!d)
275  d = new QUrlInfoPrivate;
276  d->isFile = b;
277 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ setGroup()

void QUrlInfo::setGroup ( const QString s)
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.

See also
isValid()

Definition at line 358 of file qurlinfo.cpp.

Referenced by _q_parseUnixDir().

359 {
360  if (!d)
361  d = new QUrlInfoPrivate;
362  d->group = s;
363 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString group
Definition: qurlinfo.cpp:69

◆ setLastModified()

void QUrlInfo::setLastModified ( const QDateTime dt)
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.

See also
isValid()

Definition at line 407 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

408 {
409  if (!d)
410  d = new QUrlInfoPrivate;
411  d->lastModified = dt;
412 }
QDateTime lastModified
Definition: qurlinfo.cpp:72
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ setLastRead()

void QUrlInfo::setLastRead ( const QDateTime dt)

Specifies that the object the URL refers to was last read at dt.

Since
4.4

If you call this function for an invalid URL info, this function turns it into a valid one.

See also
isValid()

Definition at line 429 of file qurlinfo.cpp.

430 {
431  if (!d)
432  d = new QUrlInfoPrivate;
433  d->lastRead = dt;
434 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QDateTime lastRead
Definition: qurlinfo.cpp:73

◆ setName()

void QUrlInfo::setName ( const QString name)
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.

See also
isValid()

Definition at line 232 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

233 {
234  if (!d)
235  d = new QUrlInfoPrivate;
236  d->name = name;
237 }
QString name() const
Returns the file name of the URL.
Definition: qurlinfo.cpp:468
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString name
Definition: qurlinfo.cpp:66

◆ setOwner()

void QUrlInfo::setOwner ( const QString s)
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.

See also
isValid()

Definition at line 342 of file qurlinfo.cpp.

Referenced by _q_parseUnixDir().

343 {
344  if (!d)
345  d = new QUrlInfoPrivate;
346  d->owner = s;
347 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
QString owner
Definition: qurlinfo.cpp:68

◆ setPermissions()

void QUrlInfo::setPermissions ( int  p)
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.

See also
isValid()

Definition at line 390 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

391 {
392  if (!d)
393  d = new QUrlInfoPrivate;
394  d->permissions = p;
395 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ setReadable()

void QUrlInfo::setReadable ( bool  b)
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.

See also
isValid()

Definition at line 326 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

327 {
328  if (!d)
329  d = new QUrlInfoPrivate;
330  d->isReadable = b;
331 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ setSize()

void QUrlInfo::setSize ( qint64  size)
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.

See also
isValid()

Definition at line 374 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

375 {
376  if (!d)
377  d = new QUrlInfoPrivate;
378  d->size = size;
379 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122
qint64 size() const
Returns the size of the URL.
Definition: qurlinfo.cpp:521

◆ setSymLink()

void QUrlInfo::setSymLink ( bool  b)
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.

See also
isValid()

Definition at line 290 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

291 {
292  if (!d)
293  d = new QUrlInfoPrivate;
294  d->isSymLink = b;
295 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ setWritable()

void QUrlInfo::setWritable ( bool  b)
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.

See also
isValid()

Definition at line 308 of file qurlinfo.cpp.

Referenced by _q_parseDosDir(), and _q_parseUnixDir().

309 {
310  if (!d)
311  d = new QUrlInfoPrivate;
312  d->isWritable = b;
313 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

◆ size()

qint64 QUrlInfo::size ( ) const

Returns the size of the URL.

See also
isValid()

Definition at line 521 of file qurlinfo.cpp.

Referenced by equal(), and greaterThan().

522 {
523  if (!d)
524  return 0;
525  return d->size;
526 }
QUrlInfoPrivate * d
Definition: qurlinfo.h:122

Properties

◆ d

QUrlInfoPrivate* QUrlInfo::d
private

Definition at line 122 of file qurlinfo.h.

Referenced by operator=(), operator==(), and QUrlInfo().


The documentation for this class was generated from the following files: