]> git.donarmstrong.com Git - lilypond.git/blob - flower/text-db.cc
release: 0.0.42.pre3
[lilypond.git] / flower / text-db.cc
1 #include "text-db.hh"
2 bool
3 Text_db::eof()
4 {
5     Data_file::gobble_leading_white();
6     return  Data_file::eof();
7 }
8
9 void
10 Text_db::gobble_leading_white()
11 {
12     while (1) {
13         Data_file::gobble_leading_white();
14         if (eof())
15             return ;
16         char c;
17         if  ((c = data_get()) !='\n'){
18             data_unget (c);
19             return ;
20         }       
21     }   
22 }
23
24
25 Text_record
26 Text_db::get_record() 
27 {
28    while (1) {
29         String s;
30         Array<String> fields;
31         assert(!eof());
32         
33         while ((s = get_word()) != "")
34             {
35             fields.push(s);     
36             gobble_white();
37             }
38              
39
40         if (get_line() != "")
41             assert(false);
42       
43         assert (fields.size());
44         return Text_record(fields, get_name(), line());
45    }
46 }
47
48