Struct qt_core::q_dir::Filter

source ·
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.

C++ documentation:

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

source

pub fn to_int(&self) -> c_int

source§

impl Filter

source

pub const Dirs: Filter = _

List directories that match the filters. (C++ enum variant: Dirs = 1)

source

pub const Files: Filter = _

List files. (C++ enum variant: Files = 2)

source

pub const Drives: Filter = _

List disk drives (ignored under Unix). (C++ enum variant: Drives = 4)

Do not list symbolic links (ignored by operating systems that don’t support symbolic links). (C++ enum variant: NoSymLinks = 8)

source

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)

source

pub const TypeMask: Filter = _

C++ enum variant: TypeMask = 15

source

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)

source

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)

source

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)

source

pub const PermissionMask: Filter = _

C++ enum variant: PermissionMask = 112

source

pub const Modified: Filter = _

Only list files that have been modified (ignored on Unix). (C++ enum variant: Modified = 128)

source

pub const Hidden: Filter = _

List hidden files (on Unix, files starting with a “.”). (C++ enum variant: Hidden = 256)

source

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)

source

pub const AccessMask: Filter = _

C++ enum variant: AccessMask = 1008

source

pub const AllDirs: Filter = _

List all directories; i.e. don’t apply the filters to directory names. (C++ enum variant: AllDirs = 1024)

source

pub const CaseSensitive: Filter = _

The filter should be case sensitive. (C++ enum variant: CaseSensitive = 2048)

source

pub const NoDot: Filter = _

Do not list the special entry “.”. (C++ enum variant: NoDot = 8192)

source

pub const NoDotDot: Filter = _

Do not list the special entry “..”. (C++ enum variant: NoDotDot = 16384)

source

pub const NoDotAndDotDot: Filter = _

Do not list the special entries “.” and “..”. (C++ enum variant: NoDotAndDotDot = 24576)

source

pub const NoFilter: Filter = _

C++ enum variant: NoFilter = -1

Trait Implementations§

source§

impl<T: Into<QFlags<Filter>>> BitOr<T> for Filter

§

type Output = QFlags<Filter>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: T) -> QFlags<Filter>

Performs the | operation. Read more
source§

impl Clone for Filter

source§

fn clone(&self) -> Filter

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Filter

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Filter> for QFlags<Filter>

source§

fn from(value: Filter) -> Self

Converts to this type from the input type.
source§

impl From<Filter> for c_int

source§

fn from(value: Filter) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Filter

source§

fn from(value: c_int) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Filter

source§

fn eq(&self, other: &Filter) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Filter

source§

impl Eq for Filter

source§

impl StructuralEq for Filter

source§

impl StructuralPartialEq for Filter

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.