3.9 <GFileAttributeMatcher>

Structure: <GFileAttributeMatcher>

Determines if a string matches a file attribute.

Procedures

Method: file-attribute-matcher:enumerate-namespace? self ns ⇒ %return
Method: enumerate-namespace? self ns ⇒ %return

Checks if the matcher will match all of the keys in a given namespace. This will always return #t 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.

self

Passed: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.

ns

Passed: a string.

a string containing a file attribute namespace.

%return

Returned: a boolean.

#t if the matcher matches all of the entries in the given ns, #f otherwise.

Method: file-attribute-matcher:enumerate-next self ⇒ %return
Method: enumerate-next self ⇒ %return

Gets the next matched attribute from a <GFileAttributeMatcher>.

self

Passed: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.

%return

Returned: a string, or #f.

a string containing the next attribute or, #f if no more attribute exist.

Method: file-attribute-matcher:matches-only? self attribute ⇒ %return
Method: matches-only? self attribute ⇒ %return

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

self

Passed: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.

attribute

Passed: a string.

a file attribute key.

%return

Returned: a boolean.

#t if the matcher only matches attribute. #f otherwise.

Method: file-attribute-matcher:matches? self attribute ⇒ %return
Method: matches? self attribute ⇒ %return

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 #t.

self

Passed: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.

attribute

Passed: a string.

a file attribute key.

%return

Returned: a boolean.

#t if attribute matches self. #f otherwise.

Procedure: file-attribute-matcher:new attributes ⇒ %return

Creates a new file attribute matcher, which matches attributes against a given string. [GFileAttributeMatchers]FileAttributeMatcher 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 "namespace::key" strings may be concatenated with a single comma (e.g. "standard::type,standard::is-hidden"). 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.
attributes

Passed: a string.

an attribute string to match.

%return

Returned: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>

Method: file-attribute-matcher:ref self ⇒ %return
Method: ref self ⇒ %return

References a file attribute matcher.

self

Passed: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.

%return

Returned: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.

Method: file-attribute-matcher:subtract self [subtract] ⇒ %return
Method: subtract self [subtract] ⇒ %return

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

Note that currently it is not possible to remove a single attribute when the self 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.

self

Passed: a <GFileAttributeMatcher>.

Matcher to subtract from

subtract

Passed, or left out: a <GFileAttributeMatcher>, or #f.

The matcher to subtract

%return

Returned: a <GFileAttributeMatcher>, or #f.

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

Method: file-attribute-matcher:to-string self ⇒ %return
Method: to-string self ⇒ %return

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

self

Passed: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.

%return

Returned: a string.

a string describing the attributes the matcher matches against or #f if self was #f.

Method: file-attribute-matcher:unref self
Method: unref self

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

self

Passed: a <GFileAttributeMatcher>.

a <GFileAttributeMatcher>.