equal


Description:

public bool equal (PatternSpec pspec)

Compares two compiled pattern specs and returns whether they will match the same set of strings.

Example: Compare two compiled pattern specs:

public static int main (string[] args) {
PatternSpec spec = new PatternSpec ("dilbert-????/??/??.*");

// Output: ``true``
PatternSpec spec2 = new PatternSpec ("dilbert-????/??/??.****");
bool res = spec.equal (spec2);
print ("%s\n", res.to_string ());

// Output: ``false``
spec2 = new PatternSpec ("*dilbert-????/??/??.****");
res = spec.equal (spec2);
print ("%s\n", res.to_string ());

return 0;
}

valac --pkg glib-2.0 GLib.PatternSpec.equal.vala

Parameters:

this

a PatternSpec

pspec2

another PatternSpec

Returns:

Whether the compiled patterns are equal