]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tex-stream.cc
release: 0.1.24
[lilypond.git] / lily / tex-stream.cc
index 71ac2f6e2acffb819b31cc5a8eb1ac868757772c..02c33a8707a9bc5c860002e49fd6ba1f50e5cc4f 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-  
+
 */
 
 #include <fstream.h>
 
 const int MAXLINELEN = 200;
 
-Tex_stream::Tex_stream (String filename) 
+Tex_stream::Tex_stream (String filename)
 {
   os = new ofstream (filename.ch_C ());
   if (!*os)
-       error ("can't open `" + filename+"\'");
+       error (_("can't open `") + filename+"\'");
   nest_level = 0;
   line_len_i_ = 0;
   outputting_comment=false;
@@ -30,8 +30,8 @@ Tex_stream::Tex_stream (String filename)
 void
 Tex_stream::header()
 {
-  *os << "% Creator: " << get_version_str() << "\n";
-  *os << "% Automatically generated, at ";
+  *os << _("% Creator: ") << get_version_str() << "\n";
+  *os << _("% Automatically generated, at ");
   time_t t (time (0));
   *os << ctime (&t)<<"\n";
 }
@@ -40,7 +40,7 @@ Tex_stream::~Tex_stream()
   *os << flush;
   if (!*os)
     {
-      warning("error syncing file (disk full?)");
+      warning(_("error syncing file (disk full?)"));
       exit_status_i_ = 1;
     }
   delete os;
@@ -51,13 +51,13 @@ Tex_stream::~Tex_stream()
 Tex_stream &
 Tex_stream::operator<<(String s)
 {
-  
-  for (char const *cp = s.ch_C (); *cp; cp++) 
+
+  for (char const *cp = s.ch_C (); *cp; cp++)
     {
-       if (outputting_comment) 
+       if (outputting_comment)
          {
            *os << *cp;
-           if (*cp == '\n') 
+           if (*cp == '\n')
              {
                outputting_comment=false;
 
@@ -65,7 +65,7 @@ Tex_stream::operator<<(String s)
            continue;
          }
        line_len_i_ ++;
-       switch (*cp) 
+       switch (*cp)
            {
            case '%':
                outputting_comment = true;
@@ -73,27 +73,27 @@ Tex_stream::operator<<(String s)
                break;
            case '{':
                nest_level++;
-               *os << *cp;             
+               *os << *cp;
                break;
            case '}':
-               nest_level--;           
+               nest_level--;
                *os << *cp;
-               
-               if (nest_level < 0) 
+
+               if (nest_level < 0)
                  {
                    delete os;  // we want to see the remains.
                    assert (nest_level>=0);
                  }
                /* FALLTHROUGH */
-               
+
            case '\n':
                break_line();
-               break;        
+               break;
            case ' ':
                *os <<  ' ';
-               if (line_len_i_ > MAXLINELEN) 
-                  break_line(); 
-               
+               if (line_len_i_ > MAXLINELEN)
+                  break_line();
+
                break;
            default:
                *os << *cp;
@@ -110,4 +110,3 @@ Tex_stream::break_line()
   *os << String (' ', nest_level);
   line_len_i_ = 0;
 }
-