wxMimeTypesManagerImpl::GetFileTypeFromMimeType() implemented
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2a84758354
commit
1ee17e1c42
@ -796,8 +796,25 @@ wxMimeTypesManagerImpl::wxMimeTypesManagerImpl()
|
||||
wxFileType *
|
||||
wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
|
||||
{
|
||||
wxFAIL_MSG("not implemented (must parse mime.types)");
|
||||
size_t count = m_aExtensions.GetCount();
|
||||
for ( size_t n = 0; n < count; n++ ) {
|
||||
wxString extensions = m_aExtensions[n];
|
||||
while ( !extensions.IsEmpty() ) {
|
||||
wxString field = extensions.BeforeFirst(' ');
|
||||
extensions = extensions.AfterFirst(' ');
|
||||
|
||||
// consider extensions as not being case-sensitive
|
||||
if ( field.IsSameAs(ext, FALSE /* no case */) ) {
|
||||
// found
|
||||
wxFileType *fileType = new wxFileType;
|
||||
fileType->m_impl->Init(this, n);
|
||||
|
||||
return fileType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// not found
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user