gi-gio
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Structs.FileAttributeMatcher

Description

Determines if a string matches a file attribute.

Synopsis

Exported types

newtype FileAttributeMatcher Source #

Memory-managed wrapper type.

Instances

Instances details
Eq FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

GBoxed FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

ManagedPtrNewtype FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

TypedObject FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

glibType :: IO GType #

HasParentTypes FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

HasAttributeList FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

(signature ~ (Text -> m Bool), MonadIO m) => OverloadedMethod FileAttributeMatcherEnumerateNamespaceMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

(signature ~ m (Maybe Text), MonadIO m) => OverloadedMethod FileAttributeMatcherEnumerateNextMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

(signature ~ (Text -> m Bool), MonadIO m) => OverloadedMethod FileAttributeMatcherMatchesMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

(signature ~ (Text -> m Bool), MonadIO m) => OverloadedMethod FileAttributeMatcherMatchesOnlyMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

(signature ~ m FileAttributeMatcher, MonadIO m) => OverloadedMethod FileAttributeMatcherRefMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

(signature ~ (Maybe FileAttributeMatcher -> m (Maybe FileAttributeMatcher)), MonadIO m) => OverloadedMethod FileAttributeMatcherSubtractMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

(signature ~ m Text, MonadIO m) => OverloadedMethod FileAttributeMatcherToStringMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

(signature ~ m (), MonadIO m) => OverloadedMethod FileAttributeMatcherUnrefMethodInfo FileAttributeMatcher signature Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

overloadedMethod :: FileAttributeMatcher -> signature #

OverloadedMethodInfo FileAttributeMatcherEnumerateNamespaceMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

OverloadedMethodInfo FileAttributeMatcherEnumerateNextMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

OverloadedMethodInfo FileAttributeMatcherMatchesMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

OverloadedMethodInfo FileAttributeMatcherMatchesOnlyMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

OverloadedMethodInfo FileAttributeMatcherRefMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

OverloadedMethodInfo FileAttributeMatcherSubtractMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

OverloadedMethodInfo FileAttributeMatcherToStringMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

OverloadedMethodInfo FileAttributeMatcherUnrefMethodInfo FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

(info ~ ResolveFileAttributeMatcherMethod t FileAttributeMatcher, OverloadedMethod info FileAttributeMatcher p, HasField t FileAttributeMatcher p) => HasField (t :: Symbol) FileAttributeMatcher (p :: Type) Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

(info ~ ResolveFileAttributeMatcherMethod t FileAttributeMatcher, OverloadedMethodInfo info FileAttributeMatcher) => IsLabel t (MethodProxy info FileAttributeMatcher) Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

(info ~ ResolveFileAttributeMatcherMethod t FileAttributeMatcher, OverloadedMethod info FileAttributeMatcher p) => IsLabel t (FileAttributeMatcher -> p) Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

IsGValue (Maybe FileAttributeMatcher) Source #

Convert FileAttributeMatcher to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

type AttributeList FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

type ParentTypes FileAttributeMatcher Source # 
Instance details

Defined in GI.Gio.Structs.FileAttributeMatcher

Methods

Click to display all available methods, including inherited ones

Expand

Methods

enumerateNamespace, enumerateNext, matches, matchesOnly, ref, subtract, toString, unref.

Getters

None.

Setters

None.

enumerateNamespace

fileAttributeMatcherEnumerateNamespace Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FileAttributeMatcher

matcher: a FileAttributeMatcher.

-> Text

ns: a string containing a file attribute namespace.

-> m Bool

Returns: True if the matcher matches all of the entries in the given ns, False otherwise.

Checks if the matcher will match all of the keys in a given namespace. This will always return True if a wildcard character is in use (e.g. if matcher was created with "standard::*" and ns is "standard", or if matcher was created using "*" and namespace is anything.)

TODO: this is awkwardly worded.

enumerateNext

fileAttributeMatcherEnumerateNext Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FileAttributeMatcher

matcher: a FileAttributeMatcher.

-> m (Maybe Text)

Returns: a string containing the next attribute or, Nothing if no more attribute exist.

Gets the next matched attribute from a FileAttributeMatcher.

matches

fileAttributeMatcherMatches Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FileAttributeMatcher

matcher: a FileAttributeMatcher.

-> Text

attribute: a file attribute key.

-> m Bool

Returns: True if attribute matches matcher. False otherwise.

Checks if an attribute will be matched by an attribute matcher. If the matcher was created with the "*" matching string, this function will always return True.

matchesOnly

fileAttributeMatcherMatchesOnly Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FileAttributeMatcher

matcher: a FileAttributeMatcher.

-> Text

attribute: a file attribute key.

-> m Bool

Returns: True if the matcher only matches attribute. False otherwise.

Checks if an attribute matcher only matches a given attribute. Always returns False if "*" was used when creating the matcher.

new

fileAttributeMatcherNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

attributes: an attribute string to match.

-> m FileAttributeMatcher

Returns: a FileAttributeMatcher

Creates a new file attribute matcher, which matches attributes against a given string. GFileAttributeMatchers are reference counted structures, and are created with a reference count of 1. If the number of references falls to 0, the FileAttributeMatcher is automatically destroyed.

The attributes string should be formatted with specific keys separated from namespaces with a double colon. Several "namespacekey" strings may be concatenated with a single comma (e.g. "standardtype,standardisHidden"). The wildcard "*" may be used to match all keys and namespaces, or "namespace::*" will match all keys in a given namespace.

Examples of file attribute matcher strings and results

  • "*": matches all attributes.
  • "standard::is-hidden": matches only the key is-hidden in the standard namespace.
  • "standard::type,unix::*": matches the type key in the standard namespace and all keys in the unix namespace.

ref

fileAttributeMatcherRef Source #

References a file attribute matcher.

subtract

fileAttributeMatcherSubtract Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe FileAttributeMatcher

matcher: Matcher to subtract from

-> Maybe FileAttributeMatcher

subtract: The matcher to subtract

-> m (Maybe FileAttributeMatcher)

Returns: A file attribute matcher matching all attributes of matcher that are not matched by subtract

Subtracts all attributes of subtract from matcher and returns a matcher that supports those attributes.

Note that currently it is not possible to remove a single attribute when the matcher matches the whole namespace - or remove a namespace or attribute when the matcher matches everything. This is a limitation of the current implementation, but may be fixed in the future.

toString

fileAttributeMatcherToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe FileAttributeMatcher

matcher: a FileAttributeMatcher.

-> m Text

Returns: a string describing the attributes the matcher matches against or Nothing if matcher was Nothing.

Prints what the matcher is matching against. The format will be equal to the format passed to fileAttributeMatcherNew. The output however, might not be identical, as the matcher may decide to use a different order or omit needless parts.

Since: 2.32

unref

fileAttributeMatcherUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FileAttributeMatcher

matcher: a FileAttributeMatcher.

-> m () 

Unreferences matcher. If the reference count falls below 1, the matcher is automatically freed.