/////////////////////////////////////////////////////////////////////////////
-// Name: archive.h
+// Name: wx/archive.h
// Purpose: Streams for archive formats
// Author: Mike Wetherell
// RCS-ID: $Id$
virtual void SetIsReadOnly(bool isReadOnly = true) = 0;
virtual void SetName(const wxString& name,
wxPathFormat format = wxPATH_NATIVE) = 0;
-
+
wxArchiveEntry *Clone() const { return DoClone(); }
void SetNotifier(wxArchiveNotifier& notifier);
typedef wxArchiveEntry entry_type;
virtual ~wxArchiveInputStream() { }
-
+
virtual bool OpenEntry(wxArchiveEntry& entry) = 0;
virtual bool CloseEntry() = 0;
wxArchiveEntry *GetNextEntry() { return DoGetNextEntry(); }
virtual char Peek() { return wxInputStream::Peek(); }
-
+
protected:
wxArchiveInputStream(wxInputStream& stream, wxMBConv& conv);
wxArchiveInputStream(wxInputStream *stream, wxMBConv& conv);
//
// Only one entry can be open for output at a time; another call to
// PutNextEntry closes the current entry and begins the next.
-//
+//
// The overload 'bool PutNextEntry(wxArchiveEntry *entry)' takes ownership
// of the entry object.
if (m_rep)
m_rep->AddRef();
}
-
+
~wxArchiveIterator() {
if (m_rep)
m_rep->UnRef();
typename Arc::entry_type* m_entry;
T m_value;
int m_ref;
-
+
public:
Rep(Arc& arc, typename Arc::entry_type* entry)
: m_arc(arc), m_entry(entry), m_value(), m_ref(1) { }
~Rep()
{ delete m_entry; }
-
+
void AddRef() {
m_ref++;
}
return NULL;
}
if (m_ref > 1) {
- m_ref--;
+ m_ref--;
return new Rep(m_arc, entry);
}
delete m_entry;