]> git.donarmstrong.com Git - lilypond.git/blob - dstream.hh
release: 0.0.2
[lilypond.git] / dstream.hh
1 // debug_stream
2
3 #ifndef DSTREAM_HH
4 #define DSTREAM_HH
5
6 #include "string.hh"
7 #include "assoc.hh"
8
9 const char eol= '\n';
10
11 /// debug stream
12 class Dstream
13 {
14     ostream *os;
15     int indentlvl;
16     Assoc<String, bool> silent;
17     bool local_silence;
18     String classname;
19     /// indent of each level 
20     const INDTAB = 3;
21
22 public:
23     Dstream(ostream &r, const char  * = 0);
24     Dstream &identify_as(String s);
25     void switch_output(String s,bool);
26     Dstream &operator << (String s);
27 };
28  /**
29    a class for providing debug output of nested structures,
30    with indents according to \{\}()[].
31
32    Using identify_as() one can turn on and off specific messages. Init
33    for these can be given in a rc file
34    
35   */
36 #endif
37