StringStream

from acron.core import StringStream
class StringStream

Bases:

Bases: iostream

A bi-directional stream object that reads and writes data to an internal buffer, which can be retrieved and/or set as a string in Python 2 or a bytes object in Python 3.

Inheritance diagram

digraph inheritance5734af24f0 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "StringStream" [URL="acron.core.StringStream.html#acron.core.StringStream",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "iostream" -> "StringStream" [arrowsize=0.75,style=""]; "basic_ios_char" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ios_base" -> "basic_ios_char" [arrowsize=0.75,style=""]; "ios_base" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",tooltip="// We need to expose one method in each class to force it to publish."]; "DTOOL_SUPER_BASE" -> "ios_base" [arrowsize=0.75,style=""]; "iostream" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "istream" -> "iostream" [arrowsize=0.75,style=""]; "ostream" -> "iostream" [arrowsize=0.75,style=""]; "istream" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "basic_ios_char" -> "istream" [arrowsize=0.75,style=""]; "ostream" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "basic_ios_char" -> "ostream" [arrowsize=0.75,style=""]; }
__init__()

This version of the constructor preloads the buffer with the indicated data.

This version of the constructor preloads the buffer with the indicated data.

clear_data()

Empties the buffer.

property data
Getter

Returns the contents of the data stream as a string.

Setter

Replaces the contents of the data stream. This implicitly reseeks to 0.

Replaces the contents of the data stream. This implicitly reseeks to 0.

get_data()

Returns the contents of the data stream as a string.

get_data_size()

Returns the number of characters available to be read from the data stream.

set_data()

Replaces the contents of the data stream. This implicitly reseeks to 0.

Replaces the contents of the data stream. This implicitly reseeks to 0.