]> git.saurik.com Git - wxWidgets.git/blob - src/common/archive.cpp
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / src / common / archive.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/archive.cpp
3 // Purpose: Streams for archive formats
4 // Author: Mike Wetherell
5 // Copyright: (c) Mike Wetherell
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 // For compilers that support precompilation, includes "wx.h".
10 #include "wx/wxprec.h"
11
12 #ifdef __BORLANDC__
13 #pragma hdrstop
14 #endif
15
16 #if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS
17
18 #include "wx/archive.h"
19
20 IMPLEMENT_ABSTRACT_CLASS(wxArchiveEntry, wxObject)
21 IMPLEMENT_ABSTRACT_CLASS(wxArchiveClassFactory, wxFilterClassFactoryBase)
22
23
24 /////////////////////////////////////////////////////////////////////////////
25 // wxArchiveInputStream
26
27 wxArchiveInputStream::wxArchiveInputStream(wxInputStream& stream,
28 wxMBConv& conv)
29 : wxFilterInputStream(stream),
30 m_conv(conv)
31 {
32 }
33
34 wxArchiveInputStream::wxArchiveInputStream(wxInputStream *stream,
35 wxMBConv& conv)
36 : wxFilterInputStream(stream),
37 m_conv(conv)
38 {
39 }
40
41
42 /////////////////////////////////////////////////////////////////////////////
43 // wxArchiveOutputStream
44
45 wxArchiveOutputStream::wxArchiveOutputStream(wxOutputStream& stream,
46 wxMBConv& conv)
47 : wxFilterOutputStream(stream),
48 m_conv(conv)
49 {
50 }
51
52 wxArchiveOutputStream::wxArchiveOutputStream(wxOutputStream *stream,
53 wxMBConv& conv)
54 : wxFilterOutputStream(stream),
55 m_conv(conv)
56 {
57 }
58
59
60 /////////////////////////////////////////////////////////////////////////////
61 // wxArchiveEntry
62
63 void wxArchiveEntry::SetNotifier(wxArchiveNotifier& notifier)
64 {
65 UnsetNotifier();
66 m_notifier = &notifier;
67 m_notifier->OnEntryUpdated(*this);
68 }
69
70 wxArchiveEntry& wxArchiveEntry::operator=(const wxArchiveEntry& WXUNUSED(e))
71 {
72 m_notifier = NULL;
73 return *this;
74 }
75
76
77 /////////////////////////////////////////////////////////////////////////////
78 // wxArchiveClassFactory
79
80 wxArchiveClassFactory *wxArchiveClassFactory::sm_first = NULL;
81
82 void wxArchiveClassFactory::Remove()
83 {
84 if (m_next != this)
85 {
86 wxArchiveClassFactory **pp = &sm_first;
87
88 while (*pp != this)
89 pp = &(*pp)->m_next;
90
91 *pp = m_next;
92
93 m_next = this;
94 }
95 }
96
97 #endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS