/******************************************************************************* * matchespattern.hpp * Pattern-matching functions. * *------------------------------------------------------------------------------- * @version $Revision: 1.2 $ $Date: 2006/03/16 03:44:39 $ * @since 2006-01-25 * @author * David R. Tribble (david@tribble.com) * * Copyright ©2006 by David R. Tribble, all rights reserved. * Permission is granted to use, modify, and distribute this source code provided * that the original copyright and author notices remain intact and unaltered. */ #ifndef drt_matchespattern_hpp #define drt_matchespattern_hpp 102 // Identification #ifndef NO_H_IDENT static char matchespattern_hpp_REV[] = "@(#)tribble/cpp/lib/matchespattern.hpp $Revision: 1.2 $ $Date: 2006/03/16 03:44:39 $"; #endif //------------------------------------------------------------------------------ // Public (non-class) functions //------------------------------------------------------------------------------ /******************************************************************************* * ::matchesPattern() * Compare a name to a wildcard (filename) pattern. * * @param name * A name (filename) to compare. An empty filename ("") matches only an * empty pattern. * * @param pat * Name pattern containing wildcards, which are: * ? - matches a single character * * - matches zero or more characters * Note that alphabetic character comparisons are case-insensitive * (e.g., "abc" matches "abc", "Abc", and "ABC"). * An empty pattern ("") matches only an empty filename. * * @return * True if 'name' matches 'pat', otherwise false. * False is returned if either 'name' or 'pat' is null. * * @since 1.1, 2006-01-26 */ extern bool matchesPattern(const char *name, const char *pat); #endif // matchespattern_hpp // End matchespattern.hpp