Revert last commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
323d1f295f
commit
e3a10e0c62
@ -118,11 +118,11 @@ public:
|
||||
|
||||
void SetNotifier(wxTarNotifier& WXUNUSED(notifier)) { }
|
||||
|
||||
protected:
|
||||
private:
|
||||
void SetOffset(wxFileOffset offset) { m_Offset = offset; }
|
||||
|
||||
virtual wxArchiveEntry* DoClone() const { return Clone(); }
|
||||
|
||||
private:
|
||||
wxString m_Name;
|
||||
int m_Mode;
|
||||
bool m_IsModeSet;
|
||||
@ -161,7 +161,6 @@ public:
|
||||
virtual ~wxTarInputStream();
|
||||
|
||||
bool OpenEntry(wxTarEntry& entry);
|
||||
bool OpenEntry(wxArchiveEntry& entry);
|
||||
bool CloseEntry();
|
||||
|
||||
wxTarEntry *GetNextEntry();
|
||||
@ -174,11 +173,11 @@ protected:
|
||||
wxFileOffset OnSysTell() const { return m_pos; }
|
||||
wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
|
||||
|
||||
wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); }
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); }
|
||||
bool OpenEntry(wxArchiveEntry& entry);
|
||||
bool IsOpened() const { return m_pos != wxInvalidOffset; }
|
||||
|
||||
wxStreamError ReadHeaders();
|
||||
@ -219,7 +218,6 @@ public:
|
||||
virtual ~wxTarOutputStream();
|
||||
|
||||
bool PutNextEntry(wxTarEntry *entry);
|
||||
bool PutNextEntry(wxArchiveEntry *entry);
|
||||
|
||||
bool PutNextEntry(const wxString& name,
|
||||
const wxDateTime& dt = wxDateTime::Now(),
|
||||
@ -229,9 +227,7 @@ public:
|
||||
const wxDateTime& dt = wxDateTime::Now());
|
||||
|
||||
bool CopyEntry(wxTarEntry *entry, wxTarInputStream& inputStream);
|
||||
bool CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream);
|
||||
bool CopyArchiveMetaData(wxTarInputStream& WXUNUSED(s)) { return true; }
|
||||
bool CopyArchiveMetaData(wxArchiveInputStream& WXUNUSED(s)) { return true; }
|
||||
|
||||
void Sync();
|
||||
bool CloseEntry();
|
||||
@ -250,6 +246,9 @@ protected:
|
||||
private:
|
||||
void Init(wxTarFormat format);
|
||||
|
||||
bool PutNextEntry(wxArchiveEntry *entry);
|
||||
bool CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream);
|
||||
bool CopyArchiveMetaData(wxArchiveInputStream& WXUNUSED(s)) { return true; }
|
||||
bool IsOpened() const { return m_pos != wxInvalidOffset; }
|
||||
|
||||
bool WriteHeaders(wxTarEntry& entry);
|
||||
|
@ -221,9 +221,9 @@ protected:
|
||||
|
||||
void Notify();
|
||||
|
||||
private:
|
||||
wxArchiveEntry* DoClone() const { return ZipClone(); }
|
||||
|
||||
private:
|
||||
size_t ReadLocal(wxInputStream& stream, wxMBConv& conv);
|
||||
size_t WriteLocal(wxOutputStream& stream, wxMBConv& conv) const;
|
||||
|
||||
@ -283,7 +283,6 @@ public:
|
||||
virtual WXZIPFIX ~wxZipOutputStream();
|
||||
|
||||
bool PutNextEntry(wxZipEntry *entry) { return DoCreate(entry); }
|
||||
bool WXZIPFIX PutNextEntry(wxArchiveEntry *entry);
|
||||
|
||||
bool WXZIPFIX PutNextEntry(const wxString& name,
|
||||
const wxDateTime& dt = wxDateTime::Now(),
|
||||
@ -293,9 +292,7 @@ public:
|
||||
const wxDateTime& dt = wxDateTime::Now());
|
||||
|
||||
bool WXZIPFIX CopyEntry(wxZipEntry *entry, wxZipInputStream& inputStream);
|
||||
bool WXZIPFIX CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream);
|
||||
bool WXZIPFIX CopyArchiveMetaData(wxZipInputStream& inputStream);
|
||||
bool WXZIPFIX CopyArchiveMetaData(wxArchiveInputStream& stream);
|
||||
|
||||
void WXZIPFIX Sync();
|
||||
bool WXZIPFIX CloseEntry();
|
||||
@ -323,6 +320,10 @@ protected:
|
||||
private:
|
||||
void Init(int level);
|
||||
|
||||
bool WXZIPFIX PutNextEntry(wxArchiveEntry *entry);
|
||||
bool WXZIPFIX CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream);
|
||||
bool WXZIPFIX CopyArchiveMetaData(wxArchiveInputStream& stream);
|
||||
|
||||
bool IsOpened() const { return m_comp || m_pending; }
|
||||
|
||||
bool DoCreate(wxZipEntry *entry, bool raw = false);
|
||||
@ -369,7 +370,6 @@ public:
|
||||
virtual WXZIPFIX ~wxZipInputStream();
|
||||
|
||||
bool OpenEntry(wxZipEntry& entry) { return DoOpen(&entry); }
|
||||
bool WXZIPFIX OpenEntry(wxArchiveEntry& entry);
|
||||
bool WXZIPFIX CloseEntry();
|
||||
|
||||
wxZipEntry *GetNextEntry();
|
||||
@ -391,8 +391,6 @@ protected:
|
||||
virtual wxInputStream* WXZIPFIX OpenDecompressor(wxInputStream& stream);
|
||||
virtual bool WXZIPFIX CloseDecompressor(wxInputStream *decomp);
|
||||
|
||||
wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); }
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void Init(const wxString& file);
|
||||
@ -400,6 +398,10 @@ private:
|
||||
static wxInputStream *OpenFile(const wxString& archive);
|
||||
#endif
|
||||
|
||||
wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); }
|
||||
|
||||
bool WXZIPFIX OpenEntry(wxArchiveEntry& entry);
|
||||
|
||||
wxStreamError ReadLocal(bool readEndRec = false);
|
||||
wxStreamError ReadCentral();
|
||||
|
||||
|
@ -824,7 +824,7 @@ wxTarNumber wxTarInputStream::GetHeaderNumber(int id) const
|
||||
{
|
||||
wxString value;
|
||||
|
||||
if ((value = GetExtendedHeader(wxTarHeaderBlock::Name(id))) != wxEmptyString) {
|
||||
if ((value = GetExtendedHeader(m_hdr->Name(id))) != wxEmptyString) {
|
||||
wxTarNumber n = 0;
|
||||
const wxChar *p = value;
|
||||
while (*p == ' ')
|
||||
@ -841,7 +841,7 @@ wxString wxTarInputStream::GetHeaderString(int id) const
|
||||
{
|
||||
wxString value;
|
||||
|
||||
if ((value = GetExtendedHeader(wxTarHeaderBlock::Name(id))) != wxEmptyString)
|
||||
if ((value = GetExtendedHeader(m_hdr->Name(id))) != wxEmptyString)
|
||||
return value;
|
||||
|
||||
return wxString(m_hdr->Get(id), GetConv());
|
||||
@ -1291,7 +1291,7 @@ bool wxTarOutputStream::ModifyHeader()
|
||||
originalPos = m_parent_o_stream->TellO();
|
||||
if (originalPos != wxInvalidOffset)
|
||||
sizePos =
|
||||
m_parent_o_stream->SeekO(m_headpos + wxTarHeaderBlock::Offset(TAR_SIZE));
|
||||
m_parent_o_stream->SeekO(m_headpos + m_hdr->Offset(TAR_SIZE));
|
||||
}
|
||||
|
||||
if (sizePos == wxInvalidOffset || !m_hdr->SetOctal(TAR_SIZE, m_pos)) {
|
||||
@ -1302,7 +1302,7 @@ bool wxTarOutputStream::ModifyHeader()
|
||||
|
||||
m_chksum += m_hdr->SumField(TAR_SIZE);
|
||||
m_hdr->SetOctal(TAR_CHKSUM, m_chksum);
|
||||
wxFileOffset sumPos = m_headpos + wxTarHeaderBlock::Offset(TAR_CHKSUM);
|
||||
wxFileOffset sumPos = m_headpos + m_hdr->Offset(TAR_CHKSUM);
|
||||
|
||||
return
|
||||
m_hdr->WriteField(*m_parent_o_stream, TAR_SIZE) &&
|
||||
@ -1322,16 +1322,16 @@ bool wxTarOutputStream::SetHeaderNumber(int id, wxTarNumber n)
|
||||
if (m_hdr->SetOctal(id, n)) {
|
||||
return true;
|
||||
} else {
|
||||
SetExtendedHeader(wxTarHeaderBlock::Name(id), wxLongLong(n).ToString());
|
||||
SetExtendedHeader(m_hdr->Name(id), wxLongLong(n).ToString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void wxTarOutputStream::SetHeaderString(int id, const wxString& str)
|
||||
{
|
||||
strncpy(m_hdr->Get(id), str.mb_str(GetConv()), wxTarHeaderBlock::Len(id));
|
||||
if (str.length() > wxTarHeaderBlock::Len(id))
|
||||
SetExtendedHeader(wxTarHeaderBlock::Name(id), str);
|
||||
strncpy(m_hdr->Get(id), str.mb_str(GetConv()), m_hdr->Len(id));
|
||||
if (str.length() > m_hdr->Len(id))
|
||||
SetExtendedHeader(m_hdr->Name(id), str);
|
||||
}
|
||||
|
||||
void wxTarOutputStream::SetHeaderDate(const wxString& key,
|
||||
|
Loading…
Reference in New Issue
Block a user