]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/data-file.hh
release: 0.0.42.pre3
[lilypond.git] / flower / include / data-file.hh
1 /*
2   data-file.hh -- declare Data_file
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef DATAFILE_HH
11 #define DATAFILE_HH
12
13 #include "text-stream.hh"
14
15 /// read a data file
16 class Data_file : private Text_stream
17 {
18     
19  public:
20     bool rawmode;
21
22     Text_stream::line;    
23     Text_stream::eof;
24     Text_stream::get_name;    
25
26     char data_get();    
27     void data_unget(char c) {
28         unget(c);
29     }
30
31     /// read line, eat #\n#
32     String get_line();
33     
34     /// read a word till next space, leave space. Also does quotes
35     String get_word();
36
37     /// gobble horizontal white stuff.
38     void gobble_white();
39
40     /// gobble empty stuff before first field.
41     void gobble_leading_white();
42     Data_file(String s) : Text_stream(s) {
43         //*mlog << "(" << s << flush;   
44         rawmode=  false;        
45     }
46
47     ~Data_file()  {
48         //      *mlog << ")"<<flush;    
49     }    
50
51     warning(String s) {
52         message("warning: " + s);
53     }
54     error(String s){
55         message(s);
56         exit(1);    
57     }
58 };
59 #endif // DATAFILE_HH