Changeset View
Changeset View
Standalone View
Standalone View
source/lib/regex.h
/* Copyright (C) 2010 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
Show All 17 Lines | |||||
#ifndef INCLUDED_REGEX | #ifndef INCLUDED_REGEX | ||||
#define INCLUDED_REGEX | #define INCLUDED_REGEX | ||||
/** | /** | ||||
* see if string matches pattern. | * see if string matches pattern. | ||||
* | * | ||||
* @param s input string | * @param s input string | ||||
* @param w pseudo-regex to match against. case-insensitive; | * @param w pseudo-regex to match against. case-insensitive; | ||||
* may contain '?' and/or '*' wildcards. if NULL, matches everything. | * may contain '?' and/or '*' wildcards. if nullptr, matches everything. | ||||
* | * | ||||
* @return 1 if they match, otherwise 0. | * @return 1 if they match, otherwise 0. | ||||
* | * | ||||
* algorithm from http://www.codeproject.com/string/wildcmp.asp. | * algorithm from http://www.codeproject.com/string/wildcmp.asp. | ||||
**/ | **/ | ||||
extern int match_wildcard(const wchar_t* s, const wchar_t* w); | extern int match_wildcard(const wchar_t* s, const wchar_t* w); | ||||
#endif // #ifndef INCLUDED_REGEX | #endif // #ifndef INCLUDED_REGEX |
Wildfire Games · Phabricator