Panda3D

Loading...
Searching...
No Matches
multiplexStream.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file multiplexStream.h
10 * @author drose
11 * @date 2000-11-27
12 */
13
14#ifndef MULTIPLEXSTREAM_H
15#define MULTIPLEXSTREAM_H
16
17#include "pandabase.h"
18
19#include "multiplexStreamBuf.h"
20
21#include "filename.h"
22
23#include <stdio.h>
24
25/**
26 * This is a special ostream that forwards the data that is written to it to
27 * any number of other sources, for instance other ostreams, or explicitly to
28 * a disk file or to system logging utilities. It's a very handy thing to set
29 * Notify to refer to when running in batch mode.
30 */
31 class EXPCL_PANDA_DOWNLOADER MultiplexStream : public std::ostream {
32PUBLISHED:
33 INLINE MultiplexStream();
34
35#if _MSC_VER >= 1800
36 INLINE MultiplexStream(const MultiplexStream &copy) = delete;
37#endif
38
39 INLINE void add_ostream(std::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
Filename
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
MultiplexStreamBuf
Used by MultiplexStream to implement an ostream that sends what is written to it to any number of add...
Definition multiplexStreamBuf.h:27
MultiplexStream::flush
void flush()
Forces out all output that hasn't yet been written.
Definition multiplexStream.I:92
MultiplexStream::add_stdio_file
bool add_stdio_file(FILE *file, bool close_when_done)
Adds the given file, previously opened using the C stdio library, to the multiplex output.
Definition multiplexStream.I:38
MultiplexStream::add_standard_output
void add_standard_output()
Adds the standard output channel.
Definition multiplexStream.I:49
MultiplexStream::add_system_debug
void add_system_debug()
Adds the system debug output the the multiplex output.
Definition multiplexStream.I:83
MultiplexStream::add_ostream
void add_ostream(std::ostream *out, bool delete_later=false)
Adds the indicated generic ostream to the multiplex output.
Definition multiplexStream.I:27
MultiplexStream::add_file
bool add_file(Filename file)
Adds the given file to the multiplex output.
Definition multiplexStream.I:60
filename.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
multiplexStreamBuf.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
multiplexStream.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.