]> git.donarmstrong.com Git - lilypond.git/commitdiff
flower-1.0.1
authorfred <fred>
Wed, 9 Oct 1996 11:51:27 +0000 (11:51 +0000)
committerfred <fred>
Wed, 9 Oct 1996 11:51:27 +0000 (11:51 +0000)
flower/textdb.cc

index 4dfdc876b3a93444ae8ca42f6c6266c7336b3580..4c101395836ed62f5173715e4d5e92d66562e77d 100644 (file)
@@ -1,11 +1,34 @@
 #include "textdb.hh"
+bool
+Text_db::eof()
+{
+    Data_file::gobble_leading_white();
+    return  Data_file::eof();
+}
+
+void
+Text_db::gobble_leading_white()
+{
+    while (1) {
+       Data_file::gobble_leading_white();
+       if (eof())
+           return ;
+       char c;
+       if  ((c = data_get()) !='\n'){
+           data_unget (c);
+           return ;
+       }       
+    }  
+}
+
 
 Text_record
 Text_db::get_record() 
 {
+   while (1) {
        String s;
        svec<String> fields;
-       gobble_leading_white();
+       assert(!eof());
        
        while ((s = get_word()) != "")
            {
@@ -16,8 +39,10 @@ Text_db::get_record()
 
        if (get_line() != "")
            assert(false);
-       
+      
+       assert (fields.sz());
        return Text_record(fields, get_name(), line());
+   }
 }