]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-stream.hh
partial: 1.5.21.jcn
[lilypond.git] / lily / include / paper-stream.hh
1 #ifndef PAPER_STREAM_HH
2 #define PAPER_STREAM_HH
3
4 #include "string.hh"
5
6 /** Paper output
7   Baseclass for writing to a PostScript or TeX file.
8   It counts braces to prevent nesting errors, and
9   it will add a comment sign before each newline.
10  */
11
12 class Paper_stream
13 {
14 public:
15   String basename_;
16   bool outputting_comment_b_;
17   ostream *os_;
18   int nest_level;
19   /// to check linelen in output. TeX has limits.
20   int line_len_i_;
21     
22   /// open a file for writing
23   Paper_stream (String filename);
24
25   /// delegate conversion to scalar class
26   Paper_stream &operator << (String);
27
28   /// close the file
29   ~Paper_stream ();
30
31 private:
32   Paper_stream (Paper_stream const&);
33   void break_line ();
34 };
35
36 #include <iostream.h> /* gcc 3.0 */
37 #if __GNUC__ > 2
38 ostream *open_file_stream (String filename,
39                            std::ios_base::openmode mode=std::ios::out);
40 #else
41 ostream *open_file_stream (String filename, int mode=ios::out);
42 #endif
43 void close_file_stream (ostream *os);
44
45
46 #endif // PAPER_STREAM_HH