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_str();
30 *os << "% Automatically generated, at ";
33 *os << "% from musical definition: " + infile_str_g + "\n";
35 Tex_stream::~Tex_stream()
38 assert(nest_level == 0);
41 // print string. don't forget indent.
43 Tex_stream::operator<<(String s)
46 for (char const *cp = s; *cp; cp++) {
47 if (outputting_comment) {
50 outputting_comment=false;
58 outputting_comment = true;
70 delete os; // we want to see the remains.
71 assert(nest_level>=0);
77 *os << String(' ', nest_level);
88 /* *************************************************************** */