Add class factories for filter streams. Also filters now follow the convention

that they own their parent if they are created with a pointer to the parent.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Michael Wetherell
2006-10-25 20:41:12 +00:00
parent ceb40c80a1
commit 166c3ef0f9
12 changed files with 397 additions and 4 deletions

43
src/common/filtfind.cpp Normal file
View File

@@ -0,0 +1,43 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/common/filtfind.cpp
// Purpose: Streams for filter formats
// Author: Mike Wetherell
// RCS-ID: $Id$
// Copyright: (c) Mike Wetherell
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_STREAMS
#include "wx/stream.h"
// These functions are in a separate file so that statically linked apps
// that do not call them to search for filter handlers will only link in
// the filter classes they use.
const wxFilterClassFactory *
wxFilterClassFactory::Find(const wxChar *protocol, wxStreamProtocolType type)
{
for (const wxFilterClassFactory *f = GetFirst(); f; f = f->GetNext())
if (f->CanHandle(protocol, type))
return f;
return NULL;
}
// static
const wxFilterClassFactory *wxFilterClassFactory::GetFirst()
{
if (!sm_first)
wxUseFilterClasses();
return sm_first;
}
#endif // wxUSE_STREAMS