lilypond-0.0.35
[lilypond.git] / flower / dstream.hh
blob801b166774a00515cbdc577575070a3c1a90f953
2 #ifndef DSTREAM_HH
3 #define DSTREAM_HH
5 #include "string.hh"
7 const char eol= '\n';
9 template<class K,class V>
10 struct Assoc;
12 /** debug stream.
13 a class for providing debug output of nested structures,
14 with indents according to \{\}()[].
16 One can turn on and off specific messages using the Assoc silent.
17 This can be done automatically:
19 #define DEBUG dstream_.identify_as(__PRETTY_FUNCTION__)
21 DEBUG << "a message\n";
23 Init for the class names which should be silent can be given in a rc file.
26 class Dstream
28 ostream *os;
29 int indentlvl;
30 bool local_silence;
31 String classname;
33 Assoc<String, bool> *silent;
34 public:
36 bool silence(String);
38 /**
39 if rcfile == 0, then do not read any rc file.
42 Dstream(ostream *r, const char * rcfile);
43 virtual ~Dstream();
44 Dstream &identify_as(String s);
46 Dstream &operator << (String s);
48 #endif