/
filtfind.cpp
43 lines (34 loc) · 1.13 KB
/
filtfind.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 wxString& 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