1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 * nsWildCard.h: Defines and prototypes for shell exp. match routines
10 * See nsIZipReader.findEntries docs in nsIZipReader.idl for a description of
11 * the supported expression syntax.
13 * Note that the syntax documentation explicitly says the results of certain
14 * expressions are undefined. This is intentional to require less robustness
15 * in the code. Regular expression parsing is hard; the smaller the set of
16 * features and interactions this code must support, the easier it is to
21 #ifndef nsWildCard_h__
22 #define nsWildCard_h__
26 /* --------------------------- Public routines ---------------------------- */
29 * NS_WildCardValid takes a shell expression exp as input. It returns:
31 * NON_SXP if exp is a standard string
32 * INVALID_SXP if exp is a shell expression, but invalid
33 * VALID_SXP if exp is a valid shell expression
37 #define INVALID_SXP -2
40 int NS_WildCardValid(const char* aExpr
);
42 int NS_WildCardValid(const char16_t
* aExpr
);
44 /* return values for the search routines */
52 * Takes a prevalidated shell expression exp, and a string str.
54 * Returns 0 on match and 1 on non-match.
57 int NS_WildCardMatch(const char* aStr
, const char* aExpr
,
58 bool aCaseInsensitive
);
60 int NS_WildCardMatch(const char16_t
* aStr
, const char16_t
* aExpr
,
61 bool aCaseInsensitive
);
63 #endif /* nsWildCard_h__ */