|
Introduction | License | C API | C++ API Installing shwild | Building shwild | Linking to shwild | Contact & Feedback |
It supports single-function matching, as in:
// C or C++ shwild_match("1?2", "122", 0); // Returns 0 (matches) shwild_match("1[0-8]2", "122", 0); // Returns 0 (matches) shwild_match("1[0-8]2", "192", 0); // Returns 1 (does not match) shwild_match("1?2", "1x1", 0); // Returns 1 (does not match) shwild_match("1[N-Z]2", "1x2", 0); // Returns 1 (does not match) shwild_match("1[N-Z]2", "1x2", SHWILD_F_IGNORE_CASE); // Returns 0 (matches)
and:
// C++ only shwild::match("1?2", "122"); // Returns 0 (matches) shwild::match("1?2", "121", 0); // Returns 1 (does not match)
It also supports pattern pre-compilation, as in:
// C or C++ shwild_handle_t hCompiledPattern; if(shwild_compile_pattern("sh*.[cC]??", 0, &hCompiledPattern) >= 0) { shwild_match_pattern(hCompiledPattern, "shwild.cpp"); // Returns 0 (matches) shwild_match_pattern(hCompiledPattern, "shwild.hpp"); // Returns 1 (does not match) shwild_destroy_pattern(hCompiledPattern); }
and:
// C++ only shwild::Pattern pattern("sh*.[cC]??", 0); pattern.match("shwild.cpp"); // Returns true (matches) pattern.match("shwild.hpp"); // Returns false (does not match)
Suppressing characteristics or allowing more sophisticated behaviour is achieved by specifying one or more of the pattern control flags to the calls to shwild_match() and shwild_compile_pattern().
There is a COM mapping (written in C++, using ATL and STLSoft) called shwild.com, which is available separately from the website.
The implementation of shwild is dependent on the following open-source libraries:
In addition, the following open-source libraries are required by one or more test programs supplied in the standard distribution:
|
|
shwild Library documentation © Matthew Wilson and Sean Kelly, 2004-2006 |