⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qdir.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
📖 第 1 页 / 共 3 页
字号:
'\" t.TH QDir 3qt "17 July 2003" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQDir \- Traverses directory structures and contents in a platform-independent way.br.PP\fC#include <qdir.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBFilterSpec\fR { Dirs = 0x001, Files = 0x002, Drives = 0x004, NoSymLinks = 0x008, All = 0x007, TypeMask = 0x00F, Readable = 0x010, Writable = 0x020, Executable = 0x040, RWEMask = 0x070, Modified = 0x080, Hidden = 0x100, System = 0x200, AccessMask = 0x3F0, DefaultFilter = -1 }".br.ti -1c.BI "enum \fBSortSpec\fR { Name = 0x00, Time = 0x01, Size = 0x02, Unsorted = 0x03, SortByMask = 0x03, DirsFirst = 0x04, Reversed = 0x08, IgnoreCase = 0x10, DefaultSort = -1 }".br.ti -1c.BI "\fBQDir\fR () ".br.ti -1c.BI "\fBQDir\fR ( const QString & " "path" ", const QString & nameFilter = QString::null, int sortSpec = Name | IgnoreCase, int " "filterSpec" " = All ) ".br.ti -1c.BI "\fBQDir\fR ( const QDir & ) ".br.ti -1c.BI "virtual \fB~QDir\fR () ".br.ti -1c.BI "QDir& \fBoperator=\fR ( const QDir & ) ".br.ti -1c.BI "QDir& \fBoperator=\fR ( const QString & path ) ".br.ti -1c.BI "virtual void \fBsetPath\fR ( const QString & path ) ".br.ti -1c.BI "virtual QString \fBpath\fR () const".br.ti -1c.BI "virtual QString \fBabsPath\fR () const".br.ti -1c.BI "virtual QString \fBcanonicalPath\fR () const".br.ti -1c.BI "virtual QString \fBdirName\fR () const".br.ti -1c.BI "virtual QString \fBfilePath\fR ( const QString & " "fileName" ", bool " "acceptAbsPath" " = TRUE ) const".br.ti -1c.BI "virtual QString \fBabsFilePath\fR ( const QString & " "fileName" ", bool " "acceptAbsPath" " = TRUE ) const".br.ti -1c.BI "virtual bool \fBcd\fR ( const QString & " "dirName" ", bool " "acceptAbsPath" " = TRUE ) ".br.ti -1c.BI "virtual bool \fBcdUp\fR () ".br.ti -1c.BI "QString \fBnameFilter\fR () const".br.ti -1c.BI "virtual void \fBsetNameFilter\fR ( const QString & nameFilter ) ".br.ti -1c.BI "FilterSpec \fBfilter\fR () const".br.ti -1c.BI "virtual void \fBsetFilter\fR ( int filterSpec ) ".br.ti -1c.BI "SortSpec \fBsorting\fR () const".br.ti -1c.BI "virtual void \fBsetSorting\fR ( int sortSpec ) ".br.ti -1c.BI "bool \fBmatchAllDirs\fR () const".br.ti -1c.BI "virtual void \fBsetMatchAllDirs\fR ( bool ) ".br.ti -1c.BI "uint \fBcount\fR () const".br.ti -1c.BI "QString \fBoperator[]\fR ( int ) const".br.ti -1c.BI "virtual QStrList \fBencodedEntryList\fR ( int " "filterSpec" " = DefaultFilter, int " "sortSpec" " = DefaultSort ) const".br.ti -1c.BI "virtual QStrList \fBencodedEntryList\fR ( const QString & " "nameFilter" ", int " "filterSpec" " = DefaultFilter, int " "sortSpec" " = DefaultSort ) const".br.ti -1c.BI "virtual QStringList \fBentryList\fR ( int " "filterSpec" " = DefaultFilter, int " "sortSpec" " = DefaultSort ) const".br.ti -1c.BI "virtual QStringList \fBentryList\fR ( const QString & " "nameFilter" ", int " "filterSpec" " = DefaultFilter, int " "sortSpec" " = DefaultSort ) const".br.ti -1c.BI "virtual const QFileInfoList* \fBentryInfoList\fR ( int " "filterSpec" " = DefaultFilter, int " "sortSpec" " = DefaultSort ) const".br.ti -1c.BI "virtual const QFileInfoList* \fBentryInfoList\fR ( const QString & " "nameFilter" ", int " "filterSpec" " = DefaultFilter, int " "sortSpec" " = DefaultSort ) const".br.ti -1c.BI "virtual bool \fBmkdir\fR ( const QString & " "dirName" ", bool " "acceptAbsPath" " = TRUE ) const".br.ti -1c.BI "virtual bool \fBrmdir\fR ( const QString & " "dirName" ", bool " "acceptAbsPath" " = TRUE ) const".br.ti -1c.BI "virtual bool \fBisReadable\fR () const".br.ti -1c.BI "virtual bool \fBexists\fR () const".br.ti -1c.BI "virtual bool \fBisRoot\fR () const".br.ti -1c.BI "virtual bool \fBisRelative\fR () const".br.ti -1c.BI "virtual void \fBconvertToAbs\fR () ".br.ti -1c.BI "virtual bool \fBoperator==\fR ( const QDir & ) const".br.ti -1c.BI "virtual bool \fBoperator!=\fR ( const QDir & ) const".br.ti -1c.BI "virtual bool \fBremove\fR ( const QString & " "fileName" ", bool " "acceptAbsPath" " = TRUE ) ".br.ti -1c.BI "virtual bool \fBrename\fR ( const QString & " "name" ", const QString & " "newName" ", bool " "acceptAbsPaths" " = TRUE ) ".br.ti -1c.BI "virtual bool \fBexists\fR ( const QString & " "name" ", bool " "acceptAbsPath" " = TRUE ) ".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QString \fBconvertSeparators\fR ( const QString & pathName ) ".br.ti -1c.BI "const QFileInfoList* \fBdrives\fR () ".br.ti -1c.BI "char \fBseparator\fR () ".br.ti -1c.BI "bool \fBsetCurrent\fR ( const QString & path ) ".br.ti -1c.BI "QDir \fBcurrent\fR () ".br.ti -1c.BI "QDir \fBhome\fR () ".br.ti -1c.BI "QDir \fBroot\fR () ".br.ti -1c.BI "QString \fBcurrentDirPath\fR () ".br.ti -1c.BI "QString \fBhomeDirPath\fR () ".br.ti -1c.BI "QString \fBrootDirPath\fR () ".br.ti -1c.BI "bool \fBmatch\fR ( const QStringList & " "filters" ", const QString & fileName ) ".br.ti -1c.BI "bool \fBmatch\fR ( const QString & " "filter" ", const QString & fileName ) ".br.ti -1c.BI "QString \fBcleanDirPath\fR ( const QString & dirPath ) ".br.ti -1c.BI "bool \fBisRelativePath\fR ( const QString & path ) ".br.in -1c.SH DESCRIPTIONTraverses directory structures and contents in a platform-independent way..PPA QDir can point to a file using either a relative or an absolute file path. Absolute file paths begin with the directory separator ('/') or a drive specification (not applicable to UNIX). Relative file names begin with a directory name or a file name and specify a path relative to the current directory..PPAn example of an absolute path is the string "/tmp/quartz", a relative path might look like "src/fatlib". You can use the function isRelative() to check if a QDir is using a relative or an absolute file path. You can call the function convertToAbs() to convert a relative QDir to an absolute one..PPThe directory "example" under the current directory is checked for existence in the example below:.PP.nf.br    QDir d( "example" );                        // "./example".br    if ( !d.exists() ).br        qWarning( "Cannot find the example directory" );.fi.PPIf you always use '/' as a directory separator, Qt will translate your paths to conform to the underlying operating system..PPcd() and cdUp() can be used to navigate the directory tree. Note that the logical cd and cdUp operations are not performed if the new directory does not exist..PPExample:.PP.nf.br    QDir d = QDir::root();                      // "/".br    if ( !d.cd("tmp") ) {                       // "/tmp".br        qWarning( "Cannot find the \\"/tmp\\" directory" );.br    } else {.br        QFile f( d.filePath("ex1.txt") );       // "/tmp/ex1.txt".br        if ( !f.open(IO_ReadWrite) ).br            qWarning( "Cannot create the file %s", f.name() );.br    }.fi.PPTo read the contents of a directory you can use the entryList() and entryInfoList() functions..PPExample:.PP.nf.br    #include <stdio.h>.br    #include <qdir.h>.br.br    //.br    // This program scans the current directory and lists all files

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -