.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.StreamBase:
==========================================================================================================================================
|phoenix_title| **wx.StreamBase**
==========================================================================================================================================
This class is the base class of most stream related classes in wxWidgets.
It must not be used directly.
.. seealso:: `StreamBuffer`
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
StreamBase:
|
|sub_classes| Known Subclasses
==============================
:ref:`wx.InputStream`, :ref:`wx.OutputStream`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.StreamBase.__init__` Creates a dummy stream object.
:meth:`~wx.StreamBase.GetLastError` This function returns the last error.
:meth:`~wx.StreamBase.GetLength` Returns the length of the stream in bytes.
:meth:`~wx.StreamBase.GetSize` This function returns the size of the stream.
:meth:`~wx.StreamBase.IsOk` Returns ``True`` if no error occurred on the stream.
:meth:`~wx.StreamBase.IsSeekable` Returns ``True`` if the stream supports seeking to arbitrary offsets.
:meth:`~wx.StreamBase.Reset` Resets the stream state.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.StreamBase.LastError` See :meth:`~wx.StreamBase.GetLastError`
:attr:`~wx.StreamBase.Length` See :meth:`~wx.StreamBase.GetLength`
:attr:`~wx.StreamBase.Size` See :meth:`~wx.StreamBase.GetSize`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.StreamBase(object)
**Possible constructors**::
StreamBase() -> None
This class is the base class of most stream related classes in
wxWidgets.
.. method:: __init__(self)
Creates a dummy stream object.
It doesn't do anything.
:rtype: `None`
.. method:: GetLastError(self)
This function returns the last error.
:rtype: :ref:`wx.StreamError`
.. method:: GetLength(self)
Returns the length of the stream in bytes.
If the length cannot be determined (this is always the case for socket streams for example), returns :meth:`InvalidOffset` .
:rtype: `wx.FileOffset`
.. versionadded:: 2.5.4
.. method:: GetSize(self)
This function returns the size of the stream.
For example, for a file it is the size of the file.
:rtype: `int`
.. warning:: There are streams which do not have size by definition, such as socket streams. In that cases, :meth:`GetSize` returns 0 so you should always test its return value.
.. method:: IsOk(self)
Returns ``True`` if no error occurred on the stream.
:rtype: `bool`
.. seealso:: :meth:`GetLastError`
.. method:: IsSeekable(self)
Returns ``True`` if the stream supports seeking to arbitrary offsets.
:rtype: `bool`
.. method:: Reset(self, error: StreamError=STREAM_NO_ERROR)
Resets the stream state.
By default, resets the stream to good state, i.e. clears any errors. Since wxWidgets 2.9.3 can be also used to explicitly set the state to the specified error (the `error` argument didn't exist in the previous versions).
:param `error`:
:type `error`: wx.StreamError
:rtype: `None`
.. seealso:: :meth:`GetLastError`
.. attribute:: LastError
See :meth:`~wx.StreamBase.GetLastError`
.. attribute:: Length
See :meth:`~wx.StreamBase.GetLength`
.. attribute:: Size
See :meth:`~wx.StreamBase.GetSize`