]> git.donarmstrong.com Git - lilypond.git/blob - flower/text-db.cc
fef860eb31cb77de92c87d64b973130d60d0fab9
[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     {
14         Data_file::gobble_leading_white();
15         if (eof())
16             return ;
17         char c;
18         if  ((c = data_get()) !='\n')
19           {
20             data_unget (c);
21             return ;
22         }       
23   }     
24 }
25
26
27 Text_record
28 Text_db::get_record() 
29 {
30    while (1) 
31    {
32         String s;
33         Array<String> fields;
34         assert (!eof());
35         
36         while ((s = get_word()) != "")
37             {
38             fields.push (s);    
39             gobble_white();
40               }
41              
42
43         if (get_line() != "")
44             assert (false);
45     
46         assert (fields.size());
47         return Text_record (fields, get_name(), line ());
48    }
49 }
50
51