11 |
|
// Thanks to the E.S.O. - ACS project that has done this C++ interface |
12 |
|
// to the wildcards pttern matching algorithm |
13 |
|
|
14 |
< |
#ifndef __cplusplus |
15 |
< |
#error This is a C++ include file and cannot be used from plain C |
16 |
< |
#endif |
14 |
> |
//#ifndef __cplusplus |
15 |
> |
//#error This is a C++ include file and cannot be used from plain C |
16 |
> |
//#endif |
17 |
|
|
18 |
|
// Implementation of the UN*X wildcards |
19 |
|
// Supported wild-characters: '*', '?'; sets: [a-z], '!' negation |
24 |
|
|
25 |
|
class Wildcard |
26 |
|
{ |
27 |
< |
public: |
27 |
> |
public: |
28 |
|
// This function implements the UN*X wildcards and returns: |
29 |
|
// 0 - if *wildcard does not match *test |
30 |
|
// 1 - if *wildcard matches *test |
31 |
|
static int wildcardfit (const char *wildcard, const char *test); |
32 |
|
|
33 |
< |
private: |
33 |
> |
private: |
34 |
|
// Scans a set of characters and returns 0 if the set mismatches at this |
35 |
|
// position in the teststring and 1 if it is matching |
36 |
|
// wildcard is set to the closing ] and test is unmodified if mismatched |