~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to src/common/arcfind.cpp

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////////
 
2
// Name:        src/common/arcfind.cpp
 
3
// Purpose:     Streams for archive formats
 
4
// Author:      Mike Wetherell
 
5
// RCS-ID:      $Id: arcfind.cpp 46391 2007-06-10 17:42:41Z VS $
 
6
// Copyright:   (c) Mike Wetherell
 
7
// Licence:     wxWindows licence
 
8
/////////////////////////////////////////////////////////////////////////////
 
9
 
 
10
// For compilers that support precompilation, includes "wx.h".
 
11
#include "wx/wxprec.h"
 
12
 
 
13
#ifdef __BORLANDC__
 
14
    #pragma hdrstop
 
15
#endif
 
16
 
 
17
#if wxUSE_ARCHIVE_STREAMS
 
18
 
 
19
#include "wx/archive.h"
 
20
 
 
21
// These functions are in a separate file so that statically linked apps
 
22
// that do not call them to search for archive handlers will only link in
 
23
// the archive classes they use.
 
24
 
 
25
const wxArchiveClassFactory *
 
26
wxArchiveClassFactory::Find(const wxString& protocol, wxStreamProtocolType type)
 
27
{
 
28
    for (const wxArchiveClassFactory *f = GetFirst(); f; f = f->GetNext())
 
29
        if (f->CanHandle(protocol, type))
 
30
            return f;
 
31
 
 
32
    return NULL;
 
33
}
 
34
 
 
35
// static
 
36
const wxArchiveClassFactory *wxArchiveClassFactory::GetFirst()
 
37
{
 
38
    if (!sm_first)
 
39
        wxUseArchiveClasses();
 
40
    return sm_first;
 
41
}
 
42
 
 
43
#endif // wxUSE_ARCHIVE_STREAMS