mask.h File Reference
Implements mask classes as flat function sets. More...
#include "translations.h"
Go to the source code of this file.
Constructors | |
| DLLIMPORT dar_mask * | dar_mask_create_same_path (char *path, bool case_sensit) |
| Matches if string is exactly the given mask (without wildcard expressions). | |
| DLLIMPORT dar_mask * | dar_mask_create_bool (bool always) |
| Always matches or never matches. | |
| DLLIMPORT dar_mask * | dar_mask_create_and () |
| Evaluates the logical and between two or more masks. | |
| DLLIMPORT dar_mask * | dar_mask_create_or () |
| Evaluates the logical or between two or more masks. | |
| DLLIMPORT dar_mask * | dar_mask_create_exclude_dir (char *path, bool case_sensit) |
| Matches any file and it's children. | |
| DLLIMPORT dar_mask * | dar_mask_create_not (dar_mask *mask) |
| Negation of another mask. | |
| DLLIMPORT dar_mask * | dar_mask_create_regular (char *expr, bool case_sensit) |
| Full regular expression matching. | |
| DLLIMPORT dar_mask * | dar_mask_create_simple (char *expr, bool case_sensit) |
| Simple text matching similiar to that done on the command line. | |
| DLLIMPORT dar_mask * | dar_mask_create_simple_path (char *path, bool case_sensit) |
| Matches any path and it's children plus any parents of that given path. | |
| DLLIMPORT void | dar_mask_destroy (dar_mask *mask) |
| Frees memory used by mask object. | |
Functions | |
| DLLIMPORT void | dar_mask_and_add (dar_mask *ref, dar_mask *new_mask) |
| Expands a union by adding another mask to an and mask. | |
| DLLIMPORT void | dar_mask_and_clear (dar_mask *ref) |
| Clears all entries from an and mask. | |
| DLLIMPORT U_I | dar_mask_and_size (dar_mask *ref) |
| Gets the number of elements in a union. | |
| DLLIMPORT void | dar_mask_or_add (dar_mask *ref, dar_mask *new_mask) |
| Narrows an intersection by adding another mask to an or mask. | |
| DLLIMPORT void | dar_mask_or_clear (dar_mask *ref) |
| Clears all entries from an or mask. | |
| DLLIMPORT U_I | dar_mask_or_size (dar_mask *ref) |
| Gets the number of elements in an intersection. | |
Detailed Description
Implements mask classes as flat function sets.
Definition in file mask.h.
Function Documentation
|
||||||||||||
|
Expands a union by adding another mask to an and mask.
|
|
|
Clears all entries from an and mask.
|
|
|
Gets the number of elements in a union.
|
|
|
Evaluates the logical and between two or more masks. Given the paths:
dar_mask* result = dar_mask_create_and();
dar_mask* m1 = dar_mask_create_simple("/f*", TRUE);
dar_mask* m2 = dar_mask_create_simple("*bar", TRUE);
dar_mask_and_add( m1 );
dar_mask_and_add( m2 );
dar_mask_destroy( m1 );
dar_mask_destroy( m2 );
The resulting match will be:
|
|
||||||||||||
|
Matches any file and it's children. Despite the name, this mask does not implicitly exclude. Wrap in a not mask to implement exclusion. Given the paths:
dar_mask* result = dar_mask_create_exclude_dir( "/foo/bar", TRUE ); The resulting matches will be:
To fix this problem, you must (if you really want to save the absolute path) use a simple path mask or save only the relative path information. In such a case: Given the paths:
NOTE FURTHER that if you use a relative path a simple mask will often be easier. Really, the exclude directory mask is meant for excluding specific paths within a hierarchy. When wrapped in a not mask the combination will provide the expected behavior.
dar_mask* m = dar_mask_create_exclude_dir( "/foo/bar", TRUE ); dar_mask* result = dar_mask_create_not( m ); dar_mask_destroy( m ); Given the original paths, the above code will produce the following matches:
|
|
|
Negation of another mask. Useful for selective exclusion. Given the paths:
dar_mask* m = dar_mask_create_simple("/this", TRUE);
dar_mask* result = dar_mask_create_not( m );
dar_mask_destroy( m );
The resulting matches will be:
|
|
|
Evaluates the logical or between two or more masks. Given the paths:
dar_mask* result = dar_mask_create_or();
dar_mask* m1 = dar_mask_create_simple("/f*", TRUE);
dar_mask* m2 = dar_mask_create_simple("/t*", TRUE);
dar_mask_or_add( m1 );
dar_mask_or_add( m2 );
dar_mask_destroy( m1 );
dar_mask_destroy( m2 );
The resulting matches will be:
|
|
||||||||||||
|
Full regular expression matching.
See |
|
||||||||||||
|
Matches if string is exactly the given mask (without wildcard expressions). Remember to destroy your input path when finished with it! |
|
||||||||||||
|
Simple text matching similiar to that done on the command line.
See |
|
||||||||||||
|
Matches any path and it's children plus any parents of that given path. Given the paths:
dar_mask* result = dar_mask_create_simple_path( "/foo/bar", TRUE ); The resulting matches will be:
|
|
|
Frees memory used by mask object. Works for all mask types. Definition at line 104 of file mask.cpp. Referenced by dar_sup_spec_destroy(), and dar_sup_storage_destroy(). |
|
||||||||||||
|
Narrows an intersection by adding another mask to an or mask.
|
|
|
Clears all entries from an or mask.
|
|
|
Gets the number of elements in an intersection.
|

