From 46263455960bc46a6b2e77d444061b6378fc6373 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 11 Nov 2004 19:10:35 +0000 Subject: [PATCH] fixes to ZIP/archive patch (patch 1064426); should fix the docs build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/archive.tex | 18 +++++++++--------- docs/latex/wx/zipstrm.tex | 6 +++--- src/common/zipstrm.cpp | 4 ++-- tests/archive/archivetest.cpp | 20 ++++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/latex/wx/archive.tex b/docs/latex/wx/archive.tex index 304306f..cf4fb20 100644 --- a/docs/latex/wx/archive.tex +++ b/docs/latex/wx/archive.tex @@ -270,9 +270,9 @@ When there are no more entries, GetNextEntry() returns NULL and sets Eof(). \wxheading{Data structures} -{\small \begin{verbatim} -typedef wxArchiveEntry entry\_type -\end{verbatim}} +\begin{verbatim} +typedef wxArchiveEntry entry_type +\end{verbatim} \wxheading{See also} @@ -436,13 +436,13 @@ No base class \helpref{wxArchiveOutputStream}{wxarchiveoutputstream} \wxheading{Data structures} -{\small \begin{verbatim} -typedef std::input\_iterator\_tag iterator\_category -typedef T value\_type -typedef ptrdiff\_t difference\_type +\begin{verbatim} +typedef std::input_iterator_tag iterator_category +typedef T value_type +typedef ptrdiff_t difference_type typedef T* pointer -typedef T\& reference -\end{verbatim}} +typedef T& reference +\end{verbatim} \latexignore{\rtfignore{\wxheading{Members}}} diff --git a/docs/latex/wx/zipstrm.tex b/docs/latex/wx/zipstrm.tex index 65e0f3f..c738495 100644 --- a/docs/latex/wx/zipstrm.tex +++ b/docs/latex/wx/zipstrm.tex @@ -442,9 +442,9 @@ When there are no more entries, GetNextEntry() returns NULL and sets Eof(). \wxheading{Data structures} -{\small \begin{verbatim} -typedef wxZipEntry entry\_type -\end{verbatim}} +\begin{verbatim} +typedef wxZipEntry entry_type +\end{verbatim} \wxheading{See also} diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index c6b966f..322aee5 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -146,7 +146,7 @@ public: void Close() { m_pos = 0; m_lasterror = wxSTREAM_NO_ERROR; } virtual char Peek() { return wxInputStream::Peek(); } - virtual size_t GetSize() const { return m_len; } + virtual wxFileOffset GetLength() const { return m_len; } protected: virtual size_t OnSysRead(void *buffer, size_t size); @@ -1751,7 +1751,7 @@ wxFileOffset wxZipInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode) { case wxFromCurrent : nextpos = seek + pos; break; case wxFromStart : nextpos = seek; break; - case wxFromEnd : nextpos = GetSize() - 1 + seek; break; + case wxFromEnd : nextpos = GetLength() - 1 + seek; break; default : nextpos = pos; break; /* just to fool compiler, never happens */ } diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index e836c3a..3814b8a 100644 --- a/tests/archive/archivetest.cpp +++ b/tests/archive/archivetest.cpp @@ -150,7 +150,7 @@ public: ~TestOutputStream() { delete [] m_data; } int GetOptions() const { return m_options; } - size_t GetSize() const { return m_size; } + wxFileOffset GetLength() const { return m_size; } // gives away the data, this stream is then empty, and can be reused void GetData(const char*& data, size_t& size); @@ -209,7 +209,7 @@ wxFileOffset TestOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxFileOffset TestOutputStream::OnSysTell() const { - return (m_options & PipeOut) == 0 ? m_pos : wxInvalidOffset; + return (m_options & PipeOut) == 0 ? (wxFileOffset)m_pos : wxInvalidOffset; } size_t TestOutputStream::OnSysWrite(const void *buffer, size_t size) @@ -282,7 +282,7 @@ public: ~TestInputStream() { delete [] m_data; } void Rewind(); - size_t GetSize() const { return m_size; } + wxFileOffset GetLength() const { return m_size; } void SetData(TestOutputStream& out); private: @@ -348,7 +348,7 @@ wxFileOffset TestInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxFileOffset TestInputStream::OnSysTell() const { - return (m_options & PipeIn) == 0 ? m_pos : wxInvalidOffset; + return (m_options & PipeIn) == 0 ? (wxFileOffset)m_pos : wxInvalidOffset; } size_t TestInputStream::OnSysRead(void *buffer, size_t size) @@ -638,7 +638,7 @@ void ArchiveTestCase::runTest() CreateArchive(out, m_archiver); // check archive could be created - CPPUNIT_ASSERT(out.GetSize() > 0); + CPPUNIT_ASSERT(out.GetLength() > 0); TestInputStream in(out); @@ -975,8 +975,8 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in) testEntry.GetLength() == entry->GetSize() || ((m_options & PipeIn) != 0 && entry->GetSize() == wxInvalidOffset)); CPPUNIT_ASSERT_MESSAGE( - "arc->GetSize() == entry->GetSize()" + error_context, - arc->GetSize() == (size_t)entry->GetSize()); + "arc->GetLength() == entry->GetSize()" + error_context, + arc->GetLength() == entry->GetSize()); if (name.Last() != _T('/')) { @@ -998,8 +998,8 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in) CPPUNIT_ASSERT_MESSAGE("entry size check" + error_context, testEntry.GetLength() == entry->GetSize()); CPPUNIT_ASSERT_MESSAGE( - "arc->GetSize() == entry->GetSize()" + error_context, - arc->GetSize() == (size_t)entry->GetSize()); + "arc->GetLength() == entry->GetSize()" + error_context, + arc->GetLength() == entry->GetSize()); if ((m_options & PipeIn) == 0) { OnEntryExtracted(*entry, testEntry, arc.get()); @@ -1114,7 +1114,7 @@ void ArchiveTestCase::VerifyDir(wxString& path, size_t rootlen /*=0*/) CPPUNIT_ASSERT_MESSAGE( "entry not found in archive" + error_entry, in.Ok()); - size = in.GetSize(); + size = in.GetLength(); wxCharBuffer buf(size); CPPUNIT_ASSERT_MESSAGE("Read" + error_context, in.Read(buf.data(), size).LastRead() == size); -- 2.7.4