2 tex-stream.cc -- implement Tex_stream
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
15 #include "tex-stream.hh"
18 const int MAXLINELEN = 200;
20 Tex_stream::Tex_stream (String filename)
22 os = new ofstream (filename.ch_C ());
24 error (_("can't open `") + filename+"\'");
27 outputting_comment=false;
33 *os << _("% Creator: ");
34 if (no_timestamps_global_b)
35 *os << "GNU LilyPond\n";
37 *os << get_version_str() << "\n";
38 *os << _("% Automatically generated");
39 if (no_timestamps_global_b)
45 *os << ctime (&t) << "%\n";
49 Tex_stream::~Tex_stream()
54 warning(_("error syncing file (disk full?)"));
58 assert (nest_level == 0);
61 // print string. don't forget indent.
63 Tex_stream::operator<<(String s)
66 for (char const *cp = s.ch_C (); *cp; cp++)
68 if (outputting_comment)
73 outputting_comment=false;
82 outputting_comment = true;
95 delete os; // we want to see the remains.
96 assert (nest_level>=0);
105 if (line_len_i_ > MAXLINELEN)
118 Tex_stream::break_line()
121 *os << String (' ', nest_level);