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