]> git.donarmstrong.com Git - lilypond.git/blob - lily/tex-stream.cc
d8030580020674b707616c0514751cf739a94327
[lilypond.git] / lily / tex-stream.cc
1 /*
2   tex-stream.cc -- implement Tex_stream
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7
8 */
9
10 #include <fstream.h>
11 #include <time.h>
12
13 #include "main.hh"
14 #include "tex-stream.hh"
15 #include "debug.hh"
16
17 Tex_stream::Tex_stream (String filename)
18   : Paper_stream (filename)
19 {
20   header ();
21 }
22
23 Tex_stream::~Tex_stream ()
24 {
25   *os << "\n\\EndLilyPondOutput";
26 }
27
28 void
29 Tex_stream::header ()
30 {
31   // urg, merge with Ps
32   *os << _ ("% Creator: ");
33   if (no_timestamps_global_b)
34     *os << "GNU LilyPond\n";
35   else
36     *os << get_version_str () << '\n';
37   *os << _ ("% Automatically generated");
38   if (no_timestamps_global_b)
39     *os << ".\n";
40   else
41     {
42       *os << _ (", at ");
43       time_t t (time (0));
44       *os << ctime (&t) << "%\n";
45     }
46 }
47
48 // print string. don't forget indent.
49 Paper_stream&
50 Tex_stream::operator << (Scalar s)
51 {
52   return Paper_stream::operator << (s);
53 }
54