]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/text-stream.cc
release: 1.0.1
[lilypond.git] / flower / text-stream.cc
index 01d2e8ef5cc24dba9b930ec3ea2aeb9b8042d9f7..9c87211c252e02ff06cf9f9c60733936cff49731 100644 (file)
@@ -4,28 +4,38 @@ Text_stream::Text_stream (String fn)
 {
   ios::sync_with_stdio();
   if (fn == "")
-           {
-           name = _("<STDIN>");
-           f = stdin;
-             }
-
-       else
-           {
-           name = fn;
-           f = fopen (fn.ch_C (), "r");
-             }
+    {
+      name = _ ("<stdin>");
+      f = stdin;
+    }
 
-       if (!f)
-         {
-           cerr <<__FUNCTION__<< _(": can't open `") << fn << "'\n";
-           exit (1);
-         }
+  else
+    {
+      name = fn;
+      f = fopen (fn.ch_C (), "r");
+    }
 
-       line_no = 1;
+  if (!f)
+    {
+      cerr << __FUNCTION__ 
+          << ": " << _f ("can't open file: `%s'", fn) << '\n';
+      exit (1);
     }
 
+  line_no = 1;
+}
+
 void
 Text_stream::message (String s)
 {
-  cerr << "\n"<<get_name() << ": " << line ()<<": "<<s<<endl;
+  cerr << '\n'<<get_name() << ": " << line ()<<": "<<s<<endl;
+}
+
+bool
+Text_stream::eof_b ()
+{
+  /* UGH UGH ugh*/
+    return
+      // !pushback.size () && 
+      feof (f);
 }