2 tex-stream.cc -- implement Tex_stream
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
14 #include "tex-stream.hh"
17 Tex_stream::Tex_stream(String filename
)
19 os
= new ofstream(filename
);
21 error("can't open `" + filename
+"\'");
23 outputting_comment
=false;
29 *os
<< "% Creator: " << get_version();
30 *os
<< "% Automatically generated, at ";
34 Tex_stream::~Tex_stream()
37 assert(nest_level
== 0);
40 // print string. don't forget indent.
42 Tex_stream::operator<<(String s
)
45 for (const char *cp
= s
; *cp
; cp
++) {
46 if (outputting_comment
) {
49 outputting_comment
=false;
57 outputting_comment
= true;
69 delete os
; // we want to see the remains.
70 assert(nest_level
>=0);
76 *os
<< String(' ', nest_level
);
87 /* *************************************************************** */