]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/text-stream.hh
patch::: 1.3.144.jcn6
[lilypond.git] / flower / include / text-stream.hh
index 3bebb08505d844b04acb0f1ed8575cfece910fa1..6d7e5530a807d528b06302f93df61d482f6dcad4 100644 (file)
@@ -10,7 +10,7 @@
 /**
   line counting input stream. 
   a stream for textfiles. linecounting. Thin interface getchar and
-  ungetchar.  (ungetc is unlimited) 
+  ungetchar. (ungetc is unlimited) 
   
   should protect get and unget against improper use
 */
@@ -27,15 +27,15 @@ class Text_stream
     
 public:
   Text_stream (String fn);
-  String get_name() { return name; }
-  bool eof_b();
-  char get() {
+  String get_name () { return name; }
+  bool eof_b ();
+  char get () {
     char c;
        
-    if (pushback.empty())
+    if (pushback.empty ())
       c = getc (f);    
     else 
-      c = pushback.pop();
+      c = pushback.pop ();
 
     if (c =='\n')
       line_no++;
@@ -46,26 +46,22 @@ public:
       line_no--;
     pushback.push (c);
   }
-  char peek() {
+  char peek () {
     if (eof_b ())
-      return -1;
-    char c = get();
+      return (char)-1;
+    char c = get ();
     unget (c);
     return c;
   }
-  bool eol() {
-    return (peek() == '\n');
+  bool eol () {
+    return (peek () == '\n');
   }
-  int line(){
+  int line (){
     return line_no;
   }
 
-  ~Text_stream(){
-    if (!eof_b()) 
-      cerr <<__FUNCTION__<< ": closing unended file";
-    
-    fclose (f);
-  }
+  ~Text_stream ();
+  
 
   /// GNU format message.
   void message (String s);