Panda3D
multiplexStream.h
1 // Filename: multiplexStream.h
2 // Created by: drose (27Nov00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef MULTIPLEXSTREAM_H
16 #define MULTIPLEXSTREAM_H
17 
18 #include "pandabase.h"
19 
20 #include "multiplexStreamBuf.h"
21 
22 #include "filename.h"
23 
24 #include <stdio.h>
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : MultiplexStream
28 // Description : This is a special ostream that forwards the data that
29 // is written to it to any number of other sources, for
30 // instance other ostreams, or explicitly to a disk file
31 // or to system logging utilities. It's a very handy
32 // thing to set Notify to refer to when running in batch
33 // mode.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_PANDAEXPRESS MultiplexStream : public ostream {
36 PUBLISHED:
37  INLINE MultiplexStream();
38 
39  INLINE void add_ostream(ostream *out, bool delete_later = false);
40  INLINE bool add_stdio_file(FILE *file, bool close_when_done);
41  INLINE void add_standard_output();
42  INLINE bool add_file(Filename file);
43  INLINE void add_system_debug();
44 
45  INLINE void flush();
46 
47 private:
48  MultiplexStreamBuf _msb;
49 };
50 
51 #include "multiplexStream.I"
52 
53 #endif
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
Used by MultiplexStream to implement an ostream that sends what is written to it to any number of add...
This is a special ostream that forwards the data that is written to it to any number of other sources...