]> git.donarmstrong.com Git - lilypond.git/blob - lily/header.cc
patch::: 1.0.14.tca1
[lilypond.git] / lily / header.cc
1 /*
2   header.cc -- implement Header
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   Jan Nieuwenhuizen <janneke@gnu.org>
8 */
9
10 #include "string.hh"
11 #include "dictionary-iter.hh"
12 #include "header.hh"
13 #include "main.hh"
14
15 extern char const *lily_version_number_sz ();
16
17 Header::Header ()
18 {
19   lily_id_str_ = "Lily was here, " +
20     String (lily_version_number_sz ());
21 }
22
23 //urg
24 String
25 Header::tex_string () const
26 {
27   String s;
28
29   s+= "\\def\\LilyIdString{"  + lily_id_str_ + "}";
30   
31   for (Dictionary_iter<String> i (*this); i.ok (); i++) 
32     s += "\\def\\mudela" + i.key () + "{" + i.val () + "}\n";
33   return s;
34 }
35
36 String
37 Header::ps_string () const
38 {
39   String s;
40
41   s+= "/lily_id_string\n{" + lily_id_str_ + "} bind def\n";
42   
43   for (Dictionary_iter<String> i (*this); i.ok (); i++) 
44     s += "/mudela" + i.key () + "{" + i.val () + "} bind def\n";
45   return s;
46 }
47