pub struct Filter(/* private fields */);
Expand description
This enum describes the filtering options available to QDir; e.g. for entryList() and entryInfoList(). The filter value is specified by combining values from the following list using the bitwise OR operator:
C++ enum: QDir::Filter
.
This enum describes the filtering options available to QDir; e.g. for entryList() and entryInfoList(). The filter value is specified by combining values from the following list using the bitwise OR operator:
Functions that use Filter enum values to filter lists of files and directories will include symbolic links to files and directories unless you set the NoSymLinks value.
A default constructed QDir will not filter out files based on their permissions, so entryList() and entryInfoList() will return all files that are readable, writable, executable, or any combination of the three. This makes the default easy to write, and at the same time useful.
For example, setting the Readable
, Writable
, and Files
flags allows all files to be listed for which the application has read access, write access or both. If the Dirs
and Drives
flags are also included in this combination then all drives, directories, all files that the application can read, write, or execute, and symlinks to such files/directories can be listed.
To retrieve the permissons for a directory, use the entryInfoList() function to get the associated QFileInfo objects and then use the QFileInfo::permissons() to obtain the permissions and ownership for each file.
The Filters type is a typedef for QFlags<Filter>. It stores an OR combination of Filter values.
Implementations§
source§impl Filter
impl Filter
sourcepub const Dirs: Filter = _
pub const Dirs: Filter = _
List directories that match the filters. (C++ enum variant: Dirs = 1
)
sourcepub const Drives: Filter = _
pub const Drives: Filter = _
List disk drives (ignored under Unix). (C++ enum variant: Drives = 4
)
sourcepub const NoSymLinks: Filter = _
pub const NoSymLinks: Filter = _
Do not list symbolic links (ignored by operating systems that don’t support symbolic links). (C++ enum variant: NoSymLinks = 8
)
sourcepub const AllEntries: Filter = _
pub const AllEntries: Filter = _
List directories, files, drives and symlinks (this does not list broken symlinks unless you specify System). (C++ enum variant: AllEntries = 7
)
sourcepub const Readable: Filter = _
pub const Readable: Filter = _
List files for which the application has read access. The Readable value needs to be combined with Dirs or Files. (C++ enum variant: Readable = 16
)
sourcepub const Writable: Filter = _
pub const Writable: Filter = _
List files for which the application has write access. The Writable value needs to be combined with Dirs or Files. (C++ enum variant: Writable = 32
)
sourcepub const Executable: Filter = _
pub const Executable: Filter = _
List files for which the application has execute access. The Executable value needs to be combined with Dirs or Files. (C++ enum variant: Executable = 64
)
sourcepub const PermissionMask: Filter = _
pub const PermissionMask: Filter = _
C++ enum variant: PermissionMask = 112
sourcepub const Modified: Filter = _
pub const Modified: Filter = _
Only list files that have been modified (ignored on Unix). (C++ enum variant: Modified = 128
)
sourcepub const Hidden: Filter = _
pub const Hidden: Filter = _
List hidden files (on Unix, files starting with a “.”). (C++ enum variant: Hidden = 256
)
sourcepub const System: Filter = _
pub const System: Filter = _
List system files (on Unix, FIFOs, sockets and device files are included; on Windows, .lnk
files are included) (C++ enum variant: System = 512
)
sourcepub const AccessMask: Filter = _
pub const AccessMask: Filter = _
C++ enum variant: AccessMask = 1008
sourcepub const AllDirs: Filter = _
pub const AllDirs: Filter = _
List all directories; i.e. don’t apply the filters to directory names. (C++ enum variant: AllDirs = 1024
)
sourcepub const CaseSensitive: Filter = _
pub const CaseSensitive: Filter = _
The filter should be case sensitive. (C++ enum variant: CaseSensitive = 2048
)
sourcepub const NoDot: Filter = _
pub const NoDot: Filter = _
Do not list the special entry “.”. (C++ enum variant: NoDot = 8192
)
sourcepub const NoDotDot: Filter = _
pub const NoDotDot: Filter = _
Do not list the special entry “..”. (C++ enum variant: NoDotDot = 16384
)
sourcepub const NoDotAndDotDot: Filter = _
pub const NoDotAndDotDot: Filter = _
Do not list the special entries “.” and “..”. (C++ enum variant: NoDotAndDotDot = 24576
)