Base class factory on the wxFilter base class and implement the new Find feature.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
43
src/common/arcfind.cpp
Normal file
43
src/common/arcfind.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/common/arcfind.cpp
|
||||
// Purpose: Streams for archive 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_ARCHIVE_STREAMS
|
||||
|
||||
#include "wx/archive.h"
|
||||
|
||||
// These functions are in a separate file so that statically linked apps
|
||||
// that do not call them to search for archive handlers will only link in
|
||||
// the archive classes they use.
|
||||
|
||||
const wxArchiveClassFactory *
|
||||
wxArchiveClassFactory::Find(const wxChar *protocol, wxStreamProtocolType type)
|
||||
{
|
||||
for (const wxArchiveClassFactory *f = GetFirst(); f; f = f->GetNext())
|
||||
if (f->CanHandle(protocol, type))
|
||||
return f;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// static
|
||||
const wxArchiveClassFactory *wxArchiveClassFactory::GetFirst()
|
||||
{
|
||||
if (!sm_first)
|
||||
wxUseArchiveClasses();
|
||||
return sm_first;
|
||||
}
|
||||
|
||||
#endif // wxUSE_ARCHIVE_STREAMS
|
||||
Reference in New Issue
Block a user