BOOL hb_strMatchFile( const char * szString, const char * szPattern ) { #if defined( HB_OS_UNIX ) # if defined( __WATCOMC__ ) return hb_strMatchWildExact( szString, szPattern ); # else return fnmatch( szPattern, szString, FNM_PERIOD | FNM_PATHNAME ) == 0; # endif #else return hb_strMatchCaseWildExact( szString, szPattern ); #endif }
HB_BOOL hb_strMatchRegExp( const char * szString, const char * szPattern ) { PHB_REGEX pRegEx; HB_TRACE( HB_TR_DEBUG, ( "hb_strMatchRegExp(%s, %s)", szString, szPattern ) ); pRegEx = hb_regexCompile( szPattern, strlen( szPattern ), HBREG_EXTENDED ); if( pRegEx ) { HB_BOOL fMatch; fMatch = hb_regexMatch( pRegEx, szString, strlen( szString ), HB_TRUE ); hb_regexFree( pRegEx ); return fMatch; } else return hb_strMatchWildExact( szString, szPattern ); }
HB_BOOL hb_strMatchFile( const char * szString, const char * szPattern ) { #if defined( HB_OS_UNIX ) # if defined( HB_NO_FNMATCH ) return hb_strMatchWildExact( szString, szPattern ); # else return fnmatch( szPattern, szString, FNM_PERIOD | FNM_PATHNAME ) == 0; # endif #elif defined( HB_OS_DOS ) || defined( HB_OS_WIN ) || defined( HB_OS_OS2 ) PHB_CODEPAGE cdp = hb_vmCDP(); if( cdp && HB_CDP_ISCHARIDX( cdp ) ) return hb_strMatchWildCDP( szString, szPattern, HB_TRUE, HB_TRUE, HB_TRUE, cdp ); else return hb_strMatchWildRaw( szString, szPattern, HB_TRUE, HB_TRUE, HB_TRUE ); #else return hb_strMatchCaseWildExact( szString, szPattern ); #endif }