Gjsify LogoGjsify Logo

Determines if a string matches a file attribute.

record

Hierarchy

  • FileAttributeMatcher

Index

Constructors

  • 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 #GFileAttributeMatcher 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.

    Parameters

    • attributes: string

      an attribute string to match.

    Returns FileAttributeMatcher

Properties

name: string

Methods

  • enumerate_namespace(ns: string): boolean
  • 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.

    Parameters

    • ns: string

      a string containing a file attribute namespace.

    Returns boolean

  • enumerate_next(): string
  • matches(attribute: string): boolean
  • 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.

    Parameters

    • attribute: string

      a file attribute key.

    Returns boolean

  • matches_only(attribute: string): boolean
  • Checks if a attribute matcher only matches a given attribute. Always returns %FALSE if "*" was used when creating the matcher.

    Parameters

    • attribute: string

      a file attribute key.

    Returns boolean

  • 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.

    Parameters

    Returns FileAttributeMatcher

  • to_string(): string
  • Prints what the matcher is matching against. The format will be equal to the format passed to g_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.

    Returns string

  • unref(): void
  • Unreferences matcher. If the reference count falls below 1, the matcher is automatically freed.

    Returns void

  • 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 #GFileAttributeMatcher 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.

    Parameters

    • attributes: string

      an attribute string to match.

    Returns FileAttributeMatcher

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method