X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5a4c7f718a0a4f36b1af71335c39a08439a1689b..4200d1f4164a82739e3e54f5a85f25910c8a8d1d:/src/common/sstream.cpp diff --git a/src/common/sstream.cpp b/src/common/sstream.cpp index de3496327e..84bf9c376d 100644 --- a/src/common/sstream.cpp +++ b/src/common/sstream.cpp @@ -36,7 +36,7 @@ // seek/tell // ---------------------------------------------------------------------------- -off_t wxStringInputStream::OnSysSeek(off_t ofs, wxSeekMode mode) +wxFileOffset wxStringInputStream::OnSysSeek(wxFileOffset ofs, wxSeekMode mode) { const size_t ofsMax = m_str.length()*sizeof(wxChar); @@ -67,9 +67,9 @@ off_t wxStringInputStream::OnSysSeek(off_t ofs, wxSeekMode mode) return ofs; } -off_t wxStringInputStream::OnSysTell() const +wxFileOffset wxStringInputStream::OnSysTell() const { - return wx_static_cast(off_t, m_pos); + return wx_static_cast(wxFileOffset, m_pos); } // ---------------------------------------------------------------------------- @@ -101,6 +101,15 @@ size_t wxStringInputStream::OnSysRead(void *buffer, size_t size) // wxStringOutputStream implementation // ============================================================================ +// ---------------------------------------------------------------------------- +// seek/tell +// ---------------------------------------------------------------------------- + +wxFileOffset wxStringOutputStream::OnSysTell() const +{ + return wx_static_cast(wxFileOffset, m_pos); +} + // ---------------------------------------------------------------------------- // actual IO // ---------------------------------------------------------------------------- @@ -112,10 +121,13 @@ size_t wxStringOutputStream::OnSysWrite(const void *buffer, size_t size) const wxChar *p = wx_static_cast(const wxChar *, buffer); - m_str->Append(wxString(p, p + len + 1)); + m_str->Append(wxString(p, p + len)); // return number of bytes actually written - return len*sizeof(wxChar); + len *= sizeof(wxChar); + m_pos += len; + + return len; } #endif // wxUSE_STREAMS