LineStream

class LineStream

Bases: ostream

This is a special ostream that writes to a memory buffer, like ostrstream. However, its contents can be continuously extracted as a sequence of lines of text.

Unlike ostrstream, which can only be extracted from once (and then the buffer freezes and it can no longer be written to), the LineStream is not otherwise affected when a line of text is extracted. More text can still be written to it and continuously extracted.

Inheritance diagram

digraph inheritancec14cdcfbeb { 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=""]; "LineStream" [URL="acron.core.LineStream.html#acron.core.LineStream",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ostream" -> "LineStream" [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=""]; "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=""]; }
LineStream.__init__()
LineStream.get_line()

Extracts and returns the next line (or partial line) of text available in the LineStream object. Once the line has been extracted, you may call has_newline() to determine whether or not there was an explicit newline character written following this line.

LineStream.has_newline()

Returns true if the line of text most recently returned by get_line() was written out with a terminating newline, or false if a newline character has not yet been written to the LineStream.

LineStream.is_text_available()

Returns true if there is at least one line of text (or even a partial line) available in the LineStream object. If this returns true, the line may then be retrieved via get_line().