KVIrc  4.9.2
DeveloperAPIs
qurlinfo.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtNetwork module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QURLINFO_H
43 #define QURLINFO_H
44 
45 #include <qdatetime.h>
46 #include <qstring.h>
47 #include <qiodevice.h>
48 
49 QT_BEGIN_NAMESPACE
50 
51 class QUrl;
52 class QUrlInfoPrivate;
53 
54 class QUrlInfo
55 {
56 public:
58  {
59  ReadOwner = 00400,
60  WriteOwner = 00200,
61  ExeOwner = 00100,
62  ReadGroup = 00040,
63  WriteGroup = 00020,
64  ExeGroup = 00010,
65  ReadOther = 00004,
66  WriteOther = 00002,
67  ExeOther = 00001
68  };
69 
70  QUrlInfo();
71  QUrlInfo(const QUrlInfo & ui);
72  QUrlInfo(const QString & name, int permissions, const QString & owner,
73  const QString & group, qint64 size, const QDateTime & lastModified,
74  const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink,
75  bool isWritable, bool isReadable, bool isExecutable);
76  QUrlInfo(const QUrl & url, int permissions, const QString & owner,
77  const QString & group, qint64 size, const QDateTime & lastModified,
78  const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink,
79  bool isWritable, bool isReadable, bool isExecutable);
80  QUrlInfo & operator=(const QUrlInfo & ui);
81  virtual ~QUrlInfo();
82 
83  virtual void setName(const QString & name);
84  virtual void setDir(bool b);
85  virtual void setFile(bool b);
86  virtual void setSymLink(bool b);
87  virtual void setOwner(const QString & s);
88  virtual void setGroup(const QString & s);
89  virtual void setSize(qint64 size);
90  virtual void setWritable(bool b);
91  virtual void setReadable(bool b);
92  virtual void setPermissions(int p);
93  virtual void setLastModified(const QDateTime & dt);
94  void setLastRead(const QDateTime & dt);
95 
96  bool isValid() const;
97 
98  QString name() const;
99  int permissions() const;
100  QString owner() const;
101  QString group() const;
102  qint64 size() const;
103  QDateTime lastModified() const;
104  QDateTime lastRead() const;
105  bool isDir() const;
106  bool isFile() const;
107  bool isSymLink() const;
108  bool isWritable() const;
109  bool isReadable() const;
110  bool isExecutable() const;
111 
112  static bool greaterThan(const QUrlInfo & i1, const QUrlInfo & i2,
113  int sortBy);
114  static bool lessThan(const QUrlInfo & i1, const QUrlInfo & i2,
115  int sortBy);
116  static bool equal(const QUrlInfo & i1, const QUrlInfo & i2,
117  int sortBy);
118 
119  bool operator==(const QUrlInfo & i) const;
120  inline bool operator!=(const QUrlInfo & i) const
121  {
122  return !operator==(i);
123  }
124 
125 private:
127 };
128 
129 QT_END_NAMESPACE
130 
131 #endif // QURLINFO_H
virtual void setSize(qint64 size)
Definition: qurlinfo.cpp:362
virtual void setFile(bool b)
Definition: qurlinfo.cpp:263
Definition: qurlinfo.h:59
Definition: qurlinfo.cpp:50
QString group() const
Definition: qurlinfo.cpp:496
Definition: qurlinfo.h:67
virtual void setGroup(const QString &s)
Definition: qurlinfo.cpp:346
int permissions() const
Definition: qurlinfo.cpp:470
QString name() const
Definition: qurlinfo.cpp:456
bool isReadable() const
Definition: qurlinfo.cpp:600
virtual void setDir(bool b)
Definition: qurlinfo.cpp:244
virtual void setOwner(const QString &s)
Definition: qurlinfo.cpp:330
Definition: qurlinfo.h:63
Definition: qurlinfo.h:61
Definition: qurlinfo.h:60
bool operator!=(const QUrlInfo &i) const
Definition: qurlinfo.h:120
#define i
Definition: detector.cpp:73
Definition: qurlinfo.h:62
The QUrlInfo class stores information about URLs.
Definition: qurlinfo.h:54
QString owner() const
Definition: qurlinfo.cpp:483
virtual void setName(const QString &name)
Definition: qurlinfo.cpp:225
virtual void setPermissions(int p)
Definition: qurlinfo.cpp:378
bool isExecutable() const
Definition: qurlinfo.cpp:613
bool isWritable() const
Definition: qurlinfo.cpp:587
QUrlInfoPrivate * d
Definition: qurlinfo.h:126
bool isFile() const
Definition: qurlinfo.cpp:561
bool operator==(const QUrlInfo &i) const
Definition: qurlinfo.cpp:684
static bool equal(const QUrlInfo &i1, const QUrlInfo &i2, int sortBy)
Definition: qurlinfo.cpp:661
char s char s s
Definition: KviIrcNumericCodes.h:391
qint64 size() const
Definition: qurlinfo.cpp:509
Definition: qurlinfo.h:65
static bool greaterThan(const QUrlInfo &i1, const QUrlInfo &i2, int sortBy)
Definition: qurlinfo.cpp:627
bool isSymLink() const
Definition: qurlinfo.cpp:574
bool isValid() const
Definition: qurlinfo.cpp:711
static bool lessThan(const QUrlInfo &i1, const QUrlInfo &i2, int sortBy)
Definition: qurlinfo.cpp:649
Definition: qurlinfo.h:64
virtual ~QUrlInfo()
Definition: qurlinfo.cpp:425
PermissionSpec
Definition: qurlinfo.h:57
bool isDir() const
Definition: qurlinfo.cpp:548
void setLastRead(const QDateTime &dt)
Definition: qurlinfo.cpp:414
virtual void setSymLink(bool b)
Definition: qurlinfo.cpp:280
Definition: qurlinfo.h:66
QUrlInfo & operator=(const QUrlInfo &ui)
Definition: qurlinfo.cpp:434
virtual void setWritable(bool b)
Definition: qurlinfo.cpp:297
virtual void setLastModified(const QDateTime &dt)
Definition: qurlinfo.cpp:395
virtual void setReadable(bool b)
Definition: qurlinfo.cpp:314
QDateTime lastModified() const
Definition: qurlinfo.cpp:522
#define p
Definition: detector.cpp:80
QDateTime lastRead() const
Definition: qurlinfo.cpp:535
QUrlInfo()
Definition: qurlinfo.cpp:127