X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b79dad4dc211c70f52f2ec864904855386f2aec..de34bb081b6ce19bd4b1216d26a79b817a631bbd:/include/wx/archive.h diff --git a/include/wx/archive.h b/include/wx/archive.h index 0858d299f3..67419a91fc 100644 --- a/include/wx/archive.h +++ b/include/wx/archive.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: archive.h +// Name: wx/archive.h // Purpose: Streams for archive formats // Author: Mike Wetherell // RCS-ID: $Id$ @@ -55,7 +55,7 @@ public: 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); @@ -94,14 +94,14 @@ public: 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); @@ -123,7 +123,7 @@ private: // // 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. @@ -207,7 +207,7 @@ public: if (m_rep) m_rep->AddRef(); } - + ~wxArchiveIterator() { if (m_rep) m_rep->UnRef(); @@ -255,13 +255,13 @@ private: 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++; } @@ -278,7 +278,7 @@ private: return NULL; } if (m_ref > 1) { - m_ref--; + m_ref--; return new Rep(m_arc, entry); } delete m_entry; @@ -341,10 +341,13 @@ public: const wxString& name, wxPathFormat format = wxPATH_NATIVE) const = 0; + // FIXME-UTF8: remove these from this file, they are used for ANSI + // build only void SetConv(wxMBConv& conv) { m_pConv = &conv; } - wxMBConv& GetConv() const { return *m_pConv; } + wxMBConv& GetConv() const + { if (m_pConv) return *m_pConv; else return wxConvLocal; } - static const wxArchiveClassFactory *Find(const wxChar *protocol, + static const wxArchiveClassFactory *Find(const wxString& protocol, wxStreamProtocolType type = wxSTREAM_PROTOCOL); @@ -363,7 +366,7 @@ protected: virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0; virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0; - wxArchiveClassFactory() : m_pConv(&wxConvLocal), m_next(this) { } + wxArchiveClassFactory() : m_pConv(NULL), m_next(this) { } wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f)) { return *this; }