Panda3D
Public Types | Public Member Functions

LineStream Class Reference

This is a special ostream that writes to a memory buffer, like ostrstream. More...

Inheritance diagram for LineStream:
ostream ios ios_base

List of all members.

Public Types

enum  openmode
enum  seekdir { beg = 0, cur = 1, end = 2 }

Public Member Functions

 LineStream ()
bool bad ()
 clear ()
bool eof ()
bool fail ()
 flush ()
string getLine ()
 Extracts and returns the next line (or partial line) of text available in the LineStream object.
bool good ()
bool hasNewline ()
 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.
bool isTextAvailable ()
 Returns true if there is at least one line of text (or even a partial line) available in the LineStream object.
 put (char c)
 seekp (long int off, seekdir dir)
 seekp (unsigned long int pos)
unsigned long int tellp ()

Detailed Description

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.


Member Enumeration Documentation

enum openmode [inherited]
enum seekdir [inherited]
Enumerator:
beg 
cur 
end 

Constructor & Destructor Documentation


Member Function Documentation

bool bad ( ) [inherited]
clear ( ) [inherited]
bool eof ( ) [inherited]
bool fail ( ) [inherited]
flush ( ) [inherited]
string getLine ( )

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.

bool good ( ) [inherited]
bool hasNewline ( )

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.

bool isTextAvailable ( )

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().

put ( char  c) [inherited]
seekp ( unsigned long int  pos) [inherited]
seekp ( long int  off,
seekdir  dir 
) [inherited]
unsigned long int tellp ( ) [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties