<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qurlinfo.cpp:75 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>QUrlInfo Class</title> <style type="text/css"><!-- h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QUrlInfo Class Reference</h1> <p>The QUrlInfo class stores information about URLs. <a href="#details">More...</a> <p><tt>#include <<a href="qurlinfo-h.html">qurlinfo.h</a>></tt> <p><a href="qurlinfo-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li><div class=fn><a href="#QUrlInfo"><b>QUrlInfo</b></a> ()</div></li> <li><div class=fn><a href="#QUrlInfo-2"><b>QUrlInfo</b></a> ( const QUrlOperator & path, const QString & file )</div></li> <li><div class=fn><a href="#QUrlInfo-3"><b>QUrlInfo</b></a> ( const QUrlInfo & ui )</div></li> <li><div class=fn><a href="#QUrlInfo-4"><b>QUrlInfo</b></a> ( const QString & name, int permissions, const QString & owner, const QString & group, uint size, const QDateTime & lastModified, const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable )</div></li> <li><div class=fn><a href="#QUrlInfo-5"><b>QUrlInfo</b></a> ( const QUrl & url, int permissions, const QString & owner, const QString & group, uint size, const QDateTime & lastModified, const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable )</div></li> <li><div class=fn>QUrlInfo & <a href="#operator-eq"><b>operator=</b></a> ( const QUrlInfo & ui )</div></li> <li><div class=fn>virtual <a href="#~QUrlInfo"><b>~QUrlInfo</b></a> ()</div></li> <li><div class=fn>virtual void <a href="#setName"><b>setName</b></a> ( const QString & name )</div></li> <li><div class=fn>virtual void <a href="#setDir"><b>setDir</b></a> ( bool b )</div></li> <li><div class=fn>virtual void <a href="#setFile"><b>setFile</b></a> ( bool b )</div></li> <li><div class=fn>virtual void <a href="#setSymLink"><b>setSymLink</b></a> ( bool b )</div></li> <li><div class=fn>virtual void <a href="#setOwner"><b>setOwner</b></a> ( const QString & s )</div></li> <li><div class=fn>virtual void <a href="#setGroup"><b>setGroup</b></a> ( const QString & s )</div></li> <li><div class=fn>virtual void <a href="#setSize"><b>setSize</b></a> ( uint s )</div></li> <li><div class=fn>virtual void <a href="#setWritable"><b>setWritable</b></a> ( bool b )</div></li> <li><div class=fn>virtual void <a href="#setReadable"><b>setReadable</b></a> ( bool b )</div></li> <li><div class=fn>virtual void <a href="#setPermissions"><b>setPermissions</b></a> ( int p )</div></li> <li><div class=fn>virtual void <a href="#setLastModified"><b>setLastModified</b></a> ( const QDateTime & dt )</div></li> <li><div class=fn>bool <a href="#isValid"><b>isValid</b></a> () const</div></li> <li><div class=fn>QString <a href="#name"><b>name</b></a> () const</div></li> <li><div class=fn>int <a href="#permissions"><b>permissions</b></a> () const</div></li> <li><div class=fn>QString <a href="#owner"><b>owner</b></a> () const</div></li> <li><div class=fn>QString <a href="#group"><b>group</b></a> () const</div></li> <li><div class=fn>uint <a href="#size"><b>size</b></a> () const</div></li> <li><div class=fn>QDateTime <a href="#lastModified"><b>lastModified</b></a> () const</div></li> <li><div class=fn>QDateTime <a href="#lastRead"><b>lastRead</b></a> () const</div></li> <li><div class=fn>bool <a href="#isDir"><b>isDir</b></a> () const</div></li> <li><div class=fn>bool <a href="#isFile"><b>isFile</b></a> () const</div></li> <li><div class=fn>bool <a href="#isSymLink"><b>isSymLink</b></a> () const</div></li> <li><div class=fn>bool <a href="#isWritable"><b>isWritable</b></a> () const</div></li> <li><div class=fn>bool <a href="#isReadable"><b>isReadable</b></a> () const</div></li> <li><div class=fn>bool <a href="#isExecutable"><b>isExecutable</b></a> () const</div></li> <li><div class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const QUrlInfo & i ) const</div></li> </ul> <h2>Static Public Members</h2> <ul> <li><div class=fn>bool <a href="#greaterThan"><b>greaterThan</b></a> ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy )</div></li> <li><div class=fn>bool <a href="#lessThan"><b>lessThan</b></a> ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy )</div></li> <li><div class=fn>bool <a href="#equal"><b>equal</b></a> ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy )</div></li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> The QUrlInfo class stores information about URLs. <p> <p> This class is just a container for storing information about URLs, which is why all information must be passed in the constructor. <p> Unless you're reimplementing a network protocol you're unlikely to create QUrlInfo objects yourself, but you may get QUrlInfo objects from functions, e.g. <a href="qurloperator.html#info">QUrlOperator::info</a>(). <p>See also <a href="io.html">Input/Output and Networking</a> and <a href="misc.html">Miscellaneous Classes</a>. <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="QUrlInfo"></a>QUrlInfo::QUrlInfo () </h3> Constructs an invalid QUrlInfo object with default values. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn><a name="QUrlInfo-2"></a>QUrlInfo::QUrlInfo ( const <a href="qurloperator.html">QUrlOperator</a> & path, const <a href="qstring.html">QString</a> & file ) </h3> Constructs a QUrlInfo object with information about the file <em>file</em> in the <em>path</em>. It tries to find the information about the <em>file</em> in the <a href="qurloperator.html">QUrlOperator</a> <em>path</em>. <p> If the information is not found, this constructor creates an invalid QUrlInfo, i.e. <a href="#isValid">isValid</a>() returns FALSE. You should always check if the URL info is valid before relying on the return values of any getter functions. <p> If <em>file</em> is empty, it defaults to the actual directory of the QUrlOperator <em>path</em>. <p> <p>See also <a href="#isValid">isValid</a>() and <a href="qurloperator.html#info">QUrlOperator::info</a>(). <h3 class=fn><a name="QUrlInfo-3"></a>QUrlInfo::QUrlInfo ( const <a href="qurlinfo.html">QUrlInfo</a> & ui ) </h3> Copy constructor, copies <em>ui</em> to this URL info object. <h3 class=fn><a name="QUrlInfo-4"></a>QUrlInfo::QUrlInfo ( const <a href="qstring.html">QString</a> & name, int permissions, const <a href="qstring.html">QString</a> & owner, const <a href="qstring.html">QString</a> & group, uint size, const <a href="qdatetime.html">QDateTime</a> & lastModified, const <a href="qdatetime.html">QDateTime</a> & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable ) </h3> Constructs a QUrlInfo object by specifying all the URL's information. The information that is passed is the <em>name</em>, the <em>permissions</em>, the <em>owner</em> and <em>group</em>, as well as the <em>size</em>, <em>lastModified</em> date/time and <em>lastRead</em> date/time. Flags are also passed, specifically, <em>isDir</em>, <em>isFile</em>, <em>isSymLink</em>, <em>isWritable</em>, <em>isReadable</em> and <em>isExecutable</em>. <h3 class=fn><a name="QUrlInfo-5"></a>QUrlInfo::QUrlInfo ( const <a href="qurl.html">QUrl</a> & url, int permissions, const <a href="qstring.html">QString</a> & owner, const <a href="qstring.html">QString</a> & group, uint size, const <a href="qdatetime.html">QDateTime</a> & lastModified, const <a href="qdatetime.html">QDateTime</a> & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable ) </h3> Constructs a QUrlInfo object by specifying all the URL's information. The information that is passed is the <em>url</em>, the <em>permissions</em>, the <em>owner</em> and <em>group</em>, as well as the <em>size</em>, <em>lastModified</em> date/time and <em>lastRead</em> date/time. Flags are also passed, specifically, <em>isDir</em>, <em>isFile</em>, <em>isSymLink</em>, <em>isWritable</em>, <em>isReadable</em> and <em>isExecutable</em>. <h3 class=fn><a name="~QUrlInfo"></a>QUrlInfo::~QUrlInfo ()<tt> [virtual]</tt> </h3> Destroys the URL ifno object. The <a href="qurloperator.html">QUrlOperator</a> object to which this URL referred is not affected. <h3 class=fn>bool <a name="equal"></a>QUrlInfo::equal ( const <a href="qurlinfo.html">QUrlInfo</a> & i1, const <a href="qurlinfo.html">QUrlInfo</a> & i2, int sortBy )<tt> [static]</tt> </h3> Returns TRUE if <em>i1</em> equals to <em>i2</em>; otherwise returns FALSE. The objects are compared by the value, which is specified by <em>sortBy</em>. This must be one of QDir::Name, QDir::Time or QDir::Size. <h3 class=fn>bool <a name="greaterThan"></a>QUrlInfo::greaterThan ( const <a href="qurlinfo.html">QUrlInfo</a> & i1, const <a href="qurlinfo.html">QUrlInfo</a> & i2, int sortBy )<tt> [static]</tt> </h3> Returns TRUE if <em>i1</em> is greater than <em>i2</em>; otherwise returns FALSE. The objects are compared by the value, which is specified by <em>sortBy</em>. This must be one of QDir::Name, QDir::Time or QDir::Size. <h3 class=fn><a href="qstring.html">QString</a> <a name="group"></a>QUrlInfo::group () const </h3> Returns the group of the URL. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>bool <a name="isDir"></a>QUrlInfo::isDir () const </h3> Returns TRUE if the URL is a directory; otherwise returns FALSE. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Example: <a href="networkprotocol-example.html#x962">network/networkprotocol/nntp.cpp</a>. <h3 class=fn>bool <a name="isExecutable"></a>QUrlInfo::isExecutable () const </h3> Returns TRUE if the URL is executable; otherwise returns FALSE. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>bool <a name="isFile"></a>QUrlInfo::isFile () const </h3> Returns TRUE if the URL is a file; otherwise returns FALSE. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>bool <a name="isReadable"></a>QUrlInfo::isReadable () const </h3> Returns TRUE if the URL is readable; otherwise returns FALSE. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>bool <a name="isSymLink"></a>QUrlInfo::isSymLink () const </h3> Returns TRUE if the URL is a symbolic link; otherwise returns FALSE. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>bool <a name="isValid"></a>QUrlInfo::isValid () const </h3> Returns TRUE if the URL info is valid; otherwise returns FALSE. Valid means that the QUrlInfo contains real information. E.g., a call to <a href="qurloperator.html#info">QUrlOperator::info</a>() might return a an invalid QUrlInfo, if no information about the requested entry is available. <p> You should always check if the URL info is valid before relying on the values. <h3 class=fn>bool <a name="isWritable"></a>QUrlInfo::isWritable () const </h3> Returns TRUE if the URL is writable; otherwise returns FALSE. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="lastModified"></a>QUrlInfo::lastModified () const </h3> Returns the last modification date of the URL. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="lastRead"></a>QUrlInfo::lastRead () const </h3> Returns the date when the URL was read the last time. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>bool <a name="lessThan"></a>QUrlInfo::lessThan ( const <a href="qurlinfo.html">QUrlInfo</a> & i1, const <a href="qurlinfo.html">QUrlInfo</a> & i2, int sortBy )<tt> [static]</tt> </h3> Returns TRUE if <em>i1</em> is less than <em>i2</em>; otherwise returns FALSE. The objects are compared by the value, which is specified by <em>sortBy</em>. This must be one of QDir::Name, QDir::Time or QDir::Size. <h3 class=fn><a href="qstring.html">QString</a> <a name="name"></a>QUrlInfo::name () const </h3> Returns the file name of the URL. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Examples: <a href="ftpclient-example.html#x1030">network/ftpclient/ftpmainwindow.cpp</a> and <a href="ftpclient-example.html#x1044">network/ftpclient/ftpview.cpp</a>. <h3 class=fn><a href="qurlinfo.html">QUrlInfo</a> & <a name="operator-eq"></a>QUrlInfo::operator= ( const <a href="qurlinfo.html">QUrlInfo</a> & ui ) </h3> Assigns the values of <em>ui</em> to this QUrlInfo object. <h3 class=fn>bool <a name="operator-eq-eq"></a>QUrlInfo::operator== ( const <a href="qurlinfo.html">QUrlInfo</a> & i ) const </h3> Compares this QUrlInfo with <em>i</em> and returns TRUE if they are equal; otherwise returns FALSE. <h3 class=fn><a href="qstring.html">QString</a> <a name="owner"></a>QUrlInfo::owner () const </h3> Returns the owner of the URL. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>int <a name="permissions"></a>QUrlInfo::permissions () const </h3> Returns the permissions of the URL. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>void <a name="setDir"></a>QUrlInfo::setDir ( bool b )<tt> [virtual]</tt> </h3> If <em>b</em> 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 both a file and a directory even though most file systems do not support this duality.) <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Example: <a href="networkprotocol-example.html#x963">network/networkprotocol/nntp.cpp</a>. <h3 class=fn>void <a name="setFile"></a>QUrlInfo::setFile ( bool b )<tt> [virtual]</tt> </h3> If <em>b</em> is TRUE then the URL is set to be a file; if \b 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 both a file and a directory even though most file systems do not support this duality.) <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Example: <a href="networkprotocol-example.html#x964">network/networkprotocol/nntp.cpp</a>. <h3 class=fn>void <a name="setGroup"></a>QUrlInfo::setGroup ( const <a href="qstring.html">QString</a> & s )<tt> [virtual]</tt> </h3> Specifies that the owning group of the URL is called <em>s</em>. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>void <a name="setLastModified"></a>QUrlInfo::setLastModified ( const <a href="qdatetime.html">QDateTime</a> & dt )<tt> [virtual]</tt> </h3> Specifies that the object the URL refers to was last modified at <em>dt</em>. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>void <a name="setName"></a>QUrlInfo::setName ( const <a href="qstring.html">QString</a> & name )<tt> [virtual]</tt> </h3> Sets the name of the URL to <em>name</em>. The name is the full text, for example, "http://doc.trolltech.com/qurlinfo.html". <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Example: <a href="networkprotocol-example.html#x965">network/networkprotocol/nntp.cpp</a>. <h3 class=fn>void <a name="setOwner"></a>QUrlInfo::setOwner ( const <a href="qstring.html">QString</a> & s )<tt> [virtual]</tt> </h3> Specifies that the owner of the URL is called <em>s</em>. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>void <a name="setPermissions"></a>QUrlInfo::setPermissions ( int p )<tt> [virtual]</tt> </h3> Specifies that the URL has access permision <em>p</em>. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>void <a name="setReadable"></a>QUrlInfo::setReadable ( bool b )<tt> [virtual]</tt> </h3> Specifies that the URL is readable if <em>b</em> is TRUE and not readable if <em>b</em> is FALSE. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Example: <a href="networkprotocol-example.html#x966">network/networkprotocol/nntp.cpp</a>. <h3 class=fn>void <a name="setSize"></a>QUrlInfo::setSize ( uint s )<tt> [virtual]</tt> </h3> Specifies that the URL has size <em>s</em>. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <h3 class=fn>void <a name="setSymLink"></a>QUrlInfo::setSymLink ( bool b )<tt> [virtual]</tt> </h3> Specifies that the URL refers to a symbolic link if <em>b</em> is TRUE and that it does not if <em>b</em> is FALSE. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Example: <a href="networkprotocol-example.html#x967">network/networkprotocol/nntp.cpp</a>. <h3 class=fn>void <a name="setWritable"></a>QUrlInfo::setWritable ( bool b )<tt> [virtual]</tt> </h3> Specifies that the URL is writable if <em>b</em> is TRUE and not writable if <em>b</em> is FALSE. <p> If you call this function for an invalid URL info, this function turns it into a valid one. <p> <p>See also <a href="#isValid">isValid</a>(). <p>Example: <a href="networkprotocol-example.html#x968">network/networkprotocol/nntp.cpp</a>. <h3 class=fn>uint <a name="size"></a>QUrlInfo::size () const </h3> Returns the size of the URL. <p> <p>See also <a href="#isValid">isValid</a>(). <!-- eof --> <hr><p> This file is part of the <a href="index.html">Qt toolkit</a>. Copyright © 1995-2001 <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2001 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a> <td align=right><div align=right>Qt version 3.0.2</div> </table></div></address></body> </html>