1QUrlInfo(3qt)                                                    QUrlInfo(3qt)
2
3
4

NAME

6       QUrlInfo - Stores information about URLs
7

SYNOPSIS

9       #include <qurlinfo.h>
10
11   Public Members
12       enum PermissionSpec { ReadOwner = 00400, WriteOwner = 00200, ExeOwner =
13           00100, ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010,
14           ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 }
15       QUrlInfo ()
16       QUrlInfo ( const QUrlOperator & path, const QString & file )
17       QUrlInfo ( const QUrlInfo & ui )
18       QUrlInfo ( const QString & name, int permissions, const QString &
19           owner, const QString & group, uint size, const QDateTime &
20           lastModified, const QDateTime & lastRead, bool isDir, bool isFile,
21           bool isSymLink, bool isWritable, bool isReadable, bool isExecutable
22           )
23       QUrlInfo ( const QUrl & url, int permissions, const QString & owner,
24           const QString & group, uint size, const QDateTime & lastModified,
25           const QDateTime & lastRead, bool isDir, bool isFile, bool
26           isSymLink, bool isWritable, bool isReadable, bool isExecutable )
27       QUrlInfo & operator= ( const QUrlInfo & ui )
28       virtual ~QUrlInfo ()
29       virtual void setName ( const QString & name )
30       virtual void setDir ( bool b )
31       virtual void setFile ( bool b )
32       virtual void setSymLink ( bool b )
33       virtual void setOwner ( const QString & s )
34       virtual void setGroup ( const QString & s )
35       virtual void setSize ( uint size )
36       virtual void setWritable ( bool b )
37       virtual void setReadable ( bool b )
38       virtual void setPermissions ( int p )
39       virtual void setLastModified ( const QDateTime & dt )
40       bool isValid () const
41       QString name () const
42       int permissions () const
43       QString owner () const
44       QString group () const
45       uint size () const
46       QDateTime lastModified () const
47       QDateTime lastRead () const
48       bool isDir () const
49       bool isFile () const
50       bool isSymLink () const
51       bool isWritable () const
52       bool isReadable () const
53       bool isExecutable () const
54       bool operator== ( const QUrlInfo & i ) const
55
56   Static Public Members
57       bool greaterThan ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy
58           )
59       bool lessThan ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy )
60       bool equal ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy )
61

DESCRIPTION

63       The QUrlInfo class stores information about URLs.
64
65       This class is just a container for storing information about URLs,
66       which is why all information must be passed in the constructor.
67
68       Unless you're reimplementing a network protocol you're unlikely to
69       create QUrlInfo objects yourself, but you may receive QUrlInfo objects
70       from functions, e.g. QUrlOperator::info().
71
72       The information that can be retrieved includes name(), permissions(),
73       owner(), group(), size(), lastModified(), lastRead(), isDir(),
74       isFile(), isSymLink(), isWritable(), isReadable() and isExecutable().
75
76       See also Input/Output and Networking and Miscellaneous Classes.
77
78   Member Type Documentation

QUrlInfo::PermissionSpec

80       This enum is used by the permissions() function to report the
81       permissions of a file.
82
83       QUrlInfo::ReadOwner - The file is readable by the owner of the file.
84
85       QUrlInfo::WriteOwner - The file is writable by the owner of the file.
86
87       QUrlInfo::ExeOwner - The file is executable by the owner of the file.
88
89       QUrlInfo::ReadGroup - The file is readable by the group.
90
91       QUrlInfo::WriteGroup - The file is writable by the group.
92
93       QUrlInfo::ExeGroup - The file is executable by the group.
94
95       QUrlInfo::ReadOther - The file is readable by anyone.
96
97       QUrlInfo::WriteOther - The file is writable by anyone.
98
99       QUrlInfo::ExeOther - The file is executable by anyone.
100

MEMBER FUNCTION DOCUMENTATION

QUrlInfo::QUrlInfo ()

103       Constructs an invalid QUrlInfo object with default values.
104
105       See also isValid().
106

QUrlInfo::QUrlInfo ( const QUrlOperator & path, const QString & file )

108       Constructs a QUrlInfo object with information about the file file in
109       the path. It tries to find the information about the file in the
110       QUrlOperator path.
111
112       If the information is not found, this constructor creates an invalid
113       QUrlInfo, i.e. isValid() returns FALSE. You should always check if the
114       URL info is valid before relying on the return values of any getter
115       functions.
116
117       If file is empty, it defaults to the QUrlOperator path, i.e. to the
118       directory.
119
120       See also isValid() and QUrlOperator::info().
121

QUrlInfo::QUrlInfo ( const QUrlInfo & ui )

123       Copy constructor, copies ui to this URL info object.
124

QUrlInfo::QUrlInfo ( const QString & name, int permissions, const QString &

126       owner, const QString & group, uint size, const QDateTime &
127       lastModified, const QDateTime & lastRead, bool isDir, bool isFile, bool
128       isSymLink, bool isWritable, bool isReadable, bool isExecutable )
129       Constructs a QUrlInfo object by specifying all the URL's information.
130
131       The information that is passed is the name, file permissions, owner and
132       group and the file's size. Also passed is the lastModified date/time
133       and the lastRead date/time. Flags are also passed, specifically, isDir,
134       isFile, isSymLink, isWritable, isReadable and isExecutable.
135

QUrlInfo::QUrlInfo ( const QUrl & url, int permissions, const QString & owner,

137       const QString & group, uint size, const QDateTime & lastModified, const
138       QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, bool
139       isWritable, bool isReadable, bool isExecutable )
140       Constructs a QUrlInfo object by specifying all the URL's information.
141
142       The information that is passed is the url, file permissions, owner and
143       group and the file's size. Also passed is the lastModified date/time
144       and the lastRead date/time. Flags are also passed, specifically, isDir,
145       isFile, isSymLink, isWritable, isReadable and isExecutable.
146

QUrlInfo::~QUrlInfo () [virtual]

148       Destroys the URL info object.
149
150       The QUrlOperator object to which this URL referred (if any) is not
151       affected.
152

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

154       [static]
155       Returns TRUE if i1 equals to i2; otherwise returns FALSE. The objects
156       are compared by the value, which is specified by sortBy. This must be
157       one of QDir::Name, QDir::Time or QDir::Size.
158

bool QUrlInfo::greaterThan ( const QUrlInfo & i1, const QUrlInfo & i2, int

160       sortBy ) [static]
161       Returns TRUE if i1 is greater than i2; otherwise returns FALSE. The
162       objects are compared by the value, which is specified by sortBy. This
163       must be one of QDir::Name, QDir::Time or QDir::Size.
164

QString QUrlInfo::group () const

166       Returns the group of the URL.
167
168       See also isValid().
169

bool QUrlInfo::isDir () const

171       Returns TRUE if the URL is a directory; otherwise returns FALSE.
172
173       See also isValid().
174
175       Examples:
176

bool QUrlInfo::isExecutable () const

178       Returns TRUE if the URL is executable; otherwise returns FALSE.
179
180       See also isValid().
181

bool QUrlInfo::isFile () const

183       Returns TRUE if the URL is a file; otherwise returns FALSE.
184
185       See also isValid().
186

bool QUrlInfo::isReadable () const

188       Returns TRUE if the URL is readable; otherwise returns FALSE.
189
190       See also isValid().
191
193       Returns TRUE if the URL is a symbolic link; otherwise returns FALSE.
194
195       See also isValid().
196

bool QUrlInfo::isValid () const

198       Returns TRUE if the URL info is valid; otherwise returns FALSE. Valid
199       means that the QUrlInfo contains real information. For example, a call
200       to QUrlOperator::info() might return a an invalid QUrlInfo, if no
201       information about the requested entry is available.
202
203       You should always check if the URL info is valid before relying on the
204       values.
205

bool QUrlInfo::isWritable () const

207       Returns TRUE if the URL is writable; otherwise returns FALSE.
208
209       See also isValid().
210

QDateTime QUrlInfo::lastModified () const

212       Returns the last modification date of the URL.
213
214       See also isValid().
215
216       Example: network/ftpclient/ftpmainwindow.ui.h.
217

QDateTime QUrlInfo::lastRead () const

219       Returns the date when the URL was last read.
220
221       See also isValid().
222

bool QUrlInfo::lessThan ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy

224       ) [static]
225       Returns TRUE if i1 is less than i2; otherwise returns FALSE. The
226       objects are compared by the value, which is specified by sortBy. This
227       must be one of QDir::Name, QDir::Time or QDir::Size.
228

QString QUrlInfo::name () const

230       Returns the file name of the URL.
231
232       See also isValid().
233
234       Example: network/ftpclient/ftpmainwindow.ui.h.
235

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

237       Assigns the values of ui to this QUrlInfo object.
238

bool QUrlInfo::operator== ( const QUrlInfo & i ) const

240       Compares this QUrlInfo with i and returns TRUE if they are equal;
241       otherwise returns FALSE.
242

QString QUrlInfo::owner () const

244       Returns the owner of the URL.
245
246       See also isValid().
247

int QUrlInfo::permissions () const

249       Returns the permissions of the URL. You can use the PermissionSpec
250       flags to test for certain permissions.
251
252       See also isValid().
253

void QUrlInfo::setDir ( bool b ) [virtual]

255       If b is TRUE then the URL is set to be a directory; if \b is FALSE then
256       the URL is set not to be a directory (which normally means it is a
257       file). (Note that a URL can refer to both a file and a directory even
258       though most file systems do not support this.)
259
260       If you call this function for an invalid URL info, this function turns
261       it into a valid one.
262
263       See also isValid().
264
265       Example: network/networkprotocol/nntp.cpp.
266

void QUrlInfo::setFile ( bool b ) [virtual]

268       If b is TRUE then the URL is set to be a file; if \b is FALSE then the
269       URL is set not to be a file (which normally means it is a directory).
270       (Note that a URL can refer to both a file and a directory even though
271       most file systems do not support this.)
272
273       If you call this function for an invalid URL info, this function turns
274       it into a valid one.
275
276       See also isValid().
277
278       Example: network/networkprotocol/nntp.cpp.
279

void QUrlInfo::setGroup ( const QString & s ) [virtual]

281       Specifies that the owning group of the URL is called s.
282
283       If you call this function for an invalid URL info, this function turns
284       it into a valid one.
285
286       See also isValid().
287

void QUrlInfo::setLastModified ( const QDateTime & dt ) [virtual]

289       Specifies that the object the URL refers to was last modified at dt.
290
291       If you call this function for an invalid URL info, this function turns
292       it into a valid one.
293
294       See also isValid().
295

void QUrlInfo::setName ( const QString & name ) [virtual]

297       Sets the name of the URL to name. The name is the full text, for
298       example, "http://doc.trolltech.com/qurlinfo.html".
299
300       If you call this function for an invalid URL info, this function turns
301       it into a valid one.
302
303       See also isValid().
304
305       Example: network/networkprotocol/nntp.cpp.
306

void QUrlInfo::setOwner ( const QString & s ) [virtual]

308       Specifies that the owner of the URL is called s.
309
310       If you call this function for an invalid URL info, this function turns
311       it into a valid one.
312
313       See also isValid().
314

void QUrlInfo::setPermissions ( int p ) [virtual]

316       Specifies that the URL has access permisions, p.
317
318       If you call this function for an invalid URL info, this function turns
319       it into a valid one.
320
321       See also isValid().
322

void QUrlInfo::setReadable ( bool b ) [virtual]

324       Specifies that the URL is readable if b is TRUE and not readable if b
325       is FALSE.
326
327       If you call this function for an invalid URL info, this function turns
328       it into a valid one.
329
330       See also isValid().
331
332       Example: network/networkprotocol/nntp.cpp.
333

void QUrlInfo::setSize ( uint size ) [virtual]

335       Specifies the size of the URL.
336
337       If you call this function for an invalid URL info, this function turns
338       it into a valid one.
339
340       See also isValid().
341
343       Specifies that the URL refers to a symbolic link if b is TRUE and that
344       it does not if b is FALSE.
345
346       If you call this function for an invalid URL info, this function turns
347       it into a valid one.
348
349       See also isValid().
350
351       Example: network/networkprotocol/nntp.cpp.
352

void QUrlInfo::setWritable ( bool b ) [virtual]

354       Specifies that the URL is writable if b is TRUE and not writable if b
355       is FALSE.
356
357       If you call this function for an invalid URL info, this function turns
358       it into a valid one.
359
360       See also isValid().
361
362       Example: network/networkprotocol/nntp.cpp.
363

uint QUrlInfo::size () const

365       Returns the size of the URL.
366
367       See also isValid().
368
369       Example: network/ftpclient/ftpmainwindow.ui.h.
370
371

SEE ALSO

373       http://doc.trolltech.com/qurlinfo.html
374       http://www.trolltech.com/faq/tech.html
375
377       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
378       license file included in the distribution for a complete license
379       statement.
380

AUTHOR

382       Generated automatically from the source code.
383

BUGS

385       If you find a bug in Qt, please report it as described in
386       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
387       help you. Thank you.
388
389       The definitive Qt documentation is provided in HTML format; it is
390       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
391       web browser. This man page is provided as a convenience for those users
392       who prefer man pages, although this format is not officially supported
393       by Trolltech.
394
395       If you find errors in this manual page, please report them to qt-
396       bugs@trolltech.com.  Please include the name of the manual page
397       (qurlinfo.3qt) and the Qt version (3.3.8).
398
399
400
401Trolltech AS                    2 February 2007                  QUrlInfo(3qt)
Impressum