QtCore/qfileinfo.h Source File
Go to the documentation of this file.
56 class QDirIteratorPrivate;
58 class QFileInfoPrivate;
62 friend class QDirIteratorPrivate;
64 explicit QFileInfo(QFileInfoPrivate *d);
68 QFileInfo(
const QFile &file);
69 QFileInfo(
const QDir &dir,
const QString &file);
70 QFileInfo(
const QFileInfo &fileinfo);
73 QFileInfo &operator=(
const QFileInfo &fileinfo);
74 #ifdef Q_COMPILER_RVALUE_REFS
75 inline QFileInfo&operator=(QFileInfo &&other)
76 {
qSwap(d_ptr, other.d_ptr);
return *
this; }
79 bool operator==(
const QFileInfo &fileinfo)
const;
83 void setFile(
const QString &file);
84 void setFile(
const QFile &file);
85 void setFile(
const QDir &dir,
const QString &file);
90 QString absoluteFilePath()
const;
91 QString canonicalFilePath()
const;
94 QString completeBaseName()
const;
103 QDir absoluteDir()
const;
105 bool isReadable()
const;
106 bool isWritable()
const;
107 bool isExecutable()
const;
108 bool isHidden()
const;
110 bool isRelative()
const;
116 bool isSymLink()
const;
118 bool isBundle()
const;
124 uint ownerId()
const;
126 uint groupId()
const;
128 bool permission(QFile::Permissions permissions)
const;
129 QFile::Permissions permissions()
const;
133 QDateTime created()
const;
134 QDateTime lastModified()
const;
135 QDateTime lastRead()
const;
139 bool caching()
const;
140 void setCaching(
bool on);
149 Q_DECLARE_FLAGS(PermissionSpec, Permission)
153 return completeBaseName();
156 inline QT3_SUPPORT
QString extension(
bool complete =
true)
const {
158 return completeSuffix();
161 inline QT3_SUPPORT
QString absFilePath()
const {
return absoluteFilePath(); }
163 inline QT3_SUPPORT
QString dirPath(
bool absPath =
false)
const {
165 return absolutePath();
168 QT3_SUPPORT QDir dir(
bool absPath)
const;
169 inline QT3_SUPPORT
bool convertToAbs() {
return makeAbsolute(); }
170 #if !defined(Q_NO_TYPESAFE_FLAGS)
171 inline QT3_SUPPORT
bool permission(PermissionSpec permissions)
const
172 {
return permission(QFile::Permissions(static_cast<int>(permissions))); }
179 inline QFileInfoPrivate* d_func()
182 return const_cast<QFileInfoPrivate *
>(d_ptr.
constData());
185 inline const QFileInfoPrivate* d_func()
const
194 Q_DECLARE_OPERATORS_FOR_FLAGS(QFileInfo::PermissionSpec)
206 #endif // QFILEINFO_H
QList< QFileInfo > QFileInfoList
QString symLinkTarget() const
const T * constData() const
bool operator!=(const QFileInfo &fileinfo) const
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
#define QT_BEGIN_NAMESPACE
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE)
bool operator!=(const QFileInfo &fileinfo)
QSharedDataPointer< QFileInfoPrivate > d_ptr