summaryrefslogtreecommitdiff
path: root/qmake/include/qfileinfo.h
Unidiff
Diffstat (limited to 'qmake/include/qfileinfo.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/qfileinfo.h150
1 files changed, 150 insertions, 0 deletions
diff --git a/qmake/include/qfileinfo.h b/qmake/include/qfileinfo.h
new file mode 100644
index 0000000..d6605b6
--- a/dev/null
+++ b/qmake/include/qfileinfo.h
@@ -0,0 +1,150 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QFileInfo class
5**
6** Created : 950628
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QFILEINFO_H
39#define QFILEINFO_H
40
41#ifndef QT_H
42#include "qfile.h"
43#include "qdatetime.h"
44#endif // QT_H
45
46
47class QDir;
48struct QFileInfoCache;
49
50
51class Q_EXPORT QFileInfo
52{
53public:
54 enum PermissionSpec {
55 ReadUser = 0400, WriteUser = 0200, ExeUser = 0100,
56 ReadGroup = 0040, WriteGroup = 0020, ExeGroup = 0010,
57 ReadOther = 0004, WriteOther = 0002, ExeOther = 0001 };
58
59 QFileInfo();
60 QFileInfo( const QString &file );
61 QFileInfo( const QFile & );
62#ifndef QT_NO_DIR
63 QFileInfo( const QDir &, const QString &fileName );
64#endif
65 QFileInfo( const QFileInfo & );
66 ~QFileInfo();
67
68 QFileInfo &operator=( const QFileInfo & );
69
70 voidsetFile( const QString &file );
71 voidsetFile( const QFile & );
72#ifndef QT_NO_DIR
73 voidsetFile( const QDir &, const QString &fileName );
74#endif
75 bool exists()const;
76 void refresh()const;
77 bool caching()const;
78 voidsetCaching( bool );
79
80 QString filePath()const;
81 QString fileName()const;
82#ifndef QT_NO_DIR //###
83 QString absFilePath()const;
84#endif
85 QStringbaseName( bool complete = FALSE ) const;
86 QStringextension( bool complete = TRUE ) const;
87
88#ifndef QT_NO_DIR //###
89 QStringdirPath( bool absPath = FALSE ) const;
90#endif
91#ifndef QT_NO_DIR
92 QDir dir( bool absPath = FALSE )const;
93#endif
94 bool isReadable()const;
95 bool isWritable()const;
96 bool isExecutable()const;
97 bool isHidden() const;
98
99#ifndef QT_NO_DIR //###
100 bool isRelative()const;
101 boolconvertToAbs();
102#endif
103
104 bool isFile()const;
105 bool isDir() const;
106 bool isSymLink()const;
107
108 QString readLink()const;
109
110 QString owner() const;
111 uint ownerId()const;
112 QString group() const;
113 uint groupId()const;
114
115 boolpermission( int permissionSpec ) const;
116
117#if (QT_VERSION-0 >= 0x040000)
118#error "QFileInfo::size() should return QIODevice::Offset instead of uint"
119#elif defined(QT_ABI_QT4)
120 QIODevice::Offset size()const;
121#else
122 uint size() const;
123#endif
124
125 QDateTime created()const;
126 QDateTime lastModified()const;
127 QDateTime lastRead()const;
128
129private:
130 voiddoStat() const;
131 static void slashify( QString & );
132 static void makeAbs( QString & );
133
134 QStringfn;
135 QFileInfoCache *fic;
136 boolcache;
137#if defined(Q_OS_UNIX)
138 bool symLink;
139#endif
140
141};
142
143
144inline bool QFileInfo::caching() const
145{
146 return cache;
147}
148
149
150#endif // QFILEINFO_H