wvdbusserver: implement NameHasOwner request.
[wvstreams.git] / include / wvglob.h
blob5d84c25760b54c26be1e9a4903720438f0f93aec
1 /* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2004 Net Integration Technologies, Inc.
4 *
5 * Globbing support (ie. filename wildcards) through WvRegex
6 */
7 #ifndef __WVGLOB_H
8 #define __WVGLOB_H
10 #include "wvregex.h"
12 /*!
13 @brief WvGlob -- Unified support for filename globbing.
14 !*/
15 class WvGlob : public WvRegex
18 private:
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]);
26 public:
28 //!
29 //! Construct an empty glob object. Matches will always fail until set()
30 //! is called with a valid glob pattern.
31 //!
32 WvGlob();
33 //!
34 //! Construct an glob object for the given pattern.
35 //!
36 WvGlob(WvStringParm glob);
38 //!
39 //! Replace the current regex to match with a new one.
40 //!
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.
44 //!
45 bool set(WvStringParm glob);
47 //!
48 //! Convert a glob string to its regex equvilent. All wildcards
49 //! (*, ?, {x,y,z}) are wrapped in parens for capturing into registers
50 //!
51 static WvString glob_to_regex(WvStringParm glob, WvString *errstr);
54 #endif // __WVGLOB_H