Panda3D
Public Member Functions | List of all members
MultiplexStream Class Reference

This is a special ostream that forwards the data that is written to it to any number of other sources, for instance other ostreams, or explicitly to a disk file or to system logging utilities. More...

Inheritance diagram for MultiplexStream:
Ostream BasicIosChar IosBase

Public Member Functions

 __init__ ()
 
bool addFile (Filename file)
 Adds the given file to the multiplex output. More...
 
 addOstream (Ostream out, bool delete_later)
 Adds the indicated generic ostream to the multiplex output. More...
 
 addStandardOutput ()
 Adds the standard output channel. More...
 
bool addStdioFile (FILE file, bool close_when_done)
 Adds the given file, previously opened using the C stdio library, to the multiplex output. More...
 
 addSystemDebug ()
 Adds the system debug output the the multiplex output. More...
 
 flush ()
 Forces out all output that hasn't yet been written. More...
 
- Public Member Functions inherited from Ostream
 flush ()
 
 put (char c)
 
 seekp (Streamoff pos)
 
 seekp (Streamoff off, IosBase::Seekdir dir)
 
Streamoff tellp ()
 
- Public Member Functions inherited from BasicIosChar
bool bad ()
 
 clear ()
 
bool eof ()
 
bool fail ()
 
bool good ()
 

Additional Inherited Members

- Public Types inherited from IosBase
enum  Iostate
 
enum  Openmode
 
enum  Seekdir { beg = 0, cur = 1, end = 2 }
 

Detailed Description

This is a special ostream that forwards the data that is written to it to any number of other sources, for instance other ostreams, or explicitly to a disk file or to system logging utilities.

It's a very handy thing to set Notify to refer to when running in batch mode.

Member Function Documentation

◆ __init__()

__init__ ( )

◆ addFile()

bool addFile ( Filename  file)

Adds the given file to the multiplex output.

The file is opened in append mode with line buffering. Returns false if the file cannot be opened.

◆ addOstream()

addOstream ( Ostream  out,
bool  delete_later 
)

Adds the indicated generic ostream to the multiplex output.

The ostream will receive whatever data is sent to the pipe.

◆ addStandardOutput()

addStandardOutput ( )

Adds the standard output channel.

◆ addStdioFile()

bool addStdioFile ( FILE  file,
bool  close_when_done 
)

Adds the given file, previously opened using the C stdio library, to the multiplex output.

◆ addSystemDebug()

addSystemDebug ( )

Adds the system debug output the the multiplex output.

This may map to a syslog or some such os-specific output system. It may do nothing on a particular system.

Presently, this maps only to OutputDebugString() on Windows.

◆ flush()

flush ( )

Forces out all output that hasn't yet been written.