case 's':
// '%s' expands into file name (quoted because it might
// contain spaces) - except if there are already quotes
- // there because otherwise some programs may get confused by
- // double double quotes
+ // there because otherwise some programs may get confused
+ // by double double quotes
#if 0
if ( *(pc - 2) == '"' )
str << params.GetFileName();
// wxMimeTypesManager
// ----------------------------------------------------------------------------
+bool wxMimeTypesManager::IsOfType(const wxString& mimeType,
+ const wxString& wildcard)
+{
+ wxASSERT_MSG( mimeType.Find('*') == wxNOT_FOUND,
+ "first MIME type can't contain wildcards" );
+
+ // all comparaisons are case insensitive (2nd arg of IsSameAs() is FALSE)
+ if ( wildcard.BeforeFirst('/').IsSameAs(mimeType.BeforeFirst('/'), FALSE) )
+ {
+ wxString strSubtype = wildcard.AfterFirst('/');
+
+ if ( strSubtype == '*' ||
+ strSubtype.IsSameAs(mimeType.AfterFirst('/'), FALSE) )
+ {
+ // matches (either exactly or it's a wildcard)
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
wxMimeTypesManager::wxMimeTypesManager()
{
m_impl = new wxMimeTypesManagerImpl;
} currentToken = Field_Type;
// the flags and field values on the current line
- bool needsterminal = false,
- copiousoutput = false;
+ bool needsterminal = FALSE,
+ copiousoutput = FALSE;
wxString strType,
strOpenCmd,
strPrintCmd,
// programmer
wxLogDebug
(
- _("Mailcap file %s, line %d: unknown "
- "field '%s' for the MIME type "
- "'%s' ignored."),
+ "Mailcap file %s, line %d: unknown "
+ "field '%s' for the MIME type "
+ "'%s' ignored.",
strFileName.c_str(),
nLine + 1,
curField.c_str(),