FileAttributeMatcher
Object Hierarchy:
Description:
[ CCode ( ref_function = "g_file_attribute_matcher_ref" , type_id = "g_file_attribute_matcher_get_type ()" , unref_function = "g_file_attribute_matcher_unref" ) ]
[ Compact ]
public class FileAttributeMatcher
[ Compact ]
public class FileAttributeMatcher
Determines if a string matches a file attribute.
Example: FileAttribute matching:
public struct Match {
public string a;
public string b;
public Match (string a, string b) {
this.a = a;
this.b = b;
}
}
public static int main (string[] args) {
Match[] equal_matches = new Match[] {
Match ("*", "*,*"),
Match ("*", "*,a::*"),
Match ("*", "*,a::b"),
Match ("*", "a::*,*"),
Match ("*", "a::b,*"),
Match ("*", "a::b,*,a::*")
};
// Output:
// ``true, true``
// ``true, true``
// ``true, true``
// ``true, true``
// ``true, true``
// ``true, true``
foreach (Match match in equal_matches) {
FileAttributeMatcher matcher = new FileAttributeMatcher (match.a);
bool a = matcher.matches (match.a);
bool b = matcher.matches (match.b);
print ("%s, %s\n", a.to_string (), b.to_string ());
}
return 0;
}
valac --pkg gio-2.0 GLib.FileAttributeMatcher.vala
Namespace: GLib
Package: gio-2.0