Added wxCountingStream for measuring the size of streamed data
Added wxBitmapObject for putting it on the clipboard git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -645,9 +645,56 @@ wxOutputStream& wxOutputStream::operator<<(wxObject& obj)
|
||||
}
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCountingOutputStream
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxCountingOutputStream::wxCountingOutputStream ()
|
||||
: wxOutputStream()
|
||||
{
|
||||
m_currentPos = 0;
|
||||
}
|
||||
|
||||
size_t wxCountingOutputStream::GetSize() const
|
||||
{
|
||||
return m_lastcount;
|
||||
}
|
||||
|
||||
size_t wxCountingOutputStream::OnSysWrite(const void *buffer, size_t size)
|
||||
{
|
||||
m_currentPos += size;
|
||||
if (m_currentPos > m_lastcount) m_lastcount = m_currentPos;
|
||||
return m_currentPos;
|
||||
}
|
||||
|
||||
off_t wxCountingOutputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
{
|
||||
if (mode == wxFromStart)
|
||||
{
|
||||
m_currentPos = pos;
|
||||
}
|
||||
if (mode == wxFromEnd)
|
||||
{
|
||||
m_currentPos = m_lastcount + pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentPos += pos;
|
||||
}
|
||||
if (m_currentPos > m_lastcount) m_lastcount = m_currentPos;
|
||||
|
||||
return m_currentPos; // ?
|
||||
}
|
||||
|
||||
off_t wxCountingOutputStream::OnSysTell() const
|
||||
{
|
||||
return m_currentPos; // ?
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFilterInputStream
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFilterInputStream::wxFilterInputStream()
|
||||
: wxInputStream()
|
||||
{
|
||||
|
Reference in New Issue
Block a user