|
Packit |
1c1d7e |
/****************************************************************************
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** Definition of QFileInfo class
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** Created : 950628
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** This file is part of the tools module of the Qt GUI Toolkit.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** This file may be distributed under the terms of the Q Public License
|
|
Packit |
1c1d7e |
** as defined by Trolltech AS of Norway and appearing in the file
|
|
Packit |
1c1d7e |
** LICENSE.QPL included in the packaging of this file.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** This file may be distributed and/or modified under the terms of the
|
|
Packit |
1c1d7e |
** GNU General Public License version 2 as published by the Free Software
|
|
Packit |
1c1d7e |
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
Packit |
1c1d7e |
** packaging of this file.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
|
Packit |
1c1d7e |
** licenses may use this file in accordance with the Qt Commercial License
|
|
Packit |
1c1d7e |
** Agreement provided with the Software.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
Packit |
1c1d7e |
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
|
Packit |
1c1d7e |
** information about Qt Commercial License Agreements.
|
|
Packit |
1c1d7e |
** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
|
Packit |
1c1d7e |
** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
** Contact info@trolltech.com if any conditions of this licensing are
|
|
Packit |
1c1d7e |
** not clear to you.
|
|
Packit |
1c1d7e |
**
|
|
Packit |
1c1d7e |
**********************************************************************/
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#ifndef QFILEINFO_H
|
|
Packit |
1c1d7e |
#define QFILEINFO_H
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#ifndef QT_H
|
|
Packit |
1c1d7e |
#include "qfile.h"
|
|
Packit |
1c1d7e |
#include "qdatetime.h"
|
|
Packit |
1c1d7e |
#endif // QT_H
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class QDir;
|
|
Packit |
1c1d7e |
struct QFileInfoCache;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class Q_EXPORT QFileInfo // file information class
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
public:
|
|
Packit |
1c1d7e |
enum PermissionSpec {
|
|
Packit |
1c1d7e |
ReadUser = 0400, WriteUser = 0200, ExeUser = 0100,
|
|
Packit |
1c1d7e |
ReadGroup = 0040, WriteGroup = 0020, ExeGroup = 0010,
|
|
Packit |
1c1d7e |
ReadOther = 0004, WriteOther = 0002, ExeOther = 0001 };
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
QFileInfo();
|
|
Packit |
1c1d7e |
QFileInfo( const QString &file );
|
|
Packit |
1c1d7e |
QFileInfo( const QFile & );
|
|
Packit |
1c1d7e |
#ifndef QT_NO_DIR
|
|
Packit |
1c1d7e |
QFileInfo( const QDir &, const QString &fileName );
|
|
Packit |
1c1d7e |
#endif
|
|
Packit |
1c1d7e |
QFileInfo( const QFileInfo & );
|
|
Packit |
1c1d7e |
~QFileInfo();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
QFileInfo &operator=( const QFileInfo & );
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
void setFile( const QString &file );
|
|
Packit |
1c1d7e |
void setFile( const QFile & );
|
|
Packit |
1c1d7e |
#ifndef QT_NO_DIR
|
|
Packit |
1c1d7e |
void setFile( const QDir &, const QString &fileName );
|
|
Packit |
1c1d7e |
#endif
|
|
Packit |
1c1d7e |
bool exists() const;
|
|
Packit |
1c1d7e |
void refresh() const;
|
|
Packit |
1c1d7e |
bool caching() const;
|
|
Packit |
1c1d7e |
void setCaching( bool );
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
QString filePath() const;
|
|
Packit |
1c1d7e |
QString fileName() const;
|
|
Packit |
1c1d7e |
#ifndef QT_NO_DIR //###
|
|
Packit |
1c1d7e |
QString absFilePath() const;
|
|
Packit |
1c1d7e |
#endif
|
|
Packit |
1c1d7e |
QString baseName() const;
|
|
Packit |
1c1d7e |
QString extension( bool complete = TRUE ) const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#ifndef QT_NO_DIR //###
|
|
Packit |
1c1d7e |
QString dirPath( bool absPath = FALSE ) const;
|
|
Packit |
1c1d7e |
#endif
|
|
Packit |
1c1d7e |
#ifndef QT_NO_DIR
|
|
Packit |
1c1d7e |
QDir dir( bool absPath = FALSE ) const;
|
|
Packit |
1c1d7e |
#endif
|
|
Packit |
1c1d7e |
bool isReadable() const;
|
|
Packit |
1c1d7e |
bool isWritable() const;
|
|
Packit |
1c1d7e |
bool isExecutable() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#ifndef QT_NO_DIR //###
|
|
Packit |
1c1d7e |
bool isRelative() const;
|
|
Packit |
1c1d7e |
bool convertToAbs();
|
|
Packit |
1c1d7e |
#endif
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
bool isFile() const;
|
|
Packit |
1c1d7e |
bool isDir() const;
|
|
Packit |
1c1d7e |
bool isSymLink() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
QString readLink() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
QString owner() const;
|
|
Packit |
1c1d7e |
uint ownerId() const;
|
|
Packit |
1c1d7e |
QString group() const;
|
|
Packit |
1c1d7e |
uint groupId() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
bool permission( int permissionSpec ) const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
uint size() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
QDateTime lastModified() const;
|
|
Packit |
1c1d7e |
QDateTime lastRead() const;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
private:
|
|
Packit |
1c1d7e |
void doStat() const;
|
|
Packit |
1c1d7e |
static void slashify( QString & );
|
|
Packit |
1c1d7e |
static void makeAbs( QString & );
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
QString fn;
|
|
Packit |
1c1d7e |
QFileInfoCache *fic;
|
|
Packit |
1c1d7e |
bool cache;
|
|
Packit |
1c1d7e |
};
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
inline bool QFileInfo::caching() const
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
return cache;
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
#endif // QFILEINFO_H
|