2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2004 Net Integration Technologies, Inc.
5 * Globbing support (ie. filename wildcards) through WvRegex
13 @brief WvGlob -- Unified support for filename globbing.
15 class WvGlob
: public WvRegex
20 static const bool normal_quit_chars
[256];
21 static const bool brace_quit_chars
[256];
23 static WvString
glob_to_regex(const char *src
, size_t &src_used
,
24 char *dst
, size_t &dst_used
, const bool quit_chars
[256]);
29 //! Construct an empty glob object. Matches will always fail until set()
30 //! is called with a valid glob pattern.
34 //! Construct an glob object for the given pattern.
36 WvGlob(WvStringParm glob
);
39 //! Replace the current regex to match with a new one.
41 //! \param regex The new regular expression to match
42 //! \param cflags CFlags used to compile the regular expression;
43 //! the defaults are case sensitive, extended RE.
45 bool set(WvStringParm glob
);
48 //! Convert a glob string to its regex equvilent. All wildcards
49 //! (*, ?, {x,y,z}) are wrapped in parens for capturing into registers
51 static WvString
glob_to_regex(WvStringParm glob
, WvString
*errstr
);