]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 26 Jan 2006 11:17:24 +0000 (11:17 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 26 Jan 2006 11:17:24 +0000 (11:17 +0000)
238 files changed:
ChangeLog
GNUmakefile.in
flower/file-name.cc
flower/file-path.cc
flower/getopt-long.cc
flower/include/file-name.hh
flower/include/file-path.hh
flower/include/flower-proto.hh
flower/include/getopt-long.hh
flower/include/international.hh
flower/include/interval.hh
flower/include/interval.tcc
flower/include/offset.hh
flower/include/rational.hh
flower/include/std-string.hh
flower/include/string-convert.hh
flower/include/string-data.hh
flower/include/string-data.icc
flower/include/string-handle.hh
flower/include/string-handle.icc
flower/include/string.hh
flower/include/string.icc
flower/include/warn.hh
flower/international.cc
flower/interval.cc
flower/offset.cc
flower/rational.cc
flower/std-string.cc
flower/string-convert.cc
flower/string.cc
flower/stringutil.cc
flower/warn.cc
lily/accidental-engraver.cc
lily/accidental.cc
lily/all-font-metrics.cc
lily/apply-context-iterator.cc
lily/audio-item.cc
lily/auto-change-iterator.cc
lily/axis-group-engraver.cc
lily/bar-check-iterator.cc
lily/bar-engraver.cc
lily/bar-line.cc
lily/beam-engraver.cc
lily/beam-quanting.cc
lily/beam.cc
lily/binary-source-file.cc
lily/break-align-interface.cc
lily/change-iterator.cc
lily/chord-tremolo-engraver.cc
lily/chord-tremolo-iterator.cc
lily/clef.cc
lily/cluster.cc
lily/coherent-ligature-engraver.cc
lily/context-def.cc
lily/context-property.cc
lily/context-specced-music-iterator.cc
lily/context.cc
lily/custos.cc
lily/dots.cc
lily/duration.cc
lily/dynamic-engraver.cc
lily/event-chord-iterator.cc
lily/extender-engraver.cc
lily/file-name-map.cc
lily/folded-repeat-iterator.cc
lily/font-config-scheme.cc
lily/font-config.cc
lily/font-metric.cc
lily/function-documentation.cc
lily/general-scheme.cc
lily/glissando-engraver.cc
lily/global-context-scheme.cc
lily/global-context.cc
lily/gourlay-breaking.cc
lily/gregorian-ligature-engraver.cc
lily/gregorian-ligature.cc
lily/grob-interface-scheme.cc
lily/grob-interface.cc
lily/grob.cc
lily/hairpin.cc
lily/horizontal-bracket-engraver.cc
lily/hyphen-engraver.cc
lily/includable-lexer.cc
lily/include/accidental-interface.hh
lily/include/all-font-metrics.hh
lily/include/audio-item.hh
lily/include/bar-line.hh
lily/include/bar.hh
lily/include/binary-source-file.hh
lily/include/book.hh
lily/include/change-iterator.hh
lily/include/context.hh
lily/include/dimensions.hh
lily/include/duration.hh
lily/include/file-name-map.hh
lily/include/font-metric.hh
lily/include/freetype.hh
lily/include/gregorian-ligature.hh
lily/include/grob.hh
lily/include/group-interface.hh
lily/include/includable-lexer.hh
lily/include/input.hh
lily/include/kpath.hh
lily/include/lily-guile.hh
lily/include/lily-lexer.hh
lily/include/lily-parser.hh
lily/include/lily-version.hh
lily/include/lilypond-input-version.hh
lily/include/lilypond-key.hh
lily/include/main.hh
lily/include/midi-item.hh
lily/include/midi-stream.hh
lily/include/misc.hh
lily/include/modified-font-metric.hh
lily/include/moment.hh
lily/include/music-output.hh
lily/include/open-type-font.hh
lily/include/output-def.hh
lily/include/pango-font.hh
lily/include/paper-outputter.hh
lily/include/performance.hh
lily/include/pitch.hh
lily/include/prob.hh
lily/include/relocate.hh
lily/include/rest.hh
lily/include/score.hh
lily/include/slur-configuration.hh
lily/include/source-file.hh
lily/include/source.hh
lily/include/stream.hh
lily/include/text-metrics.hh
lily/include/tfm-reader.hh
lily/include/tfm.hh
lily/include/translator.hh
lily/include/type-swallow-translator.hh
lily/input-scheme.cc
lily/input-smob.cc
lily/input.cc
lily/key-signature-interface.cc
lily/lexer.ll
lily/ligature-engraver.cc
lily/lily-guile.cc
lily/lily-lexer.cc
lily/lily-parser-scheme.cc
lily/lily-parser.cc
lily/lily-version.cc
lily/lilypond-key.cc
lily/lilypond-version.cc
lily/lookup.cc
lily/ly-module.cc
lily/lyric-engraver.cc
lily/main.cc
lily/mark-engraver.cc
lily/mensural-ligature-engraver.cc
lily/mensural-ligature.cc
lily/midi-item.cc
lily/midi-stream.cc
lily/misc.cc
lily/modified-font-metric.cc
lily/module-scheme.cc
lily/moment.cc
lily/music-function.cc
lily/music.cc
lily/new-fingering-engraver.cc
lily/new-lyric-combine-music-iterator.cc
lily/note-collision.cc
lily/note-column.cc
lily/note-head.cc
lily/note-name-engraver.cc
lily/open-type-font-scheme.cc
lily/open-type-font.cc
lily/output-def.cc
lily/output-property-music-iterator.cc
lily/pango-font.cc
lily/pango-select.cc
lily/paper-book.cc
lily/paper-column.cc
lily/paper-outputter-scheme.cc
lily/paper-outputter.cc
lily/paper-score.cc
lily/parse-scm.cc
lily/parser.yy
lily/part-combine-iterator.cc
lily/percent-repeat-engraver.cc
lily/percent-repeat-iterator.cc
lily/performance.cc
lily/pfb.cc
lily/phrasing-slur-engraver.cc
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/pitch.cc
lily/prob.cc
lily/program-option.cc
lily/property-iterator.cc
lily/quote-iterator.cc
lily/relative-octave-check.cc
lily/relocate.cc
lily/repeat-acknowledge-engraver.cc
lily/rest-collision.cc
lily/rest.cc
lily/score-engraver.cc
lily/score.cc
lily/script-engraver.cc
lily/side-position-interface.cc
lily/simple-spacer.cc
lily/slur-engraver.cc
lily/slur.cc
lily/source-file.cc
lily/source.cc
lily/spacing-spanner.cc
lily/span-bar.cc
lily/span-dynamic-performer.cc
lily/staff-performer.cc
lily/staff-spacing.cc
lily/stem-engraver.cc
lily/stem.cc
lily/sustain-pedal.cc
lily/system.cc
lily/template5.cc
lily/text-interface.cc
lily/text-metrics.cc
lily/text-spanner-engraver.cc
lily/tfm-reader.cc
lily/tfm.cc
lily/tie-engraver.cc
lily/time-scaled-music-iterator.cc
lily/time-signature-engraver.cc
lily/time-signature.cc
lily/translator-ctors.cc
lily/translator.cc
lily/trill-spanner-engraver.cc
lily/ttf.cc
lily/vaticana-ligature-engraver.cc
lily/vaticana-ligature.cc
lily/vertical-align-engraver.cc
lily/volta-bracket.cc
lily/volta-engraver.cc
lily/volta-repeat-iterator.cc

index 925558bbbc75e9bbb8e040b736500734cdb87a2a..e000adc6e7ba2f6dc73e7d3be44ecdff81f932f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-26  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * Finish std::string interface.  For now, use std:: marker
+       throughout for easy s/r.
+
 2006-01-26  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * Documentation/user/putting.itely (Score is a single musical
@@ -28,6 +33,8 @@
 
 2006-01-25  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * GNUmakefile.in (c-clean): New target.
+
        * flower/include/std-string.hh: String/std::string compatibility:
        Use NPOS for `not found' (iso -1), use ssize for length () and pos
        type.
index 332676d2c2589431fec2e8a947ac802a4bd738ef..c84bf3fa4cebe5a83c66438e224bee4bce2360eb 100644 (file)
@@ -94,6 +94,10 @@ tree-share = $(tree-prefix)/share
 tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION)
 tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION)
 
+C_DIRS = flower lily
+c-clean:
+       $(foreach i, $(C_DIRS), $(MAKE) -C $(i) clean &&) true
+
 src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
 
 web-clean:
index fbd31de4c85f5ceb5f7ee3d3ac7633c4c28e340b..9cd37c9a7bef7080f5ffc6f438d3e294a4f109bd 100644 (file)
@@ -36,8 +36,8 @@ using namespace std;
 #endif
 
 #ifdef __CYGWIN__
-static Std_string
-dos_to_posix (Std_string file_name)
+static std::string
+dos_to_posix (std::string file_name)
 {
   char buf[PATH_MAX] = "";
   char *s = file_name.get_copy_str0 ();
@@ -53,8 +53,8 @@ dos_to_posix (Std_string file_name)
 #ifdef __MINGW32__
 /** Use slash as directory separator.  On Windows, they can pretty
     much be exchanged.  */
-static Std_string
-slashify (Std_string file_name)
+static std::string
+slashify (std::string file_name)
 {
   file_name.substitute ('\\', '/');
   file_name.substitute ("//", "/");
@@ -63,25 +63,25 @@ slashify (Std_string file_name)
 #endif /* __MINGW32__ */
 
 /* Join components to full file_name. */
-Std_string
+std::string
 File_name::to_string () const
 {
-  Std_string s;
+  std::string s;
   if (!root_.empty ())
-    s = root_ + ::to_std_string (ROOTSEP);
+    s = root_ + std::to_string (ROOTSEP);
   if (!dir_.empty ())
     {
       s += dir_;
       if (!base_.empty () || !ext_.empty ())
-       s += ::to_std_string (DIRSEP);
+       s += std::to_string (DIRSEP);
     }
   s += base_;
   if (!ext_.empty ())
-    s += ::to_std_string (EXTSEP) + ext_;
+    s += std::to_string (EXTSEP) + ext_;
   return s;
 }
 
-File_name::File_name (Std_string file_name)
+File_name::File_name (std::string file_name)
 {
 #ifdef __CYGWIN__
   /* All system functions would work, even if we do not convert to
@@ -93,7 +93,7 @@ File_name::File_name (Std_string file_name)
   file_name = slashify (file_name);
 #endif
 
-  int i = file_name.find (ROOTSEP);
+  ssize i = file_name.find (ROOTSEP);
   if (i != NPOS)
     {
       root_ = file_name.substr (0, i);
@@ -129,6 +129,6 @@ File_name::is_absolute () const
 #if 0 //STD_STRING
 File_name::File_name (String file_name)
 {
-  *this = File_name (Std_string (file_name));
+  *this = File_name (std::string (file_name));
 }
 #endif
index 19d9d9bfaba0b73d23689a54fe874234070afca6..058d54793ba126dbb74cef5ffb84aafce991c097 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "file-path.hh"
 
+#include "std-string.hh"
+
 #include <cstdio>
 #include <cerrno>
 using namespace std;
@@ -29,28 +31,34 @@ using namespace std;
 #define PATHSEP ':'
 #endif
 
-Array<Std_string>
+Array<std::string>
 File_path::directories () const
 {
   return dirs_;
 }
 
+#include <algorithm>
 void
-File_path::parse_path (Std_string p)
+File_path::parse_path (std::string p)
 {
-  int len;
+  ssize len;
   while ((len = p.length ()))
     {
-      int i = p.find (PATHSEP);
+      ssize i = p.find (PATHSEP);
       if (i == NPOS)
        i = len;
       append (p.substr (0, i));
-      p = p.substr (min (int(len), i + 1));
+      //p = p.substr (min (len, i + 1));
+      //ssize x = min (len, i + 1);
+      ssize a = len;
+      ssize b = i + 1;
+      ssize x = std::max (a, b);
+      p = p.substr (x);
     }
 }
 
 bool
-is_file (Std_string file_name)
+is_file (std::string file_name)
 {
 #if 0 /* Check if directory. TODO: encapsulate for autoconf */
   struct stat sbuf;
@@ -79,7 +87,7 @@ is_file (Std_string file_name)
 }
 
 bool
-is_dir (Std_string file_name)
+is_dir (std::string file_name)
 {
 #if !STAT_MACROS_BROKEN
   struct stat sbuf;
@@ -106,8 +114,8 @@ directory, in this order.
 @return
 The file name if found, or empty string if not found. */
 
-Std_string
-File_path::find (Std_string name) const
+std::string
+File_path::find (std::string name) const
 {
   if (!name.length () || (name == "-"))
     return name;
@@ -125,14 +133,14 @@ File_path::find (Std_string name) const
   for (int i = 0; i < dirs_.size (); i++)
     {
       File_name file_name (name);
-      File_name dir = (Std_string) dirs_[i];
+      File_name dir = (std::string) dirs_[i];
       file_name.root_ = dir.root_;
       dir.root_ = "";
       if (file_name.dir_.empty ())
        file_name.dir_ = dir.to_string ();
       else if (!dir.to_string ().empty ())
        file_name.dir_ = dir.to_string ()
-         + ::to_string (DIRSEP) + file_name.dir_;
+         + std::to_string (DIRSEP) + file_name.dir_;
       if (is_file (file_name.to_string ()))
        return file_name.to_string ();
     }
@@ -146,21 +154,21 @@ File_path::find (Std_string name) const
 
   where EXT is from EXTENSIONS.
 */
-Std_string
-File_path::find (Std_string name, char const *extensions[])
+std::string
+File_path::find (std::string name, char const *extensions[])
 {
   if (name.empty () || name == "-")
     return name;
   
   File_name file_name (name);
-  Std_string orig_ext = file_name.ext_;
+  std::string orig_ext = file_name.ext_;
   for (int i = 0; extensions[i]; i++)
     {
       file_name.ext_ = orig_ext;
       if (*extensions[i] && !file_name.ext_.empty ())
        file_name.ext_ += ".";
       file_name.ext_ += extensions[i];
-      Std_string found = find (file_name.to_string ());
+      std::string found = find (file_name.to_string ());
       if (!found.empty ())
        return found;
     }
@@ -170,7 +178,7 @@ File_path::find (Std_string name, char const *extensions[])
 
 /** Append a directory, return false if failed.  */
 bool
-File_path::try_append (Std_string s)
+File_path::try_append (std::string s)
 {
   if (s == "")
     s = ".";
@@ -182,27 +190,27 @@ File_path::try_append (Std_string s)
   return false;
 }
 
-Std_string
+std::string
 File_path::to_string () const
 {
-  Std_string s;
+  std::string s;
   for (int i = 0; i < dirs_.size (); i++)
     {
       s = s + dirs_[i];
       if (i < dirs_.size () - 1)
-       s += ::to_string (PATHSEP);
+       s += std::to_string (PATHSEP);
     }
   return s;
 }
 
 void
-File_path::append (Std_string str)
+File_path::append (std::string str)
 {
   dirs_.push (str);
 }
 
 void
-File_path::prepend (Std_string str)
+File_path::prepend (std::string str)
 {
   dirs_.insert (str, 0);
 }
index b7abd93817be4ded6ddf449cdf9397aa70c06eda..561210dc60b01a3ba33173d49030369927b8ecca 100644 (file)
@@ -11,7 +11,8 @@
 #include <cstdlib>
 
 #include "config.hh"
-#include "string.hh"
+#include "international.hh"
+#include "std-string.hh"
 
 #if !HAVE_GETTEXT
 inline char *
@@ -85,25 +86,25 @@ Getopt_long::parselong ()
   return found_option_;
 }
 
-Std_string
+std::string
 Long_option_init::to_string () const
 {
-  Std_string str;
+  std::string str;
   if (shortname_char_)
     str += "-" + shortname_char_;
   if (shortname_char_ && longname_str0_)
     str += ", ";
   if (longname_str0_)
-    str += Std_string ("`--") + longname_str0_ + "'";
+    str += std::string ("`--") + longname_str0_ + "'";
   return str;
 }
 
-Std_string
+std::string
 Long_option_init::str_for_help () const
 {
-  Std_string s;
+  std::string s;
   if (shortname_char_)
-    s = "-" + ::to_string (shortname_char_);
+    s = "-" + std::to_string (shortname_char_);
   else
     s = "  ";
 
@@ -132,7 +133,7 @@ Getopt_long::report (Errorcod c)
   if (!error_out_)
     return;
 
-  Std_string str = arg_value_char_a_a_[0];
+  std::string str = arg_value_char_a_a_[0];
   str += ": ";
   switch (c)
     {
@@ -146,9 +147,9 @@ Getopt_long::report (Errorcod c)
       break;
     case E_UNKNOWNOPTION:
       str += _f ("unrecognized option: `%s'",
-                Std_string (argument_index_
-                            ? Std_string ("-" + Std_string (1, arg_value_char_a_a_[array_index_][argument_index_]))
-                        : Std_string (arg_value_char_a_a_[array_index_])));
+                std::string (argument_index_
+                            ? std::string ("-" + std::string (1, arg_value_char_a_a_[array_index_][argument_index_]))
+                        : std::string (arg_value_char_a_a_[array_index_])));
       break;
     case E_ILLEGALARG:
       str += _f ("invalid argument `%s' to option `%s'",
@@ -295,23 +296,23 @@ Getopt_long::get_next_arg ()
 
 const int EXTRA_SPACES = 5;
 
-Std_string
+std::string
 Long_option_init::table_string (Long_option_init *l)
 {
-  Std_string tabstr = "";
+  std::string tabstr = "";
 
   int wid = 0;
   for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
-    wid = max (wid, int(l[i].str_for_help ().length ()));
+    wid = std::max (int(wid), int(l[i].str_for_help ().length ()));
 
   for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
     {
-      Std_string s = "  " + l[i].str_for_help ();
-      s += Std_string (wid - s.length () + EXTRA_SPACES, ' ');
+      std::string s = "  " + l[i].str_for_help ();
+      s += std::string (wid - s.length () + EXTRA_SPACES, ' ');
 
-      Std_string help_text (gettext (l[i].help_str0_));
+      std::string help_text (gettext (l[i].help_str0_));
       replace_all (help_text, "\n",
-                  "\n" + Std_string (wid + EXTRA_SPACES + 2, ' '));
+                  "\n" + std::string (wid + EXTRA_SPACES + 2, ' '));
       tabstr += s + help_text + "\n";
     }
 
index b91eb351564f060cd4c65af10994b24b9187d369..329a972c9f69b8d5043d740db6359c9a5f09061c 100644 (file)
 class File_name
 {
 public:
-  Std_string root_;
-  Std_string dir_;
-  Std_string base_;
-  Std_string ext_;
+  std::string root_;
+  std::string dir_;
+  std::string base_;
+  std::string ext_;
 
-  File_name (Std_string);
+  File_name (std::string);
 #if 0// STD_STRING
   File_name (String);
 #endif
 
   bool is_absolute () const;
-  Std_string to_string () const;
+  std::string to_string () const;
 };
 
 #endif /* FILE_NAME */
index 23997002328422f5cdebca12ed1efc65fdfdc397..22b943e9c89ac85576f1f91240f020cb1739cf14 100644 (file)
 
 class File_path
 {
-  Array<Std_string> dirs_;
+  Array<std::string> dirs_;
 public:
-  Array<Std_string> directories () const;
-  Std_string find (Std_string name) const;
-  Std_string find (Std_string name, char const *extensions[]);
-  Std_string to_string () const;
-  bool try_append (Std_string str);
-  void append (Std_string str);
-  void parse_path (Std_string);
-  void prepend (Std_string str);
+  Array<std::string> directories () const;
+  std::string find (std::string name) const;
+  std::string find (std::string name, char const *extensions[]);
+  std::string to_string () const;
+  bool try_append (std::string str);
+  void append (std::string str);
+  void parse_path (std::string);
+  void prepend (std::string str);
 };
 
-bool is_file (Std_string file_name);
-bool is_dir (Std_string file_name);
+bool is_file (std::string file_name);
+bool is_dir (std::string file_name);
 
 #endif /* FILE_PATH */
index 24a050b16951d646b6964d9bdefddba284e303ff..f175eebb1ae9ba753b36c84120416ad8b973696a 100644 (file)
@@ -19,6 +19,15 @@ template<class T> struct Link_list;
 template<class T> struct Interval_t;
 template<class T> struct PQueue;
 
+typedef unsigned char Byte;
+namespace std {
+  struct String_data;
+  struct String_handle;
+  //struct String;
+}
+struct String_convert;
+
+#include "std-string.hh"
 #include "real.hh"
 
 typedef Interval_t<Real> Interval;
@@ -29,10 +38,6 @@ struct Rational;
 class File_name;
 class File_path;
 struct Getopt_long;
-struct String_data;
-struct String_handle;
-struct String_convert;
-struct String;
 
 struct Text_stream;
 struct Data_file;
@@ -46,7 +51,6 @@ typedef unsigned U32;
 typedef int I32;
 typedef long long I64;
 
-typedef unsigned char Byte;
 
 struct Duration;
 struct Duration_iterator;
index 03b660b30d09ca95d798e05270885a8a397577b4..0ab316fc94ceec4cf1d5a0a49bcdd922a081c116 100644 (file)
@@ -20,12 +20,12 @@ struct Long_option_init
 
   char const *help_str0_;
 
-  Std_string to_string () const;
-  Std_string str_for_help () const;
+  std::string to_string () const;
+  std::string str_for_help () const;
   //   NO constructor!
 
   static int compare (Long_option_init const &, Long_option_init const &);
-  static Std_string table_string (Long_option_init *);
+  static std::string table_string (Long_option_init *);
 };
 
 /** C++ for version of long_getopt.  For processing GNU style command
index bba4a5a3305c0303f54810b14594e0b6dd544c4c..fdf41a9b964112206b41507c33c0d698b85116f5 100644 (file)
 /**
    Internationalisation: _ ("to be translated") gets "translated" by GNU gettext
 */
-Std_string _ (char const *ch);
+std::string _ (char const *ch);
 
 /**
    Internationalisation: _f ("Usage: %s [FILE]", "lilypond") gets "translated" by
    GNU gettext
 */
-Std_string _f (char const *format, ...);
-Std_string _f (char const *format, Std_string s, Std_string s2 = "", Std_string s3 = "");
+std::string _f (char const *format, ...);
+std::string _f (char const *format, std::string s, std::string s2 = "", std::string s3 = "");
 
 #endif // INTERNATIONAL_HH
 
index 6351d35535f7ea138da8bda1b2689d24054bfd0f..01754b9716917c06b476e6340be38651e7b7fe17 100644 (file)
@@ -24,7 +24,7 @@ struct Interval_t : public Drul_array<T>
   Drul_array<T>::elem_ref;
 
   static T infinity ();
-  static Std_string T_to_string (T arg);
+  static std::string T_to_string (T arg);
   T center () const;
   void translate (T t)
   {
@@ -111,7 +111,7 @@ struct Interval_t : public Drul_array<T>
     Drul_array<Real> da (elem (LEFT), elem (RIGHT));
     return ::linear_combination (da, x);
   }
-  Std_string to_string () const;
+  std::string to_string () const;
 
   bool contains (T r) const;
   void negate ()
index 9af4047a8c35e5d133d28cf39282ece1de610cc8..396904d05d908d9676e14f523285a9e5a419e986 100644 (file)
@@ -12,7 +12,7 @@
 #include <cassert>
 
 #include "interval.hh"
-#include "string.hh"
+#include "std-string.hh"
 
 // MacOS 10.3 problems:
 // #include <cmath>
@@ -105,15 +105,15 @@ Interval_t<T>::intersect (Interval_t<T> h)
 }
 
 template<class T>
-Std_string
+std::string
 Interval_t<T>::to_string () const
 {
   if (is_empty ())
     return "[empty]";
-  Std_string s ("[");
+  std::string s ("[");
 
-  return (s + T_to_string (elem (LEFT)) + Std_string (",")
-         + T_to_string (elem (RIGHT)) + Std_string ("]"));
+  return (s + T_to_string (elem (LEFT)) + std::string (",")
+         + T_to_string (elem (RIGHT)) + std::string ("]"));
 }
 
 template<class T>
index 5ca7e0e68c637130c2c9fe7e42b8d90503b97d77..73684355aeb34e8cffc0ebf4ba3749467fccdecd 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "axis.hh"
 #include "std-string.hh"
-#include "string.hh"
 #include "real.hh"
 
 class Offset;
@@ -94,7 +93,7 @@ public:
     coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS] = 0.0;
   }
 
-  Std_string to_string () const;
+  std::string to_string () const;
 
   Offset &mirror (Axis a)
   {
@@ -112,6 +111,7 @@ public:
   }
 };
 
+#include "arithmetic-operator.hh"
 IMPLEMENT_ARITHMETIC_OPERATOR (Offset, +);
 IMPLEMENT_ARITHMETIC_OPERATOR (Offset, -);
 IMPLEMENT_ARITHMETIC_OPERATOR (Offset, *);
index 6c0da7b9a9e1a4cfbff210b721007f70f3954b1c..461b2522a285de9ee5f6488706dd51ce38d3f70e 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "std-string.hh"
 
-#include "string.hh"
+#include "std-string.hh"
 
 /**
    Rational numbers.  Included is support for + and - infinity.
@@ -69,9 +69,10 @@ public:
   Rational &operator %= (Rational);
   static int compare (Rational const &, Rational const &);
   int sign () const;
-  Std_string to_string () const;
+  std::string to_string () const;
 };
 
+#include "arithmetic-operator.hh"
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, /);
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, +);
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, *);
index 4cefb799534c19286ee40c6cd9f7e2f3b1c24f0d..6c83bc526fb923e473128e96d318f0fceb0660a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  std-string.hh -- declare Std_string
+  std-string.hh -- declare std::string
 
   source file of the GNU LilyPond music typesetter
 
 
 #if !STD_STRING
 
-#define Std_string String
-#define to_std_string to_string
-class String;
-typedef int ssize;
-#define NPOS -1
+/* Also declare string, in the wrong way.  */
+#include <algorithm>
+#include <iostream>
+#include <sstream>
+
+#endif
 
-#include "string.hh"
 
-#else
 
+#include "compare.hh"
+
+#if STD_STRING
 #include <string>
-// #warning Using std::string
-using namespace std;
-typedef size_t ssize;
+#endif
 
-#define NPOS std::string::npos
+#if STD_STRING
 
 namespace std {
 
-#if 0
-  class Std_string : public string
-  {
-  public:
-    Std_string ();
-    Std_string (char const*);
-    Std_string (Std_string const&, int pos, int n=npos);
-    ///Std_string (String const&, int pos, int n);
-    ////Std_string (String const &);
-    ////operator String ();
-  };
-#else  
-  typedef string Std_string;
-#endif
+  typedef size_t ssize;
+#define NPOS std::string::npos
+  // typedef string std::string;
+}
 
-  //operator Std_string (String const&);
+#else /* ! STD_STRING */
 
-  Std_string to_std_string (Std_string s);
-  Std_string to_std_string (char c, int n = 1);
-  Std_string to_std_string (int i, char const *format = 0);
-  Std_string to_std_string (double f, char const *format = 0);
-  Std_string to_std_string (long b);
-  Std_string to_std_string (bool b);
-  Std_string to_std_string (char const *format, ...);
+namespace std {
+
+#define string String
+  using namespace std;
+  class String;
+  typedef int ssize;
+#define NPOS -1
+}
+
+#include "string.hh"
 
 #endif /* STD_STRING */
 
-  Std_string &replace_all (Std_string &str, Std_string find, Std_string replace);
-#if STD_STRING
-}
-#endif
+namespace std {
+
+  std::string to_string (std::string s);
+  std::string to_string (char c, int n = 1);
+  std::string to_string (int i, char const *format = 0);
+  std::string to_string (double f, char const *format = 0);
+  std::string to_string (long b);
+  std::string to_string (bool b);
+  std::string to_string (char const *format, ...);
+  
+  std::string &replace_all (std::string &str, std::string find, std::string replace);
+  std::string &replace_all (std::string &str, char find, char replace);
+  char *string_copy (std::string s);
   
+  int string_compare (std::string const &, std::string const &);
+  INSTANTIATE_COMPARE (std::string const &, string_compare);
+}
 
 #endif /* STD_STRING_HH */
index 1e9da716ef99671ff30a55d299aa49fab02e511a..198e365b964c950df4daf815f5229cd4a27964d0 100644 (file)
 using namespace std;
 
 #include "std-string.hh"
-#include "string.hh"
+#include "flower-proto.hh"
 
-/** The functor Std_string_convert handles all conversions to/from Std_string
+/** The functor std::string_convert handles all conversions to/from std::string
     (some time, anyway).  The class is quite empty from data view.  */
 class String_convert
 {
-  static int hex2bin (Std_string hex_string, Std_string &bin_string_r);
+  static int hex2bin (std::string hex_string, std::string &bin_string_r);
   static int hex2nibble (Byte byte);
   static Byte nibble2hex_byte (Byte byte);
 public:
-  static Std_string pad_to (Std_string s, int length);
-  static Std_string bool_string (bool b);
-  static Std_string bin2dec (Std_string bin_string);
-  static Std_string bin2hex (Std_string bin_string);
-  static Std_string dec2bin (Std_string str);
-  static int bin2int (Std_string bin_string);
-  static unsigned bin2unsigned (Std_string bin_string);
-  static Std_string char_string (char c, int n);
-  static int dec2int (Std_string dec_string);
-  static double dec2double (Std_string dec_string);
-  static Std_string double_string (double f, char const *fmt = 0);
-  static Std_string form_string (char const *format, ...);
-  static Std_string vform_string (char const *format, va_list args);
-  static int hex2int (Std_string str);
-  static unsigned hex2unsigned (Std_string str);
-  static Std_string hex2bin (Std_string str);
-  static Std_string int_string (int i, char const *fmt = 0);
-  static Std_string long_string (long);
-  static Std_string int2hex (int i, int length_i, char ch);
-  static Std_string unsigned2hex (unsigned u, ssize length, char ch);
-  static Std_string int2dec (int i, int length_i, char ch);
-  static Std_string rational_string (Rational);
-  static Std_string pointer_string (void const *);
-  static Std_string precision_string (double x, int n);
-  static Array<Std_string> split (Std_string str, char c);
-  static Std_string i64_string (I64, char const *fmt = 0);
+  static std::string pad_to (std::string s, int length);
+  static std::string bool_string (bool b);
+  static std::string bin2dec (std::string bin_string);
+  static std::string bin2hex (std::string bin_string);
+  static std::string dec2bin (std::string str);
+  static int bin2int (std::string bin_string);
+  static unsigned bin2unsigned (std::string bin_string);
+  static std::string char_string (char c, int n);
+  static int dec2int (std::string dec_string);
+  static double dec2double (std::string dec_string);
+  static std::string double_string (double f, char const *fmt = 0);
+  static std::string form_string (char const *format, ...);
+  static std::string vform_string (char const *format, va_list args);
+  static int hex2int (std::string str);
+  static unsigned hex2unsigned (std::string str);
+  static std::string hex2bin (std::string str);
+  static std::string int_string (int i, char const *fmt = 0);
+  static std::string long_string (long);
+  static std::string int2hex (int i, int length_i, char ch);
+  static std::string unsigned2hex (unsigned u, ssize length, char ch);
+  static std::string int2dec (int i, int length_i, char ch);
+  static std::string rational_string (Rational);
+  static std::string pointer_string (void const *);
+  static std::string precision_string (double x, int n);
+  static Array<std::string> split (std::string str, char c);
+  static std::string i64_string (I64, char const *fmt = 0);
+  static std::string to_lower (std::string s);
+  static std::string to_upper (std::string s);
+  static std::string reverse (std::string s);
 };
 
 #endif // __STRING_CONVERT_HH //
index 43d145af6c278d02ede9198c89ba2ac09cb9134d..11dbe28189d32c657c154bd5d8a0723497889a79 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "flower-proto.hh"
 
+namespace std {
+  
 /**Internal String struct.
    the data itself. Handles simple tasks (resizing, resetting)
 */
@@ -65,8 +67,8 @@ class String_data
   void operator += (char const *str0);
 
   char const *c_str () const;
-
-  char *get_str0 ();
+  char *get_c_str ();
 
   Byte const *to_bytes () const;
 
@@ -82,6 +84,8 @@ class String_data
   bool is_binary_bo () const;
 };
 
+}
+
 #ifdef STRING_UTILS_INLINED
 #ifndef INLINE
 #define INLINE inline
index 3e6e0d546d61f8e7bb2176c3fa594076fd4a4b29..078e5724b2408d6caf313e3d20dd893dd1c46eee 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "string-data.hh"
 
-#include <algorithm>
+//#include <algorithm>
 #include <cassert>
 #include <cstring>
 #include <memory>
@@ -21,6 +21,8 @@ const int INITIALMAX = 8;
 
 #include <sys/types.h>
 
+namespace std {
+  
 INLINE void
 String_data::OKW ()
 {
@@ -157,7 +159,7 @@ String_data::c_str () const
   return (char const *)data_byte_;
 }
 INLINE char *
-String_data::get_str0 ()
+String_data::get_c_str ()
 {
   return (char *)data_byte_;
 }
@@ -206,4 +208,6 @@ String_data::operator [] (int j) const
   return data_byte_[j];
 }
 
+}
+
 #endif // __STRING_UTIL_CC //
index 7527a2de5076fdcc87419b545d27a466ee774cf4..9551508110badafeda6acd9ba471f6951a4f1aa7 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "flower-proto.hh"
 
+namespace std {
 /**
    Reference counting for strings.
 
@@ -39,7 +40,7 @@ public:
   Byte const *to_bytes () const;
   char const *c_str () const;
   Byte *get_bytes ();
-  char *get_str0 ();
+  char *get_c_str ();
   bool is_binary_bo () const;
   void operator = (String_handle const &src);
   void operator += (char const *s);
@@ -56,6 +57,8 @@ public:
   int length () const;
 };
 
+}
+
 #ifdef STRING_UTILS_INLINED
 #ifndef INLINE
 #define INLINE inline
index 10314f441c822ba2acaff4b959eb04374b2365a7..7e653ef2e278319af7b894e23b16d552f8cd8b08 100644 (file)
@@ -17,6 +17,8 @@ using namespace std;
 #include "string-data.hh"
 #include "string-handle.hh"
 
+namespace std {
+  
 INLINE void
 String_handle::down ()
 {
@@ -74,7 +76,7 @@ String_handle::get_bytes ()
 }
 
 INLINE char *
-String_handle::get_str0 ()
+String_handle::get_c_str ()
 {
   copy ();
   return (char *)data->get_bytes ();
@@ -162,4 +164,6 @@ String_handle::is_binary_bo () const
   return data->is_binary_bo ();
 }
 
+}
+
 #endif
index b541368d7e67520b592829c0879a5a93c9a5b863..7dd9932fe44e2599a64e3a43392ac9bdc384d5b1 100644 (file)
@@ -6,6 +6,10 @@
   introduced Class String_handle
 */
 
+#ifndef STD_STRING_HH
+#error string.hh is obsolete, use std-string.hh
+#endif
+
 #ifndef STRING_HH
 #define STRING_HH
 
@@ -18,119 +22,75 @@ class ostream;
 #endif
 #endif
 
-#include "std-string.hh"
 #include "arithmetic-operator.hh"
 #include "string-handle.hh"
 
-/**
-
-Intuitive string class. provides
-\begin{itemize}
-\item
-ref counting through #String_handle#
-\item
-conversion from bool, int, double, char* , char.
-\item
-to be moved to String_convert:
-conversion to int, upcase, downcase
-
-\item
-printable.
-
-\item
-indexing (index_i, index_any_i, last_index_i)
+namespace std {
 
-\item
-cutting (left_string, right_string, mid_string)
-
-\item
-concat (+=, +)
-
-\item
-signed comparison (<, >, ==, etc)
-
-\item
-No operator[] is provided, since this would be enormously  slow. If needed,
-convert to char const* .
-\end{itemize}
-*/
 class String
 {
 public:
 
-#if STD_STRING
-  String (Std_string const &);
-  operator Std_string () const;
-#endif /* STD_STRING */
+  /* partial std::string interface */
+  String ();
+  String (int n, char c);
+  String (char const *source);
+  String (char const *, int n);
+  String (String const &, int pos, ssize n=NPOS);
+
+  String &operator = (String const &source);
+  /// concatenate s
+  void operator += (char const *s) { strh_ += s; }
+  void operator += (String s);
+  char &operator [] (int n);
+  char operator [] (int n) const;
+
 
-  /* std::string interface */
   char const *c_str () const;
   char const *data () const;
   bool empty () const;
-  int find (String &s, int pos=0) const;
-  int find (char c) const;
+  int find (String s, int pos=0) const;
+  int find (char c, int pos=0) const;
+  int find (char const *c, int pos=0) const;
   int rfind (char c) const;
   String replace (int pos, int n, String str);
 
-  String substr (int pos=0, int n=NPOS) const;
+  String substr (int pos=0, ssize n=NPOS) const;
+  int compare (String const &s) const;
 
-  //String (String const &, int pos, int n=NPOS);
-  String (int n, char c);
+  void append (String);
+  int length () const;
+
+  String insert (ssize pos, String);
+  ssize copy (char *s, ssize n, ssize pos=0) const;
 
 protected:
   String_handle strh_;
 
   bool null_terminated ();
 
-public:
-
-  /** init to empty string. This is needed because other
-      constructors are provided.*/
-  String ();
-
-  /// String s = "abc";
-  String (char const *source);
-  String (Byte const *byte, int length_i);
-
+private:
   ///  return "new"-ed copy of contents
   Byte *get_copy_byte () const;
   char *get_copy_str0 () const;
 
   Byte const *to_bytes () const;
-  char *get_str0 ();
   Byte *get_bytes ();
 
-  String &operator = (String const &source);
-
-  /// concatenate s
-  void operator += (char const *s) { strh_ += s; }
-  void operator += (String s);
-  
-  void append (String);
   void prepend (String);
 
-  /**
-     Return a char.  UNSAFE because it may change strlen () result
-  */
-  char &operator [] (int n);
-  char operator [] (int n) const;
-
   /// return n leftmost chars
   String left_string (int n) const;
 
   /// return n rightmost chars
   String right_string (int n) const;
 
-  /// return the "esrever" of *this
-  void reverse ();
-
   /// return a piece starting at index (first char = index_i 0), length n
   String cut_string (int index_i, int n) const;
 
   /// cut out a middle piece, return remainder
   String nomid_string (int index_i, int n) const;
 
-  /// signed comparison,  analogous to memcmp;
   static int compare (String const &s1, const String &s2);
 
   /// index of rightmost character C in string
@@ -143,17 +103,11 @@ public:
 
   int index_any (String) const;
 
-  void to_upper ();
-  void to_lower ();
-
 #ifdef STREAM_SUPPORT
   /// provide Stream output
   void print_on (ostream &os) const;
 #endif
 
-  /// the length of the string
-  int length () const;
-
   /// convert to an integer
   int to_int () const;
 
@@ -164,36 +118,6 @@ public:
   String substitute (char find, char replace);
 };
 
-/*
-  better to clutter global namespace, than suffer *ugh, ugh, ugh*
-  implicit conversions.
-
-  it might be cool to have no type-checking at all in a language,
-  but once there is, having this silently circumvented is a nightmare.
-
-  whenever implicit conversions seem necessary (e.g. operator << ()),
-  use Scalar as the generic type iso String.
-*/
-
-/// for completeness (=handy)
-String to_string (String s);
-String to_string (char c, int n = 1);
-String to_string (int i, char const *format = 0);
-String to_string (double f, char const *format = 0);
-String to_string (long b);
-String to_string (bool b);
-String to_string (char const *format, ...);
-
-/*
-  technically incorrect, but lets keep it here: this is a
-  catch all place for this stuff.
-*/
-
-#include "international.hh"
-#include "compare.hh"
-
-INSTANTIATE_COMPARE (String const &, String::compare);
-
 #ifdef STRING_UTILS_INLINED
 #ifndef INLINE
 #define INLINE inline
@@ -213,4 +137,13 @@ IMPLEMENT_ARITHMETIC_OPERATOR (String, +);
 ostream &operator << (ostream &os, String d);
 #endif
 
-#endif
+}
+
+/*
+  technically incorrect, but lets keep it here: this is a
+  catch all place for this stuff.
+*/
+#include "international.hh"
+
+
+#endif /* STRING_HH */
index 5da4b573f4ea717b672491aa26c4417f33013281..5f8a39a495e1f5258ffbefe5198a5b71341365c5 100644 (file)
@@ -9,13 +9,7 @@
 #ifndef STRING_ICC
 #define STRING_ICC
 
-/// for completeness (=handy)
-INLINE
-String
-to_string (String s)
-{
-  return s;
-}
+namespace std {
 
 INLINE
 char const *
@@ -79,4 +73,6 @@ String::String (char const *source)
   strh_ = source;
 }
 
+}
+
 #endif /* STRING_ICC */
index 4aa43751970e35a90c096ed1c9e45f7da19ccc8f..6b4cd85322a1a6f68e98f09a18d2e014b595983a 100644 (file)
@@ -9,13 +9,13 @@
 #ifndef WARN_HH
 #define WARN_HH
 
-#include "string.hh"
+#include "std-string.hh"
 
-void error (String s);
-void message (String s);
-void non_fatal_error (String);
-void programming_error (String s);
-void progress_indication (String s);
-void warning (String s);
+void error (std::string s);
+void message (std::string s);
+void non_fatal_error (std::string);
+void programming_error (std::string s);
+void progress_indication (std::string s);
+void warning (std::string s);
 
 #endif /* WARN_HH */
index 9d9e824eeab7b158a43fe601e4fe818e6bf7c5bf..c50a3bad3381349dd9a418ffb50ec5dda0dd7637 100644 (file)
@@ -7,6 +7,8 @@
 */
 
 #include "config.hh"
+
+#include "international.hh"
 #include "string-convert.hh"
 
 #if !HAVE_GETTEXT
@@ -19,24 +21,24 @@ gettext (char const *s)
 #include <libintl.h>
 #endif
 
-Std_string
+std::string
 _ (char const *ch)
 {
-  return Std_string (gettext (ch));
+  return std::string (gettext (ch));
 }
 
-Std_string
+std::string
 _f (char const *format, ...)
 {
   va_list args;
   va_start (args, format);
-  Std_string str = String_convert::vform_string (gettext (format), args);
+  std::string str = String_convert::vform_string (gettext (format), args);
   va_end (args);
   return str;
 }
 
-Std_string
-_f (char const *format, Std_string s, Std_string s2, Std_string s3)
+std::string
+_f (char const *format, std::string s, std::string s2, std::string s3)
 {
   return String_convert::form_string (gettext (format), s.c_str (), s2.c_str (),
                                      s3.c_str ());
index a3dc1290196f3f3b484f64aa5164abdced36f01e..7b0c34d02e6f758dde02c6f8552f18959946cc13 100644 (file)
@@ -18,10 +18,10 @@ Interval_t<Real>::infinity ()
 }
 
 template<>
-Std_string
+std::string
 Interval_t<Real>::T_to_string (Real r)
 {
-  return ::to_string (r);
+  return std::to_string (r);
 }
 
 template<>
@@ -32,10 +32,10 @@ Interval_t<int>::infinity ()
 }
 
 template<>
-Std_string
+std::string
 Interval_t<int>::T_to_string (int i)
 {
-  return ::to_string (i);
+  return std::to_string (i);
 }
 
 template INTERVAL__INSTANTIATE (int);
index 9265f12fdaf9800bd5e24ad5647c178044ef8b30..b45809e0b9ed82322fb243a18fef7a748540f1c3 100644 (file)
 
 
 #ifndef STANDALONE
-Std_string
+std::string
 Offset::to_string () const
 {
-  Std_string s;
-  s = Std_string (" (") + ::to_string (coordinate_a_[X_AXIS]) + ", "
-    + ::to_string (coordinate_a_[Y_AXIS]) + ")";
+  std::string s;
+  s = std::string (" (") + std::to_string (coordinate_a_[X_AXIS]) + ", "
+    + std::to_string (coordinate_a_[Y_AXIS]) + ")";
   return s;
 }
 #endif
index 8ecdbccf34f39067e972c39eee8724fea3732e5d..3e8c421886493bc6a8c9076058605f29b89ce1ab 100644 (file)
@@ -269,18 +269,18 @@ Rational::operator -= (Rational r)
   return (*this += r);
 }
 
-Std_string
+std::string
 Rational::to_string () const
 {
   if (is_infinity ())
     {
-      Std_string s (sign_ > 0 ? "" : "-");
-      return Std_string (s + "infinity");
+      std::string s (sign_ > 0 ? "" : "-");
+      return std::string (s + "infinity");
     }
 
-  Std_string s = ::to_string (num ());
+  std::string s = std::to_string (num ());
   if (den () != 1 && num ())
-    s += "/" + ::to_string (den ());
+    s += "/" + std::to_string (den ());
   return s;
 }
 
index 66b94fda316a1de42aa8f21fa8511df4d2c5fd24..531e134332592b265f68c46e68cd3604f4a4bb6e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  std-tring.cc -- implement external interface for Std_String
+  std-string.cc -- implement external interface for Std_String
 
   source file of the GNU LilyPond music typesetter
 
@@ -7,32 +7,92 @@
 */
 
 #include "std-string.hh"
+#include "string-convert.hh"
 
 #if STD_STRING
-
 namespace std {
-  Std_string
-  to_std_string (char c, int n)
+#endif
+  
+  std::string
+  to_string (std::string s)
   {
-    /* FIXME, remove this function and use std::string interface for
-       String?  This interface is a bit clumsy, almost alway you want
-       n=1.  */
-    return Std_string (n, c);
+    return s;
   }
 
-#else /* !STD_STRING */
+  std::string
+  to_string (char c, int n)
+  {
+    return std::string (n, c);
+  }
 
-#endif /* STD_STRING */
+  std::string
+  to_string (double f, char const *format)
+  {
+    return String_convert::double_string (f, format);
+  }
 
-Std_string &
-replace_all (Std_string &str, Std_string find, Std_string replace)
-{
-  ssize len = find.length ();
-  for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len))
-    str = str.replace (i, len, replace);
-  return str;
-}
+  std::string
+  to_string (int i, char const *format)
+  {
+    return String_convert::int_string (i, format);
+  }
+
+  std::string
+  to_string (bool b)
+  {
+    return String_convert::bool_string (b);
+  }
+
+  std::string
+  to_string (long b)
+  {
+    return String_convert::long_string (b);
+  }
+
+  std::string
+  to_string (char const *format, ...)
+  {
+    va_list args;
+    va_start (args, format);
+    std::string str = String_convert::vform_string (format, args);
+    va_end (args);
+    return str;
+  }
+
+  std::string &
+  replace_all (std::string &str, std::string find, std::string replace)
+  {
+    ssize len = find.length ();
+    for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len))
+      str = str.replace (i, len, replace);
+    return str;
+  }
+
+  std::string &
+  replace_all (std::string &str, char find, char replace)
+  {
+    for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + 1))
+      str[i] = replace;
+    return str;
+  }
+
+  char *
+  string_copy (std::string s)
+  {
+    ssize len = s.length ();
+    char *dest = new char[len + 1];
+    //s.copy (dest, len + 1);
+    memcpy (dest, s.c_str (), len + 1);
+    return dest;
+  }
+
+  int
+  string_compare (std::string const &a, std::string const &b)
+  {
+    return a.compare (b);
+  }
 
 #if STD_STRING
 }
+
 #endif
index 5f74cc9fa6b8d87e7a12137872f2ad6be191c084..7f36355fa883c269ca936ee91cb98d4e4f7e01ff 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "string-convert.hh"
 
+#include <publib.h>
 #include <cstring>
 #include <cstdio>
 using namespace std;
@@ -27,16 +28,16 @@ using namespace std;
 */
 static const int STRING_BUFFER_LEN = 1024;
 
-Std_string
+std::string
 String_convert::bool_string (bool b)
 {
-  return Std_string (b ? "true" : "false");
+  return std::string (b ? "true" : "false");
 }
 
-Std_string
-String_convert::bin2hex (Std_string bin_string)
+std::string
+String_convert::bin2hex (std::string bin_string)
 {
-  Std_string str;
+  std::string str;
   Byte const *byte = (Byte const*)bin_string.data ();
   for (ssize i = 0; i < bin_string.length (); i++)
     {
@@ -47,13 +48,13 @@ String_convert::bin2hex (Std_string bin_string)
 }
 
 int
-String_convert::bin2int (Std_string bin_string)
+String_convert::bin2int (std::string bin_string)
 {
   return bin2unsigned (bin_string);
 }
 
 unsigned
-String_convert::bin2unsigned (Std_string bin_string)
+String_convert::bin2unsigned (std::string bin_string)
 {
   assert (bin_string.length () <= (int)sizeof (unsigned));
 
@@ -66,9 +67,9 @@ String_convert::bin2unsigned (Std_string bin_string)
   return result_u;
 }
 
-// breendet imp from Std_string
+// breendet imp from std::string
 int
-String_convert::dec2int (Std_string dec_string)
+String_convert::dec2int (std::string dec_string)
 {
   if (!dec_string.length ())
     return 0;
@@ -80,17 +81,17 @@ String_convert::dec2int (Std_string dec_string)
   return (int)l;
 }
 
-Std_string
+std::string
 String_convert::i64_string (I64 i64, char const *fmt)
 {
   char buffer[STRING_BUFFER_LEN];
   snprintf (buffer, STRING_BUFFER_LEN,
            (fmt ? fmt : "%Ld"), i64); // assume radix 10
-  return Std_string (buffer);
+  return std::string (buffer);
 }
-// breendet imp from Std_string
+// breendet imp from std::string
 double
-String_convert::dec2double (Std_string dec_string)
+String_convert::dec2double (std::string dec_string)
 {
   if (!dec_string.length ())
     return 0;
@@ -101,7 +102,7 @@ String_convert::dec2double (Std_string dec_string)
 }
 
 int
-String_convert::hex2bin (Std_string hex_string, Std_string &bin_string_r)
+String_convert::hex2bin (std::string hex_string, std::string &bin_string_r)
 {
   if (hex_string.length () % 2)
     hex_string = "0" + hex_string;
@@ -121,10 +122,10 @@ String_convert::hex2bin (Std_string hex_string, Std_string &bin_string_r)
   return 0;
 }
 
-Std_string
-String_convert::hex2bin (Std_string hex_string)
+std::string
+String_convert::hex2bin (std::string hex_string)
 {
-  Std_string str;
+  std::string str;
   //  silly, asserts should alway be "on"!
   //    assert (!hex2bin (hex_string, str) );
   int error_i = hex2bin (hex_string, str);
@@ -145,7 +146,7 @@ String_convert::hex2nibble (Byte byte)
 }
 
 // stupido.  Should use int_string ()
-Std_string
+std::string
 String_convert::int2dec (int i, int length_i, char ch)
 {
   char fill_char = ch;
@@ -153,17 +154,17 @@ String_convert::int2dec (int i, int length_i, char ch)
     fill_char = '0';
 
   // ugh
-  Std_string dec_string = to_string (i);
+  std::string dec_string = to_string (i);
 
   // ugh
   return to_string (fill_char, length_i - dec_string.length ()) + dec_string;
 }
 
 // stupido.  Should use int_string ()
-Std_string
+std::string
 String_convert::unsigned2hex (unsigned u, ssize length, char fill_char)
 {
-  Std_string str;
+  std::string str;
   if (!u)
     str = "0";
 
@@ -184,7 +185,7 @@ String_convert::unsigned2hex (unsigned u, ssize length, char fill_char)
   return str;
 }
 
-Std_string
+std::string
 String_convert::int2hex (int i, int length_i, char fill_char)
 {
   return unsigned2hex ((unsigned)i, length_i, fill_char);
@@ -204,16 +205,16 @@ String_convert::nibble2hex_byte (Byte byte)
    @param
    #fmt# is a printf style format, default assumes "%d" as format.
 */
-Std_string
+std::string
 String_convert::int_string (int i, char const *fmt)
 {
   char buffer[STRING_BUFFER_LEN];
   snprintf (buffer, STRING_BUFFER_LEN,
            (fmt ? fmt : "%d"), i); // assume radix 10
-  return Std_string (buffer);
+  return std::string (buffer);
 }
 
-Std_string
+std::string
 String_convert::form_string (char const *format, ...)
 {
   va_list args;
@@ -221,15 +222,15 @@ String_convert::form_string (char const *format, ...)
   char buffer[STRING_BUFFER_LEN];
   vsnprintf (buffer, STRING_BUFFER_LEN, format, args);
   va_end (args);
-  return Std_string (buffer);
+  return std::string (buffer);
 }
 
-Std_string
+std::string
 String_convert::vform_string (char const *format, va_list args)
 {
   char buffer[STRING_BUFFER_LEN];
   vsnprintf (buffer, STRING_BUFFER_LEN, format, args);
-  return Std_string (buffer);
+  return std::string (buffer);
 }
 
 /**
@@ -237,13 +238,13 @@ String_convert::vform_string (char const *format, va_list args)
 
    @param #fmt# is a printf style format, default assumes "%lf" as format
 */
-Std_string
+std::string
 String_convert::double_string (double f, char const *fmt)
 {
   char buf[STRING_BUFFER_LEN];
 
   snprintf (buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f);
-  return Std_string (buf);
+  return std::string (buf);
 }
 
 /**
@@ -252,33 +253,33 @@ String_convert::double_string (double f, char const *fmt)
    @param
    #n# is a repetition count, default value is 1
 */
-Std_string
+std::string
 String_convert::char_string (char c, int n)
 {
   n = n >= 0 ? n : 0;
   char *ch = new char[ n ];
   memset (ch, c, n);
 #if STD_STRING
-  Std_string s (ch, n);
+  std::string s (ch, n);
 #else
-  Std_string s ((Byte*) ch, n);
+  std::string s (ch, n);
 #endif
   delete[] ch;
   return s;
 }
 
-Std_string
+std::string
 String_convert::rational_string (Rational r)
 {
   return r.to_string ();
 }
 
-Std_string
+std::string
 String_convert::pointer_string (void const *l)
 {
   char buffer[STRING_BUFFER_LEN];
   snprintf (buffer, STRING_BUFFER_LEN, "%p", l); // assume radix 10
-  return Std_string (buffer);
+  return std::string (buffer);
 }
 
 /**
@@ -287,11 +288,11 @@ String_convert::pointer_string (void const *l)
    @param
    #n# is the number of nonzero digits
 */
-Std_string
+std::string
 String_convert::precision_string (double x, int n)
 {
-  Std_string format = "%." + to_string (max (0, n - 1)) + "e";
-  Std_string str = double_string (abs (x), format.c_str ());
+  std::string format = "%." + to_string (max (0, n - 1)) + "e";
+  std::string str = double_string (abs (x), format.c_str ());
 
   int exp = dec2int (str.substr (str.length () - 3));
   str = str.substr (0, str.length () - 4);
@@ -318,14 +319,14 @@ String_convert::precision_string (double x, int n)
   return (sign (x) > 0 ? str : "-" + str);
 }
 
-Array<Std_string>
-String_convert::split (Std_string str, char c)
+Array<std::string>
+String_convert::split (std::string str, char c)
 {
-  Array<Std_string> a;
+  Array<std::string> a;
   ssize i = str.find (c);
   while (i != NPOS)
     {
-      Std_string s = str.substr (0, i);
+      std::string s = str.substr (0, i);
       a.push (s);
       while (str[++i] == c)
        ;
@@ -337,7 +338,7 @@ String_convert::split (Std_string str, char c)
   return a;
 }
 
-Std_string
+std::string
 String_convert::long_string (long l)
 {
   char s[STRING_BUFFER_LEN];
@@ -345,8 +346,26 @@ String_convert::long_string (long l)
   return s;
 }
 
-Std_string
-String_convert::pad_to (Std_string s, int n)
+std::string
+String_convert::pad_to (std::string s, int n)
 {
-  return s + Std_string (max (int(n - s.length ()), 0), ' ');
+  return s + std::string (max (int(n - s.length ()), 0), ' ');
+}
+
+std::string
+String_convert::to_upper (std::string s)
+{
+  return strnupr ((char *)s.c_str (), s.length ());
+}
+
+std::string
+String_convert::to_lower (std::string s)
+{
+  return strnlwr ((char *)s.c_str (), s.length ());
+}
+
+std::string
+String_convert::reverse (std::string s)
+{
+  return (char*) memrev ((unsigned char *)s.data (), s.length ());
 }
index ec4bd9024387559f5909b93d4885fbce66d375f4..47cf6f11f21bbeaa932fc37315efd7c3b438bb87 100644 (file)
@@ -3,66 +3,59 @@
 
   (c) 1997--2006 Han-Wen Nienhuys & Jan Nieuwenhuizen
 */
+#if !STD_STRING
 
 #ifndef _GNU_SOURCE // we want memmem
 #define _GNU_SOURCE
 #endif
 
-#include "string.hh"
+#include "std-string.hh"
 
 #include <cstdlib>
 #include <cstdio>
 #include <cassert>
 #include <cstring>
 
-#include <iostream>
 using namespace std;
 
 #include "libc-extension.hh"
 #include "string-convert.hh"
 
-/* std::string conversion helpers */
-
-#if STD_STRING
+/* std::string interface */
 
-#include "std-string.hh"
+namespace std {
 
-String::String (Std_string const &s)
+String::String (char const *s, int n)
 {
-  *this = String (s.c_str ());
+  strh_.set ((Byte const *)s, n);
 }
 
-String::operator Std_string () const
+String::String (String const &s, int pos, ssize n)
 {
-  return Std_string (this->c_str ());
+  *this = s.substr (pos, n);
 }
 
-#endif
-
-/* std::string interface */
+String::String (int n, char c)
+{
+  *this = String_convert::char_string (c, n);
+}
 
-#if 0
-// FIXME, use .SUBSTR () ?
-String::String (String const &s, int pos, int n)
+String &
+String::operator = (String const &source)
 {
-  if (n == -1 || n == INT_MAX || n == NPOS)
-    n = s.length () - pos;
-  if (pos == 0)
-    *this = s.left_string (n);
-  else
-    *this = s.right_string (s.length () - pos).left_string (n);
+  strh_ = source.strh_;
+  return *this;
 }
-#endif
 
 String
-String::substr (int pos, int n) const
+String::substr (int pos, ssize n) const
 {
-#if 0
-  if (n == -1 || n == INT_MAX || n == NPOS)
+#if 1
+  if (n == (ssize)-1 || n == (ssize)INT_MAX || n == NPOS)
     n = length () - pos;
   return cut_string (pos, n);
 #else
-  if (n == -1 || n == INT_MAX || n == NPOS)
+  if (n == (ssize)-1 || n == (ssize)INT_MAX || n == NPOS)
     n = length () - pos;
   if (pos == 0)
     return left_string (n);
@@ -71,11 +64,37 @@ String::substr (int pos, int n) const
 #endif
 }
 
-String::String (int n, char c)
+String
+String::insert (ssize pos, String s)
 {
-  *this = String_convert::char_string (c, n);
+  *this = substr (0, pos) + s + substr (pos + 1);
+  return *this;
 }
 
+ssize
+String::copy (char *buf, ssize n, ssize pos) const
+{
+  assert (pos == 0);
+  memcpy (buf, strh_.to_bytes (), strh_.length () + 1);
+  return n; // ?
+}
+
+int
+String::compare (String const &s) const
+{
+  char const *p1 = c_str ();
+  char const *p2 = s.c_str ();
+  if (p1 == p2)
+    return 0;
+
+  /*
+    don't forget the terminating '\0'
+  */
+  int f = min (length (), s.length ());
+  int cmp_length = 1+ f;
+  int i = memcmp (p1, p2, cmp_length);
+  return i;
+}
 
 char const *
 String::data () const
@@ -90,18 +109,28 @@ String::empty () const
 }
 
 int
-String::find (char c) const
+String::find (char c, int pos) const
 {
-  return index (c);
+  String f = right_string (length () - pos);
+  ssize n = f.index (c);
+  if (n != NPOS)
+    return pos + n;
+  return NPOS;
+}
+
+int
+String::find (char const *c, int pos) const
+{
+  return find (String (c), pos);
 }
 
 int
-String::find (String &s, int pos) const
+String::find (String s, int pos) const
 {
   if (!pos)
     return index (s);
   String f = right_string (length () - pos);
-  int n = f.index (s);
+  ssize n = f.index (s);
   if (n != NPOS)
     return pos + n;
   return NPOS;
@@ -119,10 +148,35 @@ String::replace (int pos, int n, String str)
   return this->substr (0, pos) + str + this->substr (pos + n);
 }
 
+void
+String::append (String s)
+{
+  strh_.append (s.to_bytes (), s.length ());
+}
+
+void
+String::operator += (String s)
+{
+  append (s);
+}
+
+int
+String::length () const
+{
+  return strh_.length ();
+}
+
+
 
 
 /* String */
 
+int
+String::compare (String const &s1, String const &s2)
+{
+  return s1.compare (s2);
+}
+
 #ifdef STRING_DEBUG
 void *mymemmove (void *dest, void const *src, size_t n);
 #define memmove mymemmove
@@ -145,76 +199,8 @@ String::get_copy_str0 () const
 }
 
 \f
-/*
-  copying, constructing.
-*/
-String &
-String::operator = (String const &source)
-{
-  strh_ = source.strh_;
-  return *this;
-}
-
-String::String (Byte const *byte, int len_i)
-{
-  strh_.set (byte, len_i);
-}
-
-/**
-   @see
-   String_convert::
-*/
-String
-to_string (char c, int n)
-{
-  return String_convert::char_string (c, n);
-}
-
-String
-to_string (double f, char const *format)
-{
-  return String_convert::double_string (f, format);
-}
-
-String
-to_string (int i, char const *format)
-{
-  return String_convert::int_string (i, format);
-}
-
-String
-to_string (bool b)
-{
-  return String_convert::bool_string (b);
-}
-String
-to_string (long b)
-{
-  return String_convert::long_string (b);
-}
-
-String
-to_string (char const *format, ...)
-{
-  va_list args;
-  va_start (args, format);
-  String str = String_convert::vform_string (format, args);
-  va_end (args);
-  return str;
-}
-
-\f
-void
-String::append (String s)
-{
-  strh_.append (s.to_bytes (), s.length ());
-}
-void
-String::operator += (String s)
-{
-  append (s);
-}
 
+#if 0
 void
 String::prepend (String s)
 {
@@ -222,11 +208,8 @@ String::prepend (String s)
   *this = s;
 }
 
-int
-String::length () const
-{
-  return strh_.length ();
-}
+#endif
+
 
 Byte const *
 String::to_bytes () const
@@ -240,32 +223,6 @@ String::get_bytes ()
   return strh_.get_bytes ();
 }
 
-char *
-String::get_str0 ()
-{
-  return strh_.get_str0 ();
-}
-
-/**
-   Do a signed comparison,  analogous to memcmp;
-*/
-int
-String::compare (String const &s1, String const &s2)
-{
-  Byte const *p1 = s1.to_bytes ();
-  Byte const *p2 = s2.to_bytes ();
-  if (p1 == p2)
-    return 0;
-
-  /*
-    don't forget the terminating '\0'
-  */
-  int f = min (s1.length (), s2.length ());
-  int cmp_length = 1+ f;
-  int i = memcmp (p1, p2, cmp_length);
-  return i;
-}
-
 \f
 int
 String::index_last (char const c) const
@@ -367,7 +324,7 @@ String::right_string (int n) const
   if (n < 1)
     return "";
 
-  return String (strh_.to_bytes () + length () - n, n);
+  return String (strh_.c_str () + length () - n, n);
 }
 
 String
@@ -399,28 +356,10 @@ String::cut_string (int index_i, int n) const
   if ((n > length ()) || (index_i + n > length ()))
     n = length () - index_i;
 
-  return String (to_bytes () + index_i, n);
+  return String (c_str () + index_i, n);
 }
 \f
 
-void
-String::to_upper ()
-{
-  strnupr (get_str0 (), length ());
-}
-
-void
-String::to_lower ()
-{
-  strnlwr (get_str0 (), length ());
-}
-
-void
-String::reverse ()
-{
-  memrev (get_bytes (), length ());
-}
-
 int
 String::to_int () const
 {
@@ -434,6 +373,8 @@ String::to_double () const
 }
 
 #ifdef STREAM_SUPPORT
+#include <iostream>
+
 ostream &
 operator << (ostream &os, String d)
 {
@@ -457,7 +398,7 @@ String::substitute (String find, String replace)
 {
   int n = find.length ();
   int m = replace.length ();
-  for (int i = index (find), j = 0; i != NPOS;
+  for (ssize i = index (find), j = 0; i != NPOS;
        i = right_string (length () - j).index (find))
     {
       *this = left_string (i + j)
@@ -471,7 +412,11 @@ String::substitute (String find, String replace)
 String
 String::substitute (char find, char replace)
 {
-  for (int i = index (find); i != NPOS; i = index (find))
+  for (ssize i = index (find); i != NPOS; i = index (find))
     (*this)[i] = replace;
   return *this;
 }
+
+}
+
+#endif /* !STD_STRING */
index f586031f8ecf5c990062c90b9451d6365bb2f639..013413619232d2bafe6f25c06ad46e2dd2b1b72b 100644 (file)
@@ -8,6 +8,9 @@
 
   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl> */
 
+#if !STD_STRING
+
+
 #ifdef STRING_DEBUG
 #define memmove mymemmove
 #endif
 
 #define INLINE
 
+#include <algorithm>
+
 #include "string-data.hh"
-#include "string.hh"
+#include "string-handle.hh"
+
+#include "std-string.hh"
 
 #include "string-data.icc"
 #include "string-handle.icc"
@@ -40,3 +47,5 @@ mymemmove (void *dest, void const *src, size_t n)
   return memcpy (dest, src, n);
 }
 #endif
+
+#endif /* !STD_STRING */
index c911526c97c5e012c770617796ca6995056413c5..1dcf35773682f6785a4e767220eba67cad8aa70d 100644 (file)
@@ -10,6 +10,9 @@
 
 #include <cstdlib>
 #include <cstdio>
+
+#include "international.hh"
+
 using namespace std;
 
 /* Is progress indication at NEWLINE?  */
@@ -17,7 +20,7 @@ static bool progress_newline = true;
 
 /* Display user information that is not a full message.  */
 void
-progress_indication (String s)
+progress_indication (std::string s)
 {
   /* Test if all silly progress_indication ("\n") can be dropped now.  */
   if (s == "\n")
@@ -31,7 +34,7 @@ progress_indication (String s)
 
 /* Display a single user message.  Always starts on a new line.  */
 void
-message (String s)
+message (std::string s)
 {
   if (!progress_newline)
     fputc ('\n', stderr);
@@ -40,27 +43,27 @@ message (String s)
 
 /* Display a warning message.  Always starts on a new line.  */
 void
-warning (String s)
+warning (std::string s)
 {
   message (_f ("warning: %s", s.c_str ()) + "\n");
 }
 
 void
-non_fatal_error (String s)
+non_fatal_error (std::string s)
 {
   message (_f ("error: %s", s.c_str ()) + "\n");
 }
 
 /* Display an error message.  Always starts on a new line.  */
 void
-error (String s)
+error (std::string s)
 {
   non_fatal_error (s);
   exit (1);
 }
 
 void
-programming_error (String s)
+programming_error (std::string s)
 {
   message (_f ("programming error: %s", s) + "\n");
   message (_ ("continuing, cross fingers") + "\n");
index 62329c6dc08fb87efdf8b12d30aa9e340d9c80ad..7d97b65d269598fb29b51e91616ef9472516c4ef 100644 (file)
 #include "arpeggio.hh"
 #include "context.hh"
 #include "engraver.hh"
+#include "international.hh"
+#include "music.hh"
+#include "pitch.hh"
 #include "protected-scm.hh"
 #include "rhythmic-head.hh"
 #include "side-position-interface.hh"
 #include "tie.hh"
 #include "warn.hh"
-#include "music.hh"
-#include "pitch.hh"
 
 #include "translator.icc"
 
@@ -531,7 +532,7 @@ Accidental_engraver::acknowledge_rhythmic_head (Grob_info info)
       && note->is_mus_type ("note-event"))
     {
       /*
-       String harmonics usually don't have accidentals.
+       std::string harmonics usually don't have accidentals.
       */
       if (to_boolean (get_property ("harmonicAccidentals"))
          || !ly_is_equal (info.grob ()->get_property ("style"),
index edea40f95e550d00319cfa216fba39a10b0ea79c..94f92f3a72fe55860a37224e500b7ac0fae4557c 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "accidental-interface.hh"
 #include "font-interface.hh"
+#include "international.hh"
 #include "item.hh"
 #include "output-def.hh"
 #include "pitch.hh"
@@ -141,8 +142,8 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common)
 /*
   todo: this sort of stuff in Scheme. --hwn.
 */
-String
-Accidental_interface::get_fontcharname (String style, int alteration)
+std::string
+Accidental_interface::get_fontcharname (std::string style, int alteration)
 {
   if (alteration == DOUBLE_FLAT
       || alteration == DOUBLE_SHARP)
@@ -201,7 +202,7 @@ Accidental_interface::print (SCM smob)
     }
 
   SCM scm_style = me->get_property ("style");
-  String style;
+  std::string style;
   if (scm_is_symbol (scm_style))
     style = ly_symbol2string (scm_style);
   else
@@ -231,7 +232,7 @@ Accidental_interface::print (SCM smob)
        scm_is_pair (s); s = scm_cdr (s))
     {
       int alteration = scm_to_int (scm_car (s));
-      String font_char = get_fontcharname (style, alteration);
+      std::string font_char = get_fontcharname (style, alteration);
       Stencil acc (fm->find_by_name ("accidentals." + font_char));
 
       if (acc.is_empty ())
index 9dc7691c6a9fdfa363eb7a6408d9032d37cfb9d9..576a9d86f11b7ed3239895d75bd6f7d8cfff335c 100644 (file)
@@ -8,16 +8,17 @@
 
 #include "all-font-metrics.hh"
 
-#include "open-type-font.hh"
+#include "international.hh"
 #include "main.hh"
-#include "warn.hh"
-#include "tfm.hh"
-#include "scm-hash.hh"
+#include "open-type-font.hh"
 #include "pango-font.hh"
+#include "scm-hash.hh"
+#include "tfm.hh"
+#include "warn.hh"
 
 static char const *default_font_str0_ = "cmr10";
 
-All_font_metrics::All_font_metrics (String path)
+All_font_metrics::All_font_metrics (std::string path)
 {
   tfm_dict_ = new Scheme_hash_table;
   otf_dict_ = new Scheme_hash_table;
@@ -73,7 +74,7 @@ All_font_metrics::find_pango_font (PangoFontDescription *description,
   if (!pango_dict_->try_retrieve (key, &val))
     {
       if (be_verbose_global)
-       progress_indication ("[" + String (pango_fn));
+       progress_indication ("[" + std::string (pango_fn));
 
       Pango_font *pf = new Pango_font (pango_ft2_fontmap_,
                                       description,
@@ -96,11 +97,11 @@ All_font_metrics::find_pango_font (PangoFontDescription *description,
 
 #endif
 
-String
-kpathsea_find_file (String name, String ext)
+std::string
+kpathsea_find_file (std::string name, std::string ext)
 {
   name += "." + ext;
-  String path = global_path.find (name);
+  std::string path = global_path.find (name);
   if (path.length () > 0)
     return path;
 
@@ -123,14 +124,14 @@ kpathsea_find_file (String name, String ext)
 }
 
 Open_type_font *
-All_font_metrics::find_otf (String name)
+All_font_metrics::find_otf (std::string name)
 {
   SCM sname = ly_symbol2scm (name.c_str ());
   SCM name_string = scm_makfrom0str (name.c_str ());
   SCM val;
   if (!otf_dict_->try_retrieve (sname, &val))
     {
-      String file_name;
+      std::string file_name;
 
       if (file_name.empty ())
        file_name = search_path_.find (name + ".otf");
@@ -156,20 +157,20 @@ All_font_metrics::find_otf (String name)
 }
 
 Tex_font_metric *
-All_font_metrics::find_tfm (String name)
+All_font_metrics::find_tfm (std::string name)
 {
   SCM sname = ly_symbol2scm (name.c_str ());
   SCM name_string = scm_makfrom0str (name.c_str ());
   SCM val;
   if (!tfm_dict_->try_retrieve (sname, &val))
     {
-      String file_name;
+      std::string file_name;
 
       if (file_name.empty ())
        {
          /* FIXME: should add "cork-" prefix to lm* fonts.  How to do
             that, cleanly?  */
-         String p = kpathsea_find_file (name, "tfm");
+         std::string p = kpathsea_find_file (name, "tfm");
          if (p.length ())
            file_name = p;
        }
@@ -198,7 +199,7 @@ All_font_metrics::find_tfm (String name)
 }
 
 Font_metric *
-All_font_metrics::find_font (String name)
+All_font_metrics::find_font (std::string name)
 {
   Font_metric *f = find_otf (name);
 
@@ -213,7 +214,7 @@ All_font_metrics::find_font (String name)
       warning (_ ("loading default font"));
     }
 
-  String def_name = default_font_str0_;
+  std::string def_name = default_font_str0_;
 
   if (!f)
     f = find_tfm (def_name);
index 2714c5c77d7b402f47011640d9e91c9c6b6d93a3..0f6e6daff8b8a8d7aae140e700054e886a9b1c58 100644 (file)
@@ -6,10 +6,11 @@
   (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "simple-music-iterator.hh"
 #include "context.hh"
-#include "music.hh"
 #include "input.hh"
+#include "international.hh"
+#include "music.hh"
+#include "simple-music-iterator.hh"
 
 /**
    Iterate a property.
index aedf9785dbf868709c74bee988c1ed0f6c02c7b0..b5edac5fbb68028a66dde6cea02c83ae87756c65 100644 (file)
@@ -11,7 +11,7 @@
 #include "midi-item.hh"
 #include "audio-column.hh"
 
-Audio_instrument::Audio_instrument (String instrument_string)
+Audio_instrument::Audio_instrument (std::string instrument_string)
 {
   str_ = instrument_string;
 }
@@ -62,7 +62,7 @@ Audio_time_signature::Audio_time_signature (int beats, int one_beat)
   one_beat_ = one_beat;
 }
 
-Audio_text::Audio_text (Audio_text::Type type, String text_string)
+Audio_text::Audio_text (Audio_text::Type type, std::string text_string)
 {
   text_string_ = text_string;
   type_ = type;
index 3f65471843a699db85e8376219e08c8482a1c7af..31d75f0f1c4262b8c650589737a5088378c20a5a 100644 (file)
@@ -7,8 +7,9 @@
 */
 
 #include "context.hh"
-#include "music-wrapper-iterator.hh"
 #include "direction.hh"
+#include "international.hh"
+#include "music-wrapper-iterator.hh"
 
 class Auto_change_iterator : public Music_wrapper_iterator
 {
@@ -25,7 +26,7 @@ protected:
 private:
   SCM split_list_;
   Direction where_dir_;
-  void change_to (Music_iterator *, SCM, String);
+  void change_to (Music_iterator *, SCM, std::string);
   Moment start_moment_;
 
   Context_handle up_;
@@ -34,7 +35,7 @@ private:
 
 void
 Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
-                                String to_id)
+                                std::string to_id)
 {
   Context *current = it->get_outlet ();
   Context *last = 0;
@@ -57,7 +58,7 @@ Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
 
   if (current && current->id_string () == to_id)
     {
-      String msg;
+      std::string msg;
       msg += _f ("can't change, already in translator: %s", to_id);
     }
 
@@ -100,7 +101,7 @@ Auto_change_iterator::process (Moment m)
       if (d && d != where_dir_)
        {
          where_dir_ = d;
-         String to_id = (d >= 0) ? "up" : "down";
+         std::string to_id = (d >= 0) ? "up" : "down";
          change_to (child_iter_,
                     ly_symbol2scm ("Staff"),
                     to_id);
index 87fcd2817d5db6f9a1bb16442f192e09120411d4..b20abef88f15c6c513b3f898023330a167346db8 100644 (file)
@@ -8,10 +8,11 @@
 
 #include "axis-group-engraver.hh"
 
-#include "spanner.hh"
 #include "axis-group-interface.hh"
-#include "warn.hh"
 #include "context.hh"
+#include "international.hh"
+#include "spanner.hh"
+#include "warn.hh"
 
 #include "translator.icc"
 
index f08a9e43dba6370e25440759e8fa841a0b5f8968..9f9f20fee0587b335ab88ff0dc540f6d912943da 100644 (file)
@@ -6,10 +6,11 @@
   (c) 2001--2006  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "simple-music-iterator.hh"
-#include "music.hh"
 #include "context.hh"
 #include "input.hh"
+#include "international.hh"
+#include "music.hh"
+#include "simple-music-iterator.hh"
 
 /*
   Check bar checks. We do this outside the engravers so that you can
index bed12337d8b078f37e4dd48f246fa491b2244626..85c98ead9c961ae532a73377b2e942efd96f3c0f 100644 (file)
@@ -21,7 +21,7 @@ class Bar_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Bar_engraver);
-  void request_bar (String type_string);
+  void request_bar (std::string type_string);
 
 protected:
   virtual void finalize ();
index ec91336621a1d67f36271175fa778f1fb8397d9b..5a30a2c9a5d83ae4d9f8c8b93f9f610eb36f0835 100644 (file)
@@ -26,7 +26,7 @@ Bar_line::print (SCM smob)
   
   if (scm_is_string (s) && scm_is_number (barsize))
     {
-      String str = ly_scm2string (s);
+      std::string str = ly_scm2string (s);
       Real sz = robust_scm2double (barsize, 0);
       if (sz <= 0)
        return SCM_EOL;
@@ -37,7 +37,7 @@ Bar_line::print (SCM smob)
 }
 
 Stencil
-Bar_line::compound_barline (Grob *me, String str, Real h,
+Bar_line::compound_barline (Grob *me, std::string str, Real h,
                            bool rounded)
 {
   Real kern = robust_scm2double (me->get_property ("kern"), 1);
index 39ee8c6f3db538ef6e386fef25e697a68a49e516..e8a77ec1ffb8514ba77c149dcf5700fe1bed943d 100644 (file)
@@ -6,18 +6,19 @@
   (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "engraver.hh"
 #include "beam.hh"
-#include "stem.hh"
-#include "warn.hh"
 #include "beaming.hh"
-#include "score-engraver.hh"
-#include "rest.hh"
+#include "context.hh"
 #include "drul-array.hh"
+#include "duration.hh"
+#include "engraver.hh"
+#include "international.hh"
 #include "item.hh"
+#include "rest.hh"
+#include "score-engraver.hh"
 #include "spanner.hh"
-#include "context.hh"
-#include "duration.hh"
+#include "stem.hh"
+#include "warn.hh"
 
 #include "translator.icc"
 
@@ -242,7 +243,7 @@ Beam_engraver::acknowledge_stem (Grob_info info)
   Music *m = info.ultimate_music_cause ();
   if (!m->is_mus_type ("rhythmic-event"))
     {
-      String s = _ ("stem must have Rhythmic structure");
+      std::string s = _ ("stem must have Rhythmic structure");
       if (info.music_cause ())
        info.music_cause ()->origin ()->warning (s);
       else
index 6ce2b7736ae9cc23affef172efb6fd93a24cc32c..c982c6d812f65dd9a881caa67dd0218172c893d6 100644 (file)
 #include <algorithm>
 using namespace std;
 
-#include "warn.hh"
-#include "staff-symbol-referencer.hh"
-#include "stem.hh"
+#include "align-interface.hh"
+#include "international.hh"
 #include "output-def.hh"
 #include "pointer-group-interface.hh"
-#include "align-interface.hh"
+#include "staff-symbol-referencer.hh"
+#include "stem.hh"
+#include "warn.hh"
 
 Real
 get_detail (SCM alist, SCM sym, Real def)
@@ -61,7 +62,7 @@ struct Quant_score
   Real demerits;
 
 #if DEBUG_QUANTING
-  String score_card_;
+  std::string score_card_;
 #endif
 };
 
index cab9d8fdfc2a8cd34322864d529f2ba5ce35c5b3..5861dba32115cb4fa7aa7a3cd581a67ec15acd45 100644 (file)
 */
 
 #include "beam.hh"
-#include "interval-set.hh"
-#include "directional-element-interface.hh"
+
 #include "beaming.hh"
-#include "misc.hh"
+#include "directional-element-interface.hh"
+#include "international.hh"
+#include "interval-set.hh"
+#include "item.hh"
 #include "least-squares.hh"
-#include "stem.hh"
-#include "output-def.hh"
 #include "lookup.hh"
+#include "misc.hh"
+#include "output-def.hh"
 #include "pointer-group-interface.hh"
-#include "staff-symbol-referencer.hh"
-#include "item.hh"
 #include "spanner.hh"
+#include "staff-symbol-referencer.hh"
+#include "stem.hh"
 #include "warn.hh"
 
 #if DEBUG_QUANTING
@@ -498,7 +500,7 @@ Beam::print (SCM grob)
        should be switchable for those who want to twiddle with the
        parameters.
       */
-      String str;
+      std::string str;
       SCM properties = Font_interface::text_font_alist_chain (me);
 
       Direction stem_dir = stems.size () ? to_dir (stems[0]->get_property ("direction")) : UP;
index 270d8191641e015238f4cc8ca7d9159358e9c5a1..818d5a4f2b066723443cfc38054ef9a84b7e5181 100644 (file)
@@ -12,7 +12,7 @@ using namespace std;
 #include "binary-source-file.hh"
 #include "string-convert.hh"
 
-Binary_source_file::Binary_source_file (String &file_name_string)
+Binary_source_file::Binary_source_file (std::string &file_name_string)
   : Source_file (file_name_string)
 {
 }
@@ -21,7 +21,7 @@ Binary_source_file::~Binary_source_file ()
 {
 }
 
-String
+std::string
 Binary_source_file::quote_input (char const *pos_str0) const
 {
   assert (this);
@@ -31,18 +31,18 @@ Binary_source_file::quote_input (char const *pos_str0) const
   char const *begin_str0 = max (pos_str0 - 8, c_str ());
   char const *end_str0 = min (pos_str0 + 7, c_str () + length ());
 
-  String pre_string ((Byte const *)begin_str0, pos_str0 - begin_str0);
+  std::string pre_string (begin_str0, pos_str0 - begin_str0);
   pre_string = String_convert::bin2hex (pre_string);
-  for (int i = 2; i < pre_string.length (); i += 3)
-    pre_string = pre_string.left_string (i)
-      + " " + pre_string.cut_string (i, INT_MAX);
-  String post_string ((Byte const *)pos_str0, end_str0 - pos_str0);
+  for (ssize i = 2; i < pre_string.length (); i += 3)
+    pre_string = pre_string.substr (0, i)
+      + " " + pre_string.substr (i, NPOS);
+  std::string post_string (pos_str0, end_str0 - pos_str0);
   post_string = String_convert::bin2hex (post_string);
-  for (int i = 2; i < post_string.length (); i += 3)
-    post_string = post_string.left_string (i)
-      + " " + post_string.cut_string (i, INT_MAX);
+  for (ssize i = 2; i < post_string.length (); i += 3)
+    post_string = post_string.substr (0, i)
+      + " " + post_string.substr (i, NPOS);
 
-  String str = pre_string
+  std::string str = pre_string
     + to_string ('\n')
     + to_string (' ', pre_string.length () + 1)
     + post_string;
index e68453a34c2b16c4790554b31cffe7da6ade8e98..233bb33e45ecb1951a184d0a1906a15a6230a1bf 100644 (file)
@@ -9,15 +9,16 @@
 
 #include "break-align-interface.hh"
 
-#include "pointer-group-interface.hh"
-#include "self-alignment-interface.hh"
-#include "side-position-interface.hh"
+#include "align-interface.hh"
 #include "axis-group-interface.hh"
-#include "warn.hh"
 #include "dimensions.hh"
+#include "international.hh"
 #include "output-def.hh"
 #include "paper-column.hh"
-#include "align-interface.hh"
+#include "pointer-group-interface.hh"
+#include "self-alignment-interface.hh"
+#include "side-position-interface.hh"
+#include "warn.hh"
 
 
 MAKE_SCHEME_CALLBACK (Break_align_interface, self_align_callback, 1);
@@ -182,11 +183,11 @@ Break_align_interface::calc_positioning_done (SCM smob)
       bool entry_found = scm_is_pair (entry);
       if (!entry_found)
        {
-         String sym_string;
+         std::string sym_string;
          if (scm_is_symbol (rsym))
            sym_string = ly_symbol2string (rsym);
 
-         String orig_string;
+         std::string orig_string;
          if (unsmob_grob (l->get_property ("cause")))
            orig_string = unsmob_grob (l->get_property ("cause"))->name ();
 
index 5735d4915d39539963362bda8ef621e72a2d384e..ff13c3d204ee516370f86d7a0f4b3b079ad1b988 100644 (file)
@@ -9,23 +9,24 @@
 #include "change-iterator.hh"
 
 #include "context.hh"
+#include "input.hh"
+#include "international.hh"
 #include "music.hh"
 #include "warn.hh"
-#include "input.hh"
 
 void
-Change_iterator::error (String reason)
+Change_iterator::error (std::string reason)
 {
-  String to_type = ly_symbol2string (get_music ()->get_property ("change-to-type"));
-  String to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
+  std::string to_type = ly_symbol2string (get_music ()->get_property ("change-to-type"));
+  std::string to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
 
-  String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id)
+  std::string warn1 = _f ("can't change `%s' to `%s'", to_type, to_id)
     + ": " + reason;
 
   /*
     GUHG!
   */
-  String warn2= "Change_iterator::process (): "
+  std::string warn2= "Change_iterator::process (): "
     + get_outlet ()->context_name () + " = `"
     + get_outlet ()->id_string () + "': ";
   warning (warn2);
@@ -42,7 +43,7 @@ Change_iterator::process (Moment m)
   Context *last = 0;
 
   SCM to_type = get_music ()->get_property ("change-to-type");
-  String to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
+  std::string to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
 
   /* find the type  of translator that we're changing.
 
@@ -56,7 +57,7 @@ Change_iterator::process (Moment m)
 
   if (current && current->id_string () == to_id)
     {
-      String msg;
+      std::string msg;
       msg += _f ("can't change, already in translator: %s", to_id);
     }
 
index aac261420d49e5f1c91d30d9b78f082152c4cb4d..d28af332f6e892053a42a17c223da2380e9255c9 100644 (file)
@@ -6,18 +6,20 @@
   (c) 2000--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
+#include "math.h" // ceil
+
 #include "beam.hh"
-#include "repeated-music.hh"
-#include "stem.hh"
-#include "rhythmic-head.hh"
+#include "chord-tremolo-iterator.hh"
 #include "engraver-group.hh"
-#include "warn.hh"
+#include "international.hh"
+#include "item.hh"
 #include "misc.hh"
+#include "repeated-music.hh"
+#include "rhythmic-head.hh"
 #include "spanner.hh"
-#include "item.hh"
-#include "chord-tremolo-iterator.hh"
 #include "stem-tremolo.hh"
-#include "math.h" // ceil
+#include "stem.hh"
+#include "warn.hh"
 
 #include "translator.icc"
 
@@ -157,7 +159,7 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info)
        Beam::add_stem (beam_, s);
       else
        {
-         String s = _ ("stem must have Rhythmic structure");
+         std::string s = _ ("stem must have Rhythmic structure");
          if (info.music_cause ())
            info.music_cause ()->origin ()->warning (s);
          else
index 1ed8508ca51d724614d32e98809b2026323f8169..b6f1c4f69a63ca8b6447f7864b9d2bc892e208b9 100644 (file)
@@ -9,6 +9,7 @@
 #include "chord-tremolo-iterator.hh"
 
 #include "input.hh"
+#include "international.hh"
 #include "repeated-music.hh"
 
 void
index 04a5537a22f2464500f92ce2ffc35753933df592..59d9375c007829534bb90f98869fc396708ef2cf 100644 (file)
@@ -8,10 +8,11 @@
 
 #include "clef.hh"
 
-#include "string.hh"
-#include "stencil.hh"
-#include "item.hh"
 #include "font-interface.hh"
+#include "international.hh"
+#include "item.hh"
+#include "std-string.hh"
+#include "stencil.hh"
 
 MAKE_SCHEME_CALLBACK (Clef, calc_glyph_name, 1);
 SCM
@@ -22,7 +23,7 @@ Clef::calc_glyph_name (SCM smob)
 
   if (scm_is_string (glyph))
     {
-      String str = ly_scm2string (glyph);
+      std::string str = ly_scm2string (glyph);
 
       if (to_boolean (s->get_property ("non-default"))
          && s->break_status_dir () != RIGHT
@@ -47,7 +48,7 @@ Clef::print (SCM smob)
   if (!scm_is_string (glyph_scm))
     return SCM_EOL;
 
-  String glyph = String (ly_scm2string (glyph_scm));
+  std::string glyph = std::string (ly_scm2string (glyph_scm));
   Font_metric *fm = Font_interface::get_default_font (me);
   Stencil out = fm->find_by_name (glyph);
   if (out.is_empty ())
index 7f4001007bfecbb29707c2367a9a51c9d6a12c64..a81df96cc4d1dad9d861b75ba89cafcb0e13a5ff 100644 (file)
 #include <cstdio>
 using namespace std;
 
-#include "spanner.hh"
+#include "international.hh"
 #include "item.hh"
-#include "pitch.hh"
-#include "staff-symbol-referencer.hh"
 #include "lookup.hh"
 #include "output-def.hh"
-#include "warn.hh"
+#include "pitch.hh"
 #include "pointer-group-interface.hh"
+#include "spanner.hh"
+#include "staff-symbol-referencer.hh"
+#include "warn.hh"
 
 /*
   TODO: Add support for cubic spline segments.
@@ -37,7 +38,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
   Offset hvpadding = 0.5 * hpadding + vpadding;
 
   SCM shape_scm = me->get_property ("style");
-  String shape;
+  std::string shape;
 
   if (scm_is_symbol (shape_scm))
     shape = ly_symbol2string (shape_scm);
@@ -52,7 +53,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
   Array<Offset> points;
   points.clear ();
   int size = bottom_points.size ();
-  if (String::compare (shape, "leftsided-stairs") == 0)
+  if (shape == "leftsided-stairs")
     {
       for (int i = 0; i < size - 1; i++)
        {
@@ -63,7 +64,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
          out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
        }
     }
-  else if (String::compare (shape, "rightsided-stairs") == 0)
+  else if (shape == "rightsided-stairs")
     {
       for (int i = 0; i < size - 1; i++)
        {
@@ -74,7 +75,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
          out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
        }
     }
-  else if (String::compare (shape, "centered-stairs") == 0)
+  else if (shape == "centered-stairs")
     {
       Real left_xmid = bottom_points[0][X_AXIS];
       for (int i = 0; i < size - 1; i++)
@@ -97,7 +98,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
                     + hvpadding);
       out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
     }
-  else if (String::compare (shape, "ramp") == 0)
+  else if (shape == "ramp")
     {
       points.push (bottom_points[0] - vpadding + hpadding);
       for (int i = 1; i < size - 1; i++)
index e01c6ec1fea1f653bc0ad72f72b3b2a5e8ea7034..8ab2e16f2d15a37b3eb9b88a0a8714edd1af524f 100644 (file)
@@ -116,8 +116,8 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column)
       return;
     }
 
-  String name = parent->name ();
-  if (!String::compare (name, "PaperColumn"))
+  std::string name = parent->name ();
+  if (name != "PaperColumn")
     {
       // Change column not only for targeted item (NoteColumn), but
       // also for all associated grobs (NoteSpacing, SeparationItem).
index 6f91d8292a58a0189e0be3dd9b57fc69bf3b61e7..ee4220469aa7f42369a7b1ec957a48d2e8a1c69d 100644 (file)
 
 #include "context-def.hh"
 
+#include "engraver-group.hh"
 #include "engraver.hh"
+#include "international.hh"
 #include "output-def.hh"
+#include "performer-group.hh"
 #include "performer.hh"
 #include "score-context.hh"
 #include "translator-group.hh"
 #include "warn.hh"
 
-#include "engraver-group.hh"
-#include "performer-group.hh"
-
 Context_def::Context_def ()
 {
   context_aliases_ = SCM_EOL;
index 396cd8246ae73a805b22b440f2cf61f5521f3d95..502fc92f11a3c3ef8902999eb7ad9022744c3825 100644 (file)
@@ -9,12 +9,13 @@
 
 #include "context.hh"
 #include "engraver.hh"
+#include "international.hh"
 #include "item.hh"
 #include "main.hh"
-#include "spanner.hh"
-#include "warn.hh"
 #include "paper-column.hh"
 #include "simple-closure.hh"
+#include "spanner.hh"
+#include "warn.hh"
 
 SCM
 lookup_nested_property (SCM alist,
index 06fa347912fe7da4a86f2444b5a5517fc6a8e467..323dd7ca502a71fd560e30b7138ec4df63350163 100644 (file)
@@ -22,7 +22,7 @@ Context_specced_music_iterator::construct_children ()
 {
   SCM ct = get_music ()->get_property ("context-type");
 
-  String c_id;
+  std::string c_id;
   SCM ci = get_music ()->get_property ("context-id");
   if (scm_is_string (ci))
     c_id = ly_scm2string (ci);
index e2d597b15ac699b0e6076050ef2e8ef103019277..cc4536279e1c25557ea44d85adfe2644c4b1d5db 100644 (file)
@@ -8,17 +8,18 @@
 
 #include "context.hh"
 
-#include "program-option.hh"
 #include "context-def.hh"
+#include "international.hh"
+#include "lilypond-key.hh"
 #include "ly-smobs.icc"
 #include "main.hh"
 #include "output-def.hh"
+#include "profile.hh"
+#include "program-option.hh"
 #include "scm-hash.hh"
 #include "score-context.hh"
 #include "translator-group.hh"
 #include "warn.hh"
-#include "lilypond-key.hh"
-#include "profile.hh"
 
 bool
 Context::is_removable () const
@@ -160,7 +161,7 @@ Context::create_unique_context (SCM n, SCM operations)
 }
 
 Context *
-Context::find_create_context (SCM n, String id, SCM operations)
+Context::find_create_context (SCM n, std::string id, SCM operations)
 {
   /*
     Don't create multiple score contexts.
@@ -193,7 +194,7 @@ Context::find_create_context (SCM n, String id, SCM operations)
        {
          SCM ops = (i == path.size () -1) ? operations : SCM_EOL;
 
-         String this_id = "";
+         std::string this_id = "";
          if (i == path.size () -1)
            this_id = id;
 
@@ -223,10 +224,10 @@ Context::find_create_context (SCM n, String id, SCM operations)
 
 Context *
 Context::create_context (Context_def *cdef,
-                        String id,
+                        std::string id,
                         SCM ops)
 {
-  String type = ly_symbol2string (cdef->get_context_name ());
+  std::string type = ly_symbol2string (cdef->get_context_name ());
   Object_key const *key = get_context_key (type, id);
   Context *new_context
     = cdef->instantiate (ops, key);
@@ -239,12 +240,12 @@ Context::create_context (Context_def *cdef,
 }
 
 Object_key const *
-Context::get_context_key (String type, String id)
+Context::get_context_key (std::string type, std::string id)
 {
   if (!use_object_keys)
     return 0;
 
-  String now_key = type + "@" + id;
+  std::string now_key = type + "@" + id;
 
   int disambiguation_count = 0;
   if (context_counts_.find (now_key) != context_counts_.end ())
@@ -259,7 +260,7 @@ Context::get_context_key (String type, String id)
 }
 
 Object_key const *
-Context::get_grob_key (String name)
+Context::get_grob_key (std::string name)
 {
   if (!use_object_keys)
     return 0;
@@ -272,7 +273,7 @@ Context::get_grob_key (String name)
   unique identifier for each (book,score) tuple.
 */
 Object_key const *
-Context::create_grob_key (String name)
+Context::create_grob_key (std::string name)
 {
   int disambiguation_count = 0;
   if (grob_counts_.find (name) != grob_counts_.end ())
@@ -313,7 +314,7 @@ Context::get_default_interpreter ()
       SCM nm = default_child_context_name ();
       SCM st = find_context_def (get_output_def (), nm);
 
-      String name = ly_symbol2string (nm);
+      std::string name = ly_symbol2string (nm);
       Context_def *t = unsmob_context_def (st);
       if (!t)
        {
@@ -424,7 +425,7 @@ Context::remove_context (Context *trans)
 */
 Context *
 find_context_below (Context *where,
-                   SCM type, String id)
+                   SCM type, std::string id)
 {
   if (where->is_alias (type))
     {
@@ -457,7 +458,7 @@ Context::context_name_symbol () const
   return td->get_context_name ();
 }
 
-String
+std::string
 Context::context_name () const
 {
   return ly_symbol2string (context_name_symbol ());
index 0b928b500ddab62e9183d422567b44b9e71df976..5b6fc3df26e54339ad49ce59a92f77a9628b5b6e 100644 (file)
@@ -19,11 +19,12 @@ using namespace std;
 
 #include "custos.hh"
 #include "direction.hh"
+#include "font-interface.hh"
+#include "international.hh"
+#include "item.hh"
+#include "note-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "warn.hh"
-#include "note-head.hh"
-#include "item.hh"
-#include "font-interface.hh"
 
 MAKE_SCHEME_CALLBACK (Custos, print, 1);
 SCM
@@ -32,7 +33,7 @@ Custos::print (SCM smob)
   Item *me = (Item *)unsmob_grob (smob);
 
   SCM scm_style = me->get_property ("style");
-  String style;
+  std::string style;
   if (scm_is_symbol (scm_style))
     style = ly_symbol2string (scm_style);
   else
@@ -52,7 +53,7 @@ Custos::print (SCM smob)
   int pos = Staff_symbol_referencer::get_rounded_position (me);
   int sz = Staff_symbol_referencer::line_count (me) - 1;
 
-  String font_char = "custodes." + style + ".";
+  std::string font_char = "custodes." + style + ".";
   if (pos < neutral_pos)
     font_char += "u";
   else if (pos > neutral_pos)
index 51c5ef989348421d6162869f65155d9232fd3d40..0627b2b7201a2f3fe6aa10f3cc4b8fe1ebb61d7a 100644 (file)
@@ -26,7 +26,7 @@ Dots::print (SCM d)
 
   if (scm_is_number (c))
     {
-      Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots.dot"));
+      Stencil d = Font_interface::get_default_font (sc)->find_by_name (std::string ("dots.dot"));
       Real dw = d.extent (X_AXIS).length ();
 
       /*
index f01d82462183a9ffb38bc2b688006155aae13d6b..b21ca97a97407844590ea7b4bbd596b7fa7cf00e 100644 (file)
@@ -60,17 +60,17 @@ Duration::get_length () const
   return mom * factor_;
 }
 
-String
+std::string
 Duration::to_string () const
 {
-  String s;
+  std::string s;
 
   if (durlog_ < 0)
-    s = "log = " + ::to_string (durlog_);
+    s = "log = " + std::to_string (durlog_);
   else
-    s = ::to_string (1 << durlog_);
+    s = std::to_string (1 << durlog_);
 
-  s += ::to_string ('.', dots_);
+  s += std::to_string ('.', dots_);
   if (factor_ != Moment (Rational (1, 1)))
     s += "*" + factor_.to_string ();
   return s;
index 5f5559110a4e92ca5bf90305b9e0c432f112ba55..e6ecc2a972193ade920df537597e5ccb6e754ccd 100644 (file)
 #include "directional-element-interface.hh"
 #include "engraver.hh"
 #include "hairpin.hh"
+#include "international.hh"
 #include "interval.hh"
 #include "note-column.hh"
 #include "paper-column.hh"
+#include "pointer-group-interface.hh"
 #include "script-interface.hh"
+#include "self-alignment-interface.hh"
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "warn.hh"
-#include "self-alignment-interface.hh"
-#include "pointer-group-interface.hh"
 
 #include "translator.icc"
 
@@ -186,7 +187,7 @@ Dynamic_engraver::process_music ()
     {
       if (current_cresc_ev_)
        {
-         String msg = _ ("already have a decrescendo");
+         std::string msg = _ ("already have a decrescendo");
          if (current_cresc_ev_->is_mus_type ("decrescendo-event"))
            msg = _ ("already have a crescendo");
 
@@ -204,7 +205,7 @@ Dynamic_engraver::process_music ()
            TODO: Use symbols.
          */
 
-         String start_type
+         std::string start_type
            = ly_symbol2string (current_cresc_ev_->get_property ("name"));
 
          /*
index 4e97968a837655ef167e4434460d3622833837d2..2b1441a2756d862efde60cff2d5cc02e7c8db328 100644 (file)
@@ -9,11 +9,12 @@
 #include "event-chord-iterator.hh"
 
 #include "context.hh"
-#include "warn.hh"
-#include "music.hh"
+#include "duration.hh"
 #include "input.hh"
+#include "international.hh"
+#include "music.hh"
 #include "pitch.hh"
-#include "duration.hh"
+#include "warn.hh"
 
 Event_chord_iterator::Event_chord_iterator ()
 {
index d4b521af9ccf5362b439b812ac6323e0a7714bb8..a0799a7ff0d2f60eeb99780bdf17a644577258b1 100644 (file)
 
 #include "context.hh"
 #include "engraver.hh"
-#include "pointer-group-interface.hh"
+#include "international.hh"
 #include "item.hh"
 #include "lyric-extender.hh"
 #include "note-head.hh"
+#include "pointer-group-interface.hh"
 #include "warn.hh"
 
 void completize_extender (Spanner *sp);
index da6447db25674a80e05bf398bd386b76feaf108c..8d3eb19c8e3800623105ab5d0cf2288caa17ea47 100644 (file)
@@ -12,10 +12,10 @@ using namespace std;
 #include "file-name-map.hh"
 #include "lily-guile.hh"
 
-map<String, String> file_name_map_global;
+map<std::string, std::string> file_name_map_global;
 
-String
-map_file_name (String s)
+std::string
+map_file_name (std::string s)
 {
   if (file_name_map_global.find (s) != file_name_map_global.end ())
     s = file_name_map_global[s];
index 51df070893d32e6de10766a332d3fb9caffc1873..b927653e0c1dfa02fed41e1a9fedfb0f6b6df287 100644 (file)
@@ -8,10 +8,11 @@
 
 #include "folded-repeat-iterator.hh"
 
+#include "context.hh"
 #include "input.hh"
+#include "international.hh"
 #include "repeated-music.hh"
 #include "simultaneous-music-iterator.hh"
-#include "context.hh"
 
 Folded_repeat_iterator::Folded_repeat_iterator ()
 {
index 65349e87c22016de8ce487363b365c0f4faa0c77..482a240c9f0b084f0f9f9486790af1c9be5925d5 100644 (file)
@@ -8,7 +8,7 @@
 */
 
 #include "lily-guile.hh"
-#include "string.hh"
+#include "std-string.hh"
 
 #include <fontconfig/fontconfig.h>
 
index f91916adbaa40dc166bebbb9e6972c6f27ab9a1e..66aba66409ce42da83fa4f17ce577dcf8b269214 100644 (file)
@@ -14,6 +14,7 @@
 #include <sys/stat.h>
 
 #include "file-path.hh"
+#include "international.hh"
 #include "main.hh"
 #include "warn.hh"
 
@@ -36,14 +37,14 @@ init_fontconfig ()
   if (!is_file ((char*)cache_file))
     message (_f ("Rebuilding FontConfig cache %s. this may take a while...", cache_file));
                        
-  Array<String> dirs;
+  Array<std::string> dirs;
 
   dirs.push (prefix_directory + "/fonts/otf/");
   dirs.push (prefix_directory + "/fonts/type1/");
   
   for (int i = 0; i < dirs.size (); i++)
     {
-      String dir = dirs[i];
+      std::string dir = dirs[i];
       if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
        error (_f ("adding font directory: %s", dir.c_str ()));
       else if (be_verbose_global)
index 9d90c62b7f7eafabd064c4b3a3850011d4576263..8f42c7ff77184c4720e50f492b5a65c1363c7983 100644 (file)
@@ -30,9 +30,9 @@ Font_metric::design_size () const
 }
 
 Stencil
-Font_metric::find_by_name (String s) const
+Font_metric::find_by_name (std::string s) const
 {
-  s.substitute ('-', 'M');
+  replace_all (s, '-', 'M');
   int idx = name_to_index (s);
   Box b;
 
@@ -83,7 +83,7 @@ Font_metric::get_indexed_char (int k) const
 }
 
 int
-Font_metric::name_to_index (String) const
+Font_metric::name_to_index (std::string) const
 {
   return -1;
 }
@@ -129,10 +129,10 @@ Font_metric::font_file_name () const
   return scm_car (description_);
 }
 
-String
+std::string
 Font_metric::font_name () const
 {
-  String s ("unknown");
+  std::string s ("unknown");
   return s;
 }
 
@@ -167,7 +167,7 @@ Font_metric::get_indexed_char_stencil (int code) const
 }
 
 Offset
-Font_metric::attachment_point (String) const
+Font_metric::attachment_point (std::string) const
 {
   return Offset (0, 0);
 }
@@ -179,7 +179,7 @@ Font_metric::sub_fonts () const
 }
 
 Stencil
-Font_metric::text_stencil (String str) const
+Font_metric::text_stencil (std::string str) const
 {
   SCM lst = scm_list_3 (ly_symbol2scm ("text"),
                        this->self_scm (),
@@ -190,7 +190,7 @@ Font_metric::text_stencil (String str) const
 }
 
 Box
-Font_metric::text_dimension (String) const
+Font_metric::text_dimension (std::string) const
 {
   return Box (Interval (0, 0), Interval (0, 0));
 }
index cb04138ac10620077324c122d2376c435a2000a5..27caa90fbf684d16a29d2582f592afaf8ec017a6 100644 (file)
@@ -9,7 +9,7 @@
 #include <cstring>
 using namespace std;
 
-#include "string.hh"
+#include "std-string.hh"
 #include "lily-guile.hh"
 
 static SCM doc_hash_table;
@@ -25,7 +25,7 @@ void ly_add_function_documentation (SCM func,
   if (!doc_hash_table)
     doc_hash_table = scm_permanent_object (scm_c_make_hash_table (59));
 
-  String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist
+  std::string s = std::string (" - ") + "LilyPond procedure: " + fname + " " + varlist
     + "\n" + doc;
 
   scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
index 3ecb45fbd554e285fad30c13b839fc108d128c9b..933a34b991f46835b32cfc6fcf871a4608c76d42 100644 (file)
@@ -16,7 +16,7 @@ using namespace std;
 #include "international.hh"
 #include "libc-extension.hh"
 #include "lily-guile.hh"
-#include "string.hh"
+#include "std-string.hh"
 #include "misc.hh"
 #include "warn.hh"
 #include "version.hh"
@@ -31,8 +31,8 @@ LY_DEFINE (ly_find_file, "ly:find-file",
 {
   SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
 
-  String nm = ly_scm2string (name);
-  String file_name = global_path.find (nm);
+  std::string nm = ly_scm2string (name);
+  std::string file_name = global_path.find (nm);
   if (file_name.empty ())
     return SCM_BOOL_F;
 
@@ -56,8 +56,8 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file",
       sz = scm_to_int (size);
     }
   
-  String contents = gulp_file_to_string (ly_scm2string (name), true, sz);
-  return scm_from_locale_stringn (contents.get_str0 (), contents.length ());
+  std::string contents = gulp_file_to_string (ly_scm2string (name), true, sz);
+  return scm_from_locale_stringn (contents.c_str (), contents.length ());
 }
 
 LY_DEFINE (ly_error, "ly:error",
@@ -224,7 +224,7 @@ LY_DEFINE (ly_output_formats, "ly:output-formats",
           "Formats passed to --format as a list of strings, "
           "used for the output.")
 {
-  Array<String> output_formats = split_string (output_format_global, ',');
+  Array<std::string> output_formats = split_string (output_format_global, ',');
 
   SCM lst = SCM_EOL;
   int output_formats_count = output_formats.size ();
index 4bb180ef167e3da13f9cf0b80e203998760fbb6e..b06ac56165b9086823415cce8fe7af98b2ced5f9 100644 (file)
@@ -6,10 +6,11 @@
   (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "warn.hh"
-#include "spanner.hh"
-#include "rhythmic-head.hh"
 #include "engraver.hh"
+#include "international.hh"
+#include "rhythmic-head.hh"
+#include "spanner.hh"
+#include "warn.hh"
 
 /**
    Create line-spanner grobs for glissandi lines that connect note
@@ -87,7 +88,7 @@ Glissando_engraver::finalize ()
 {
   if (line_)
     {
-      String msg = _ ("unterminated glissando");
+      std::string msg = _ ("unterminated glissando");
 
       if (event_)
        event_->origin ()->warning (msg);
index 115b7f180be1558c6c55a3c34a80c269fc0cc2b2..7eb5fb224aa67003a08b06fed3d10c588c58958e 100644 (file)
@@ -6,15 +6,16 @@
   (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "warn.hh"
-#include "music-output.hh"
-#include "output-def.hh"
-#include "music-iterator.hh"
-#include "music.hh"
 #include "cpu-timer.hh"
 #include "global-context.hh"
-#include "object-key.hh"
+#include "international.hh"
 #include "main.hh"
+#include "music-iterator.hh"
+#include "music-output.hh"
+#include "music.hh"
+#include "object-key.hh"
+#include "output-def.hh"
+#include "warn.hh"
 
 LY_DEFINE (ly_format_output, "ly:format-output",
           1, 0, 0, (SCM context),
index d04ec4eb38cbc307c5375d80610021f7844cb53f..6c8b4e62f001fc65cacf47443797ed8605ed3a48 100644 (file)
 #include <cstdio>
 using namespace std;
 
-#include "warn.hh"
-#include "music.hh"
-#include "music-iterator.hh"
-#include "score-context.hh"
 #include "context-def.hh"
-#include "output-def.hh"
+#include "international.hh"
 #include "lilypond-key.hh"
+#include "music-iterator.hh"
+#include "music.hh"
+#include "output-def.hh"
+#include "score-context.hh"
+#include "warn.hh"
 
 Global_context::Global_context (Output_def *o, Moment final, Object_key *key)
   : Context (new Lilypond_context_key (key,
index df64d3e171f5a6a7ae02fc6f1898ed911270cc49..4438abd491b8901279ec76ba92e877d2558a5afc 100644 (file)
 #include <cstdio>
 using namespace std;
 
-#include "warn.hh"
+#include "international.hh"
 #include "main.hh"
+#include "output-def.hh"
 #include "paper-column.hh"
 #include "paper-score.hh"
-#include "output-def.hh"
 #include "simple-spacer.hh"
 #include "system.hh"
+#include "warn.hh"
 
 /// How often to print operator pacification marks?
-const int HAPPY_DOTS_I = 3;
+const int HAPPY_DOTS = 3;
 
 /**
    Helper to trace back an optimal path
@@ -173,13 +174,13 @@ Gourlay_breaking::do_solve () const
       bnod.line_ = optimal_paths[bnod.prev_break_].line_ + 1;
       optimal_paths.push (bnod);
 
-      if (! (break_idx % HAPPY_DOTS_I))
-       progress_indication (String ("[") + to_string (break_idx) + "]");
+      if (! (break_idx % HAPPY_DOTS))
+       progress_indication (std::string ("[") + to_string (break_idx) + "]");
     }
 
   /* do the last one */
-  if (breaks.size () % HAPPY_DOTS_I)
-    progress_indication (String ("[") + to_string (breaks.size ()) + "]");
+  if (breaks.size () % HAPPY_DOTS)
+    progress_indication (std::string ("[") + to_string (breaks.size ()) + "]");
 
   progress_indication ("\n");
 
index 29d8f40d3e3827db36fd9624e44f9f512f65dd2d..230a0e5425dc81de0ef9e562a441fde5818927df 100644 (file)
@@ -9,11 +9,12 @@
 #include "gregorian-ligature-engraver.hh"
 
 #include "gregorian-ligature.hh"
-#include "warn.hh"
-#include "staff-symbol-referencer.hh"
-#include "spanner.hh"
+#include "international.hh"
 #include "paper-column.hh"
 #include "pitch.hh"
+#include "spanner.hh"
+#include "staff-symbol-referencer.hh"
+#include "warn.hh"
 
 /*
  * This abstract class is the common superclass for all ligature
index 747a97bb1de4140ec988f2680ac36ce813f1bd92..43cc3c596711d2f18faf6eed9dde0e40cd63c57a 100644 (file)
@@ -9,9 +9,8 @@
 #include "gregorian-ligature.hh"
 
 #include "grob.hh"
-#include "string.hh"
 
-void check_prefix (String name, int mask, int prefix_set, String *str)
+void check_prefix (std::string name, int mask, int prefix_set, std::string *str)
 {
   if (prefix_set & mask)
     {
@@ -21,10 +20,10 @@ void check_prefix (String name, int mask, int prefix_set, String *str)
     }
 }
 
-String
+std::string
 Gregorian_ligature::prefixes_to_str (Grob *primitive)
 {
-  String str;
+  std::string str;
   int prefix_set
     = scm_to_int (primitive->get_property ("prefix-set"));
   check_prefix ("virga", VIRGA, prefix_set, &str);
index 74aa84a7d9302df3721b2455a264f5c486789ba8..e8e9e9200c558f5dad211a3f9fbb33d5faa60c85 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "lily-guile.hh"
-#include "string.hh"
+#include "std-string.hh"
 
 static SCM all_ifaces;
 
index 8a990cfb43b6f5ec1632e18ba2eb1e4804edcab0..779f54377b2502186cf002df706be86560413042 100644 (file)
@@ -8,8 +8,10 @@
 
 #include "grob-interface.hh"
 
-#include "protected-scm.hh"
 #include "grob.hh"
+#include "international.hh"
+#include "protected-scm.hh"
+#include "std-string.hh"
 #include "warn.hh"
 
 void add_interface (char const *symbol,
@@ -43,7 +45,7 @@ check_interfaces_for_property (Grob const *me, SCM sym)
       SCM iface = scm_hashq_ref (all_ifaces, scm_car (ifs), SCM_BOOL_F);
       if (iface == SCM_BOOL_F)
        {
-         String msg = to_string (_f ("Unknown interface `%s'",
+         std::string msg = to_string (_f ("Unknown interface `%s'",
                                      ly_symbol2string (scm_car (ifs)).c_str ()));
          programming_error (msg);
          continue;
@@ -54,7 +56,7 @@ check_interfaces_for_property (Grob const *me, SCM sym)
 
   if (!found)
     {
-      String str = to_string (_f ("Grob `%s' has no interface for property `%s'",
+      std::string str = to_string (_f ("Grob `%s' has no interface for property `%s'",
                                  me->name ().c_str (),
                                  ly_symbol2string (sym).c_str ()));
       programming_error (str);
index cb3f90467cd4b2e8c75676897b713f9f7f2549fe..0ad308bdb154c1cdf7064c2dd31d7c3611053ede 100644 (file)
 
 #include <cstring>
 
-#include "main.hh"
 #include "input-smob.hh"
-#include "warn.hh"
-#include "pointer-group-interface.hh"
-#include "misc.hh"
-#include "stencil.hh"
-#include "warn.hh"
-#include "system.hh"
+#include "international.hh"
 #include "item.hh"
-#include "stencil.hh"
+#include "main.hh"
 #include "misc.hh"
 #include "music.hh"
-#include "item.hh"
-#include "ly-smobs.icc"
 #include "output-def.hh"
+#include "pointer-group-interface.hh"
+#include "stencil.hh"
+#include "system.hh"
+#include "warn.hh"
+
+#include "ly-smobs.icc"
 
 Grob *
 Grob::clone (int count) const
@@ -432,7 +430,7 @@ Grob::fixup_refpoint ()
   MESSAGES
 ****************************************************************/
 void
-Grob::warning (String s) const
+Grob::warning (std::string s) const
 {
   SCM cause = self_scm ();
   while (Grob *g = unsmob_grob (cause))
@@ -445,7 +443,7 @@ Grob::warning (String s) const
 }
 
 
-String
+std::string
 Grob::name () const
 {
   SCM meta = get_property ("meta");
@@ -455,7 +453,7 @@ Grob::name () const
 }
 
 void
-Grob::programming_error (String s) const
+Grob::programming_error (std::string s) const
 {
   SCM cause = self_scm ();
   while (Grob *g = unsmob_grob (cause))
index 5a9a885b231a3020c2c1c3c02852c193b70bd00f..199b69e719beca5dc709510d2a77c3e95a615383 100644 (file)
@@ -7,17 +7,19 @@
 */
 
 #include "hairpin.hh"
-#include "staff-symbol-referencer.hh"
-#include "line-interface.hh"
-#include "spanner.hh"
-#include "font-interface.hh"
+
 #include "dimensions.hh"
+#include "font-interface.hh"
+#include "international.hh"
+#include "line-interface.hh"
+#include "lookup.hh"
 #include "output-def.hh"
-#include "warn.hh"
 #include "paper-column.hh"
-#include "lookup.hh"
-#include "text-interface.hh"
 #include "pointer-group-interface.hh"
+#include "spanner.hh"
+#include "staff-symbol-referencer.hh"
+#include "text-interface.hh"
+#include "warn.hh"
 
 MAKE_SCHEME_CALLBACK (Hairpin, after_line_breaking, 1);
 SCM
index 5475557ea7fc4f7170348ad8fee493543837ec8a..176b5d56efd179068a2e8fa2323a486afad31836 100644 (file)
@@ -8,9 +8,10 @@
 */
 
 #include "engraver.hh"
-#include "side-position-interface.hh"
+#include "international.hh"
 #include "note-column.hh"
 #include "pointer-group-interface.hh"
+#include "side-position-interface.hh"
 
 #include "translator.icc"
 
index 27572d852fc5fb0ec82899d2519579bb1b2196e4..de6fa24b1e4b2ea47e4d3c8d309d1ce18a8a54a7 100644 (file)
@@ -9,11 +9,11 @@
 */
 
 #include "engraver.hh"
-
-#include "warn.hh"
+#include "international.hh"
 #include "item.hh"
-#include "spanner.hh"
 #include "pointer-group-interface.hh"
+#include "spanner.hh"
+#include "warn.hh"
 
 class Hyphen_engraver : public Engraver
 {
index 9bcfbd23922434effed236a3bbeef4ec41a96a2a..fcf1ff19095eb5cac334ff7180382a64291329ef 100644 (file)
 using namespace std;
 
 #include "config.hh"
+
 #include "file-path.hh"
+#include "international.hh"
+#include "main.hh"
 #include "source-file.hh"
 #include "source.hh"
 #include "warn.hh"
-#include "main.hh"
 
 #ifndef YY_BUF_SIZE
 #define YY_BUF_SIZE 16384
@@ -44,7 +46,7 @@ Includable_lexer::Includable_lexer ()
 
 /** Set the new input file to NAME, remember old file.  */
 void
-Includable_lexer::new_input (String name, Sources *sources)
+Includable_lexer::new_input (std::string name, Sources *sources)
 {
   if (!allow_includes_b_)
     {
@@ -55,7 +57,7 @@ Includable_lexer::new_input (String name, Sources *sources)
   Source_file *file = sources->get_file (name);
   if (!file)
     {
-      String msg = _f ("can't find file: `%s'", name);
+      std::string msg = _f ("can't find file: `%s'", name);
       msg += "\n";
       msg += _f ("(search path: `%s')",
                 sources->path_->to_string ().c_str ());
@@ -69,7 +71,7 @@ Includable_lexer::new_input (String name, Sources *sources)
     state_stack_.push (yy_current_buffer);
 
   if (be_verbose_global)
-    progress_indication (String ("[") + name);
+    progress_indication (std::string ("[") + name);
 
   include_stack_.push (file);
 
@@ -81,7 +83,7 @@ Includable_lexer::new_input (String name, Sources *sources)
 }
 
 void
-Includable_lexer::new_input (String name, String data, Sources *sources)
+Includable_lexer::new_input (std::string name, std::string data, Sources *sources)
 {
   Source_file *file = new Source_file (name, data);
   sources->add (file);
@@ -92,7 +94,7 @@ Includable_lexer::new_input (String name, String data, Sources *sources)
     state_stack_.push (yy_current_buffer);
 
   if (be_verbose_global)
-    progress_indication (String ("[") + name);
+    progress_indication (std::string ("[") + name);
   include_stack_.push (file);
 
   yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE));
index 5f28885f6e10ba22de6d2f11d45098278945c067..12c77eace24ff94327baeb778ca41890e2761a0d 100644 (file)
@@ -20,7 +20,7 @@ public:
   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
   
   static bool has_interface (Grob *);
-  static String get_fontcharname (String style, int alteration);
+  static std::string get_fontcharname (std::string style, int alteration);
   static Array<Box> accurate_boxes (Grob *me,
                                                          Grob **common);
 };
index 5d1b8a6d38b6e0610fe85ef78848e830ed0942a7..414233124e6d43bce876fb36c5307da5294654cb 100644 (file)
@@ -35,7 +35,7 @@ class All_font_metrics
 
   All_font_metrics (All_font_metrics const &);
 public:
-  All_font_metrics (String search_path);
+  All_font_metrics (std::string search_path);
   ~All_font_metrics ();
 
 #if HAVE_PANGO_FT2
@@ -44,9 +44,9 @@ public:
                               Real scale);
 #endif
 
-  Tex_font_metric *find_tfm (String);
-  Font_metric *find_font (String name);
-  Open_type_font *find_otf (String name);
+  Tex_font_metric *find_tfm (std::string);
+  Font_metric *find_font (std::string name);
+  Open_type_font *find_otf (std::string name);
   SCM font_descriptions () const;
 };
 
index cfcbe4034e20fca25417297537a1f0c2c6856228..7def69e34306348ce3ec246ea8f48e740a248fe6 100644 (file)
@@ -47,9 +47,9 @@ public:
 class Audio_instrument : public Audio_item
 {
 public:
-  Audio_instrument (String instrument_string);
+  Audio_instrument (std::string instrument_string);
 
-  String str_;
+  std::string str_;
 };
 
 class Audio_note : public Audio_item
@@ -68,7 +68,7 @@ public:
 class Audio_piano_pedal : public Audio_item
 {
 public:
-  String type_string_;
+  std::string type_string_;
   Direction dir_;
 };
 
@@ -81,10 +81,10 @@ public:
       MARKER, CUE_POINT
     };
 
-  Audio_text (Audio_text::Type type, String text_string);
+  Audio_text (Audio_text::Type type, std::string text_string);
 
   Type type_;
-  String text_string_;
+  std::string text_string_;
 };
 
 class Audio_tempo : public Audio_item
index f0626a6f13b01719b09ed43b75cc08b769d24531..dbc99745f23aeabe9382b757d4fd5250ea28281a 100644 (file)
@@ -18,7 +18,7 @@ class Bar_line
 public:
   static bool has_interface (Grob *);
 
-  static Stencil compound_barline (Grob *, String, Real height, bool rounded);
+  static Stencil compound_barline (Grob *, std::string, Real height, bool rounded);
   static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
   DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
index 0977b15af760308a2e4f6450fa5871c97a9e1719..27fbe484a607443f7db1d642e4c589ec3835f5e9 100644 (file)
@@ -18,7 +18,7 @@ class Bar
 public:
   static bool has_interface (Grob *);
 
-  static Stencil compound_barline (Grob *, String, Real height);
+  static Stencil compound_barline (Grob *, std::string, Real height);
   static Stencil simple_barline (Grob *, Real wid, Real height);
   DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
index 7934c88d260759599ef5f99ee9b43f9f2ad87f6d..429a04d667d9249848fb1fece93d211cae571ecd 100644 (file)
@@ -11,7 +11,7 @@
 class Binary_source_file : public Source_file
 {
 public:
-  Binary_source_file (String &file_name_string);
+  Binary_source_file (std::string &file_name_string);
   virtual ~Binary_source_file ();
 
   U8 get_U8 ();
@@ -20,7 +20,7 @@ public:
   Byte get_Byte () {return get_U8 (); }
   int get_int () { return get_U32 (); }
 
-  virtual String quote_input (char const *pos_str0) const;
+  virtual std::string quote_input (char const *pos_str0) const;
   virtual int get_line (char const *pos_str0) const;
 };
 
index e77c19622423a299c5267f604e121ad8681a6de9..c731e21a507054b0d72a0c160034766be9338f96 100644 (file)
 #include "lily-proto.hh"
 #include "parray.hh"
 #include "object-key.hh"
-#include "string.hh"
+#include "std-string.hh"
 
 class Book : public Input
 {
   DECLARE_SMOBS (Book, foo);
 
 public:
-  String user_key_;
+  std::string user_key_;
   SCM header_;
   Output_def *paper_;
   SCM scores_;
index 27d8c263ca5a4b7f29fc753bd1cf260d17224401..75c84286d9fd6d63c1e3a8750566748fe73bd17f 100644 (file)
@@ -20,7 +20,7 @@ public:
   DECLARE_CLASSNAME(Change_iterator);
 
 private:
-  void error (String);
+  void error (std::string);
 };
 
 #endif
index 36ffd924a8eb7cc6c0ea0673aaec924c48a9ee14..a667f9d40875a6cebd9a1378739bfb9cb8a4551e 100644 (file)
@@ -30,8 +30,8 @@ private:
   int iterator_count_;
   bool init_;
 
-  map<String, int> grob_counts_;
-  map<String, int> context_counts_;
+  map<std::string, int> grob_counts_;
+  map<std::string, int> context_counts_;
 
 protected:
   Object_key const *key_;
@@ -43,20 +43,19 @@ protected:
   SCM accepts_list_;
   SCM aliases_;
   Translator_group *implementation_;
-  String id_string_;
+  std::string id_string_;
 
   friend class Context_def;
   void clear_key_disambiguations ();
 
 public:
   Object_key const *key () const { return key_; }
+  Object_key const *create_grob_key (std::string);
+  Object_key const *get_grob_key (std::string);
+  Object_key const *get_context_key (std::string, std::string);
 
-  Object_key const *create_grob_key (String);
-  Object_key const *get_grob_key (String);
-  Object_key const *get_context_key (String, String);
-
-  Context *create_context (Context_def *, String, SCM);
-  String id_string () const { return id_string_; }
+  Context *create_context (Context_def *, std::string, SCM);
+  std::string id_string () const { return id_string_; }
   SCM children_contexts () const { return context_list_; }
   SCM default_child_context_name () const;
 
@@ -73,7 +72,7 @@ public:
 
   Context *remove_context (Context *trans);
   void check_removal ();
-  String context_name () const;
+  std::string context_name () const;
   SCM context_name_symbol () const;
   Global_context *get_global_context () const;
 
@@ -90,7 +89,7 @@ public:
   bool try_music (Music *);
 
   Context *find_create_context (SCM context_name,
-                               String id, SCM ops);
+                               std::string id, SCM ops);
   Context *create_unique_context (SCM context_name,
                                  SCM ops);
   Link_array<Context> path_to_acceptable_context (SCM alias,
@@ -107,7 +106,7 @@ void execute_general_pushpop_property (Context *context,
                                       SCM context_property, SCM grob_property_path, SCM val);
 SCM updated_grob_properties (Context *tg, SCM sym);
 Context *find_context_below (Context *where,
-                            SCM type_sym, String id);
+                            SCM type_sym, std::string id);
 bool melisma_busy (Context *);
 
 Context *get_voice_to_lyrics (Context *lyrics);
index 84f8c2884b9caeccad199cb6ce39be1ac6e5d2ba..aa01197611f0a48887e1092764ca3bf7c2046e90 100644 (file)
@@ -2,7 +2,7 @@
 #define DIMENSIONS_HH
 
 #include "real.hh"
-class String;
+#include "std-string.hh"
 
 const Real INCH_TO_PT = 72.270;
 const Real CM_TO_PT = (INCH_TO_PT / 2.54);
@@ -37,7 +37,7 @@ const Real PT_TO_MM = (1.0 / MM_TO_PT);
 
 #endif
 
-String print_dimen (Real);
+std::string print_dimen (Real);
 const Real point_constant = 1 PT;
 const Real inch_constant = 1 INCH;
 const Real cm_constant = 1 CM;
index 00fb689cd6af57ee9fd27d3e135137e281905c80..6d7bdf6a32f8ad238d5cf0297021866a705b1166 100644 (file)
@@ -20,7 +20,7 @@ public:
 
   Duration ();
   Duration (int, int);
-  String to_string () const;
+  std::string to_string () const;
 
   Duration compressed (Rational) const;
   Rational get_length () const;
index 98273e170c66b39a69de26a6b05151e2e1b290bc..28a5d30aecd62d98badfa7dd5520cf346eddfe9b 100644 (file)
@@ -9,9 +9,9 @@
 #ifndef FILE_NAME_MAP_HH
 #define FILE_NAME_MAP_HH
 
-#include "string.hh"
+#include "std-string.hh"
 
-String map_file_name (String s);
+std::string map_file_name (std::string s);
 
 #endif /* FILE_NAME_MAP_HH */
 
index df3be0645c1901841215604538d9bb4ba0114bd5..d43403b378458da995e625be130f4c34b1a87737 100644 (file)
@@ -20,21 +20,21 @@ class Font_metric
 
 public:
   SCM description_;
-  String file_name_;
+  std::string file_name_;
 
-  virtual Stencil text_stencil (String) const;
-  virtual Box text_dimension (String) const;
-  virtual String font_name () const;
+  virtual Stencil text_stencil (std::string) const;
+  virtual Box text_dimension (std::string) const;
+  virtual std::string font_name () const;
   virtual int count () const;
-  virtual Offset attachment_point (String) const;
+  virtual Offset attachment_point (std::string) const;
   virtual Offset get_indexed_wxwy (int) const;
   virtual Box get_indexed_char (int index) const;
   virtual Box get_ascii_char (int ascii) const;
-  virtual int name_to_index (String) const;
+  virtual int name_to_index (std::string) const;
   virtual unsigned index_to_charcode (int) const;
   virtual int index_to_ascii (int) const;
   virtual Real design_size () const;
-  virtual Stencil find_by_name (String) const;
+  virtual Stencil find_by_name (std::string) const;
   virtual Stencil get_indexed_char_stencil (int k) const;
   virtual Stencil get_ascii_char_stencil (int k) const;
   virtual SCM sub_fonts () const;
@@ -51,7 +51,7 @@ protected:
   Font_metric ();
 };
 
-int get_encoded_index (Font_metric *m, String input_coding, int code);
+int get_encoded_index (Font_metric *m, std::string input_coding, int code);
 
 class Simple_font_metric : public Font_metric
 {
index 188e6bc6a9daa238865e1cf50985118842846292..72ff32b99c628f9375151c47850a47f6bcf1af04 100644 (file)
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
-#include "string.hh"
+#include "std-string.hh"
 
 void init_freetype ();
 extern FT_Library freetype2_library;
 
-FT_Face open_ft_face (String str);
+FT_Face open_ft_face (std::string str);
 
 #endif /* FREETYPE_HH */
 
index eaac1dd589fa711d1c78651faf4d77073b6e5bd9..d59833a1617e77977129b6c269eafd0013c761c5 100644 (file)
 #define GREGORIAN_LIGATURE_HH
 
 class Grob;
-class String;
+#include "std-string.hh"
 
 class Gregorian_ligature
 {
 public:
   static bool has_interface (Grob *);
-  static String prefixes_to_str (Grob *);
+  static std::string prefixes_to_str (Grob *);
 };
 
 /*
index c5413c5e74a206327f547f9cdc0e96ceaa8ca928..0652c9f8153761602ade78c9a50b2cf330d1108a 100644 (file)
@@ -73,7 +73,7 @@ public:
   bool is_live () const;
 
   /* naming. */
-  String name () const;
+  std::string name () const;
 
   /* Properties */
   SCM get_property_alist_chain (SCM) const;
@@ -85,8 +85,8 @@ public:
   void internal_set_object (SCM sym, SCM val);
 
   /* messages */  
-  void warning (String) const;
-  void programming_error (String) const;
+  void warning (std::string) const;
+  void programming_error (std::string) const;
 
 
   /* class hierarchy */
index 00946d588b4d054a95abc8a07c44403044c1f239..67aa59a8b6088eb1fd176abf234716c7ce5f5fdf 100644 (file)
@@ -10,7 +10,7 @@
 #define GROUP_INTERFACE_HH
 
 #include "grob.hh"
-#include "string.hh"
+#include "std-string.hh"
 /**
    Look at Score element ELT as thing which has a list property called
    NAME_. Normally the list would contain Grobs, but
index 2d4754fec2a7f537a6d4c02854d6d907dcc6a1dd..66c07ef78dfbc88d04fa8d3e6eb39177441bd514 100644 (file)
@@ -13,7 +13,7 @@
 #include <FlexLexer.h>
 #endif
 
-#include "string.hh"
+#include "std-string.hh"
 #include "parray.hh"
 #include "lily-proto.hh"
 
@@ -39,11 +39,11 @@ public:
   ~Includable_lexer ();
 
   /// store dependencies for Makefile stuff.
-  Array<String> file_name_strings_;
+  Array<std::string> file_name_strings_;
 
   Source_file *get_source_file () const;
-  void new_input (String s, Sources *);
-  void new_input (String name, String data, Sources *);
+  void new_input (std::string s, Sources *);
+  void new_input (std::string name, std::string data, Sources *);
 
   char const *here_str0 () const;
 };
index f9300bf4e84a958ddd8dd352a6cf89bdc225b834..9c255b70f0cc5ce83e09c7338c8652fc850e3d86 100644 (file)
@@ -10,6 +10,7 @@
 #define INPUT_HH
 
 #include "flower-proto.hh"
+#include "std-string.hh"
 
 /**
    Base class for anything that records its poisition in the parse file.
@@ -26,17 +27,17 @@ public:
   char const *end () const;
 
   void set (Source_file *, char const *, char const *);
-  void warning (String) const; // should use member func?
-  void non_fatal_error (String) const;
-  void error (String) const;
-  void message (String) const;
+  void warning (std::string) const; // should use member func?
+  void non_fatal_error (std::string) const;
+  void error (std::string) const;
+  void message (std::string) const;
   void set_spot (Input const &);
   void step_forward ();
   void set_location (Input const &, Input const &);
   Input spot () const;
-  String location_string () const;
-  String line_number_string () const;
-  String file_string ()const;
+  std::string location_string () const;
+  std::string line_number_string () const;
+  std::string file_string ()const;
 
   int line_number ()const;
   int column_number ()const;
index 511362375cd982d05046e6415a964670561a8ca0..ec74c7027a71d2cf89398fdbd0ab4f19b53edebd 100644 (file)
@@ -9,9 +9,9 @@
 #ifndef KPATH_HH
 #define KPATH_HH
 
-class String;
+#include "std-string.hh"
 
-String kpathsea_find_tfm (char const *name);
+std::string kpathsea_find_tfm (char const *name);
 void initialize_kpathsea (char *av0);
 
 #endif /* KPATH_HH */
index de3d8f0e8c37b631a2a6a6fc3f3623c07984d1c5..b51629fa150f015c7b1cb8a209d468c8a8a9f579 100644 (file)
@@ -41,10 +41,10 @@ SCM ly_to_symbol (SCM scm);
 
 extern SCM global_lily_module;
 
-String gulp_file_to_string (String fn, bool must_exist, int size);
+std::string gulp_file_to_string (std::string fn, bool must_exist, int size);
 
-String ly_scm2string (SCM s);
-String ly_symbol2string (SCM);
+std::string ly_scm2string (SCM s);
+std::string ly_symbol2string (SCM);
 SCM ly_offset2scm (Offset);
 Offset ly_scm2offset (SCM);
 SCM ly_chain_assoc (SCM key, SCM achain);
@@ -67,7 +67,7 @@ Offset robust_scm2offset (SCM, Offset);
 
 SCM ly_quote_scm (SCM s);
 bool type_check_assignment (SCM val, SCM sym, SCM type_symbol);
-String print_scm_val (SCM val);
+std::string print_scm_val (SCM val);
 SCM ly_number2string (SCM s);
 
 SCM parse_symbol_list (char const *);
@@ -121,7 +121,7 @@ extern "C" {
   void ly_display_scm (SCM s);
 }
 
-void read_lily_scm_file (String);
+void read_lily_scm_file (std::string);
 void ly_c_init_guile ();
 
 bool is_direction (SCM s);
index f1b88bf7c6a0bda217f965423586ccd73e0aef19..fcad09d52626fe6cc3c78b7185b36df70b9c996c 100644 (file)
@@ -24,10 +24,10 @@ class Lily_lexer : public Includable_lexer
   DECLARE_SMOBS (Lily_lexer,);
 
 private:
-  int lookup_keyword (String);
-  int scan_bare_word (String);
-  SCM scan_markup_word (String);
-  int scan_escaped_word (String);
+  int lookup_keyword (std::string);
+  int scan_bare_word (std::string);
+  SCM scan_markup_word (std::string);
+  int scan_escaped_word (std::string);
   int identifier_type (SCM);
   char escaped_char (char) const;
 
@@ -35,7 +35,7 @@ private:
   SCM scopes_;
   SCM start_module_;
 public:
-  String main_input_name_;
+  std::string main_input_name_;
   void *lexval;
   Input *lexloc;
   bool is_main_input_;
@@ -65,7 +65,7 @@ public:
 
   void start_main_input ();
 
-  SCM lookup_identifier (String s);
+  SCM lookup_identifier (std::string s);
   SCM lookup_identifier_symbol (SCM s);
   void push_chord_state (SCM tab);
   void push_figuredbass_state ();
index a6a151beb6df4869629c00116e17a5fb597ef495..cfb3cd149d62c503ad6e05c4bc0c43e4d625d99d 100644 (file)
@@ -39,7 +39,7 @@ public:
   Lily_lexer *lexer_;
   Sources *sources_;
   Duration default_duration_;
-  String output_basename_;
+  std::string output_basename_;
 
   int fatal_error_;
   int error_level_;
@@ -52,10 +52,10 @@ public:
 
   void do_init_file ();
   void do_yyparse ();
-  void parse_file (String init, String name, String out_name);
-  void parse_string (String ly_code);
-  void parser_error (String);
-  void parser_error (Input const &, String);
+  void parse_file (std::string init, std::string name, std::string out_name);
+  void parse_string (std::string ly_code);
+  void parser_error (std::string);
+  void parser_error (Input const &, std::string);
   void set_yydebug (bool);
 };
 
index 345caf46cdf7ac29463e44c2f6b9ff5c5658d7a8..d4df9e0529d2b9d446655b59b11bfc50213d1ea3 100644 (file)
@@ -9,11 +9,11 @@
 #ifndef LILY_VERSION_HH
 #define LILY_VERSION_HH
 
-#include "string.hh"
+#include "std-string.hh"
 
-String version_string ();
-String gnu_lilypond_string ();
-String gnu_lilypond_version_string ();
+std::string version_string ();
+std::string gnu_lilypond_string ();
+std::string gnu_lilypond_version_string ();
 
 #endif // LILY_VERSION_HH
 
index 908474a76b74c78609fbf7dfe99f274cb9516b9d..69e13e3b8692c16f6570c2cd77e81be0862b4a22 100644 (file)
@@ -9,20 +9,20 @@
 #ifndef LILYPOND_VERSION_HH
 #define LILYPOND_VERSION_HH
 
-#include "string.hh"
+#include "std-string.hh"
 
 struct Lilypond_version
 {
   Lilypond_version (int major, int minor, int patch);
-  Lilypond_version (String str);
+  Lilypond_version (std::string str);
 
-  String to_string () const;
+  std::string to_string () const;
   operator int () const;
 
   int major_;
   int minor_;
   int patch_;
-  String extra_patch_string_;
+  std::string extra_patch_string_;
 };
 
 extern Lilypond_version oldest_version;
index 7d18abd385d2873ee372f4428fdb46ae6b2567af..dc27c98fea978bd7424b9f72e9015be23bfa57e3 100644 (file)
@@ -17,13 +17,13 @@ class Lilypond_grob_key : public Object_key
 {
   Object_key const *context_;
   Moment creation_moment_;
-  String grob_name_;
+  std::string grob_name_;
   int disambiguation_count_;
 
 public:
   Lilypond_grob_key (Object_key const *context,
                     Moment start,
-                    String name, int);
+                    std::string name, int);
 
   static Object_key *from_scheme (SCM);
 protected:
@@ -37,15 +37,15 @@ class Lilypond_context_key : public Object_key
 {
   Object_key const *parent_context_;
   Moment start_moment_;
-  String context_name_;
-  String id_;
+  std::string context_name_;
+  std::string id_;
   int disambiguation_count_;
 
 public:
   Lilypond_context_key (Object_key const *parent,
                        Moment start,
-                       String type,
-                       String id,
+                       std::string type,
+                       std::string id,
                        int count);
 
   static Object_key *from_scheme (SCM);
@@ -59,10 +59,10 @@ protected:
 class Lilypond_general_key : public Object_key
 {
   Object_key const *parent_;
-  String name_;
+  std::string name_;
   int disambiguation_count_;
 public:
-  Lilypond_general_key (Object_key const *parent, String name,
+  Lilypond_general_key (Object_key const *parent, std::string name,
                        int count);
 
   static Object_key *from_scheme (SCM);
index a54ff5a39d66f732c6b41e46558f58969c30ebfa..d79b608c3e93c6111fb2c267b3c5f1f2cfdc7d17 100644 (file)
 
 #include "lily-proto.hh"
 #include "array.hh"
+#include "std-string.hh"
 
 void debug_init ();
 void set_debug (bool);
 void do_scores ();
 void clear_scores ();
 void add_score (Score *s);
-void set_default_output (String s);
-String find_file (String);
+void set_default_output (std::string s);
+std::string find_file (std::string);
 void call_constructors ();
-Array<String> get_inclusion_names ();
-void set_inclusion_names (Array<String>);
+Array<std::string> get_inclusion_names ();
+void set_inclusion_names (Array<std::string>);
 
-extern String init_name_global;
+extern std::string init_name_global;
 
 /* options */
-extern Array<String> dump_header_fieldnames_global;
-extern String output_backend_global;
-extern String output_name_global;
+extern Array<std::string> dump_header_fieldnames_global;
+extern std::string output_backend_global;
+extern std::string output_name_global;
 extern bool be_safe_global;
 extern bool be_verbose_global;
 extern bool do_internal_type_checking_global;
 extern bool is_pango_format_global;
 extern bool is_TeX_format_global;
 extern bool point_and_click_global;
-extern String prefix_directory;
+extern std::string prefix_directory;
 extern bool use_object_keys;
 
 /*
   todo: collect in Output_option struct?
 */
-extern String output_format_global;
+extern std::string output_format_global;
 
 extern bool make_preview;
 extern bool make_print;
 
 /* misc */
-extern Array<String> failed_files;
+extern Array<std::string> failed_files;
 extern int exit_status_global;
 extern File_path global_path;
 extern const char *LILYPOND_DATADIR;
index a4fc034ed11a1cc9b8ef0868d8a302d333883642..4f0e22a19fd29e533a1a950e199e490881f30c24 100644 (file)
@@ -26,9 +26,9 @@ public:
   /// factory
   static Midi_item *get_midi (Audio_item *a);
 
-  static String i2varint_string (int i);
+  static std::string i2varint_string (int i);
 
-  virtual String to_string () const = 0;
+  virtual std::string to_string () const = 0;
 
   int channel_;
 };
@@ -43,7 +43,7 @@ public:
 
   Moment delta_mom_;
   Midi_item *midi_;
-  String to_string () const;
+  std::string to_string () const;
 };
 
 /**
@@ -52,15 +52,15 @@ public:
 class Midi_chunk : public Midi_item
 {
 public:
-  void set (String header_string, String data_string, String footer_string);
-  virtual String to_string () const;
-  virtual String data_string () const;
+  void set (std::string header_string, std::string data_string, std::string footer_string);
+  virtual std::string to_string () const;
+  virtual std::string data_string () const;
   DECLARE_CLASSNAME(Midi_chunk);
 
 private:
-  String data_string_;
-  String footer_string_;
-  String header_string_;
+  std::string data_string_;
+  std::string footer_string_;
+  std::string header_string_;
 };
 
 class Midi_duration : public Midi_item
@@ -68,7 +68,7 @@ class Midi_duration : public Midi_item
 public:
   Midi_duration (Real seconds_f);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
   Real seconds_;
 };
 
@@ -89,7 +89,7 @@ public:
   Midi_instrument (Audio_instrument *);
 
   DECLARE_CLASSNAME(Midi_instrument);
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_instrument *audio_;
 };
@@ -100,7 +100,7 @@ public:
   Midi_key (Audio_key *);
   DECLARE_CLASSNAME(Midi_key);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_key *audio_;
 };
@@ -111,7 +111,7 @@ public:
   Midi_time_signature (Audio_time_signature *);
   DECLARE_CLASSNAME(Midi_time_signature);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_time_signature *audio_;
   int clocks_per_1_;
@@ -129,7 +129,7 @@ public:
   Moment get_length () const;
   int get_pitch () const;
   int get_fine_tuning () const;
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_note *audio_;
 
@@ -146,7 +146,7 @@ public:
   Midi_note_off (Midi_note *);
   DECLARE_CLASSNAME(Midi_note_off);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Midi_note *on_;
   Byte aftertouch_byte_;
@@ -164,7 +164,7 @@ public:
 
   Midi_text (Audio_text *);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_text *audio_;
 };
@@ -175,7 +175,7 @@ public:
   Midi_dynamic (Audio_dynamic *);
   DECLARE_CLASSNAME(Midi_dynamic);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_dynamic *audio_;
 };
@@ -186,7 +186,7 @@ public:
   Midi_piano_pedal (Audio_piano_pedal *);
   DECLARE_CLASSNAME(Midi_piano_pedal);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_piano_pedal *audio_;
 };
@@ -197,7 +197,7 @@ public:
   Midi_tempo (Audio_tempo *);
   DECLARE_CLASSNAME(Midi_tempo);
 
-  virtual String to_string () const;
+  virtual std::string to_string () const;
 
   Audio_tempo *audio_;
 };
@@ -216,7 +216,7 @@ public:
   Midi_track ();
 
   void add (Moment delta_time_mom, Midi_item *midi);
-  virtual String data_string () const;
+  virtual std::string data_string () const;
 };
 
 #endif // MIDI_ITEM_HH
index be91402d96b19d67c2e90dcf6b9d95975b5f44fa..1d460c29daa4ad5d912dcdfe06a0e8f775075675 100644 (file)
 #include <cstdio>
 using namespace std;
 
-#include "string.hh"
+#include "std-string.hh"
 
 class Midi_item;
 
 /// Midi outputfile
 struct Midi_stream
 {
-  Midi_stream (String file_name_string);
+  Midi_stream (std::string file_name_string);
   ~Midi_stream ();
 
-  Midi_stream &operator << (String str);
+  Midi_stream &operator << (std::string str);
   Midi_stream &operator << (Midi_item const &midi_c_r);
   Midi_stream &operator << (int i);
 
   void open ();
 
   FILE *out_file_;
-  String file_name_string_;
+  std::string file_name_string_;
 };
 
 #endif // MIDI_STREAM_HH
index 65b1155b18631d21ffa0815bfdaa81948d894c9a..34b28a118f90394002e01fb492a85c3dbeb94796 100644 (file)
@@ -28,7 +28,7 @@ sign (int i)
   else return 0;
 }
 
-Array<String> split_string (String s, char c);
+Array<std::string> split_string (std::string s, char c);
 
 inline Real
 linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2)
index 274e031b39094018d760dc49d19e6639f6487325..d0f73f10665140773590b58e15497af821e63e94 100644 (file)
 struct Modified_font_metric : public Font_metric
 {
 public:
-  virtual Box text_dimension (String) const;
-  virtual Stencil text_stencil (String) const;
+  virtual Box text_dimension (std::string) const;
+  virtual Stencil text_stencil (std::string) const;
 
   static SCM make_scaled_font_metric (Font_metric *fm, Real magnification);
   virtual int count () const;
   virtual Offset get_indexed_wxwy (int) const;
-  virtual Offset attachment_point (String) const;
-  virtual int name_to_index (String) const;
+  virtual Offset attachment_point (std::string) const;
+  virtual int name_to_index (std::string) const;
   virtual unsigned index_to_charcode (int) const;
   Font_metric *original_font () const;
 
@@ -32,13 +32,13 @@ protected:
 
   Modified_font_metric (Font_metric *fm, Real magnification);
   virtual SCM sub_fonts () const;
-  virtual String font_name () const;
+  virtual std::string font_name () const;
   virtual Real design_size () const;
   virtual void derived_mark () const;
   virtual Box get_indexed_char (int) const;
   virtual int index_to_ascii (int) const;
   virtual Box get_ascii_char (int) const;
-  Box tex_kludge (String) const;
+  Box tex_kludge (std::string) const;
 };
 
 #endif /* MODIFIED_FONT_METRIC_HH */
index ea6ef59a5fa5d7ff23a68e655fc1c190082d3e19..8d594d4931bd04be5e71a3bfb33ee9be94af8c61 100644 (file)
@@ -46,7 +46,7 @@ public:
   /*
     Deliver a copy of THIS as a smobified SCM
   */
-  String to_string () const;
+  std::string to_string () const;
   static int compare (Moment const &, Moment const &);
   SCM as_scheme () const;
 };
index 15771f9a135ca9f482bac84130301e1f9f7e2b43..ba34466128ed2f4987a8baaf5214219b585a5b68 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef MUSIC_OUTPUT_HH
 #define MUSIC_OUTPUT_HH
 
-#include "string.hh"
+#include "std-string.hh"
 #include "lily-proto.hh"
 #include "protected-scm.hh"
 #include "smobs.hh"
index c27c9a66ffa55a14b3011731b35a2d6e0144546e..1a19ab3ccb6f317cb9cb3d8f83753c43bcde67df 100644 (file)
@@ -38,22 +38,22 @@ public:
   SCM get_char_table () const;
   SCM glyph_list () const;
     
-  String get_otf_table (String tag) const;
-  static SCM make_otf (String);
-  virtual String font_name () const;
+  std::string get_otf_table (std::string tag) const;
+  static SCM make_otf (std::string);
+  virtual std::string font_name () const;
   virtual ~Open_type_font ();
-  virtual Offset attachment_point (String) const;
+  virtual Offset attachment_point (std::string) const;
   virtual int count () const;
   virtual Box get_indexed_char (int) const;
-  virtual int name_to_index (String) const;
-  //virtual unsigned glyph_name_to_charcode (String) const;
+  virtual int name_to_index (std::string) const;
+  //virtual unsigned glyph_name_to_charcode (std::string) const;
   virtual unsigned index_to_charcode (int) const;
   virtual void derived_mark () const;
   virtual SCM sub_fonts () const;
   virtual Real design_size () const;
 };
 
-String get_otf_table (FT_Face face, String tag);
-FT_Face open_ft_face (String str);
+std::string get_otf_table (FT_Face face, std::string tag);
+FT_Face open_ft_face (std::string str);
 
 #endif /* OPEN_TYPE_FONT_HH */
index bf9d23f934f35c57c1beef3f8922b999e8b41228..8b4dfe943f216cb3c37f2e5c9665ddbe69e250a9 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef MUSIC_OUTPUT_DEF_HH
 #define MUSIC_OUTPUT_DEF_HH
 
-#include "string.hh"
+#include "std-string.hh"
 #include "lily-proto.hh"
 #include "virtual-methods.hh"
 #include "smobs.hh"
@@ -47,7 +47,7 @@ public:
   Output_def *parent_;
   
   Input input_origin_;
-  String user_key_;
+  std::string user_key_;
 
   Lily_parser *parser_;
   Lily_parser *get_parser () const;
@@ -58,7 +58,7 @@ public:
   /*
     variables.
    */
-  SCM c_variable (String id) const;
+  SCM c_variable (std::string id) const;
   SCM lookup_variable (SCM sym) const;
   void set_variable (SCM sym, SCM val);
   Real get_dimension (SCM symbol) const;
index 852e73e28e8a6d222b5240c699618a455c866af2..b3d4ebd934758cdde5ba9724cf484dd0438bb642 100644 (file)
@@ -36,9 +36,9 @@ public:
   ~Pango_font ();
 
   SCM font_file_name () const;
-  void register_font_file (String, String);
-  Stencil text_stencil (String) const;
-  Stencil pango_item_string_stencil (PangoItem const *, String) const;
+  void register_font_file (std::string, std::string);
+  Stencil text_stencil (std::string) const;
+  Stencil pango_item_string_stencil (PangoItem const *, std::string) const;
 
   virtual void derived_mark () const;
 };
index 6af69ce235e78403e6562ae49f5eca1ca68f6457..a45d3313e8cb8c62733ff965e56a23d61360f69f 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "lily-proto.hh"
 #include "array.hh"
-#include "string.hh"
+#include "std-string.hh"
 #include "protected-scm.hh"
 #include "smobs.hh"
 
@@ -22,7 +22,7 @@
 class Paper_outputter
 {
   SCM output_module_;
-  String file_name_;
+  std::string file_name_;
   SCM file_;
 
 public:
@@ -32,13 +32,13 @@ public:
   SCM file () const;
   SCM dump_string (SCM);
   void output_scheme (SCM scm);
-  Paper_outputter (SCM port, String format);
+  Paper_outputter (SCM port, std::string format);
   SCM scheme_to_string (SCM);
   void output_stencil (Stencil);
   void close ();
 };
 
-Paper_outputter *get_paper_outputter (String, String);
+Paper_outputter *get_paper_outputter (std::string, std::string);
 DECLARE_UNSMOB (Paper_outputter, outputter);
 
 #endif /* PAPER_OUTPUTTER_HH */
index 9fcfa38384150b874472199c8f028fabbef1f706..4ea823bd11c936b2cc4413ee84d871d29e14ff4d 100644 (file)
@@ -25,7 +25,7 @@ public:
   void output_header_track (Midi_stream &midi_stream_r);
 
   void print () const;
-  void write_output (String filename);
+  void write_output (std::string filename);
 
   Link_array<Audio_staff> audio_staffs_;
   Cons<Audio_element> *audio_element_list_;
index 56617d9e611d8a3b906324dd2e2535be7b2c853e..1b6742afee39bc4c25d71cb5a7c3ec8f4ce5c80f 100644 (file)
@@ -57,7 +57,7 @@ public:
   int steps () const;
   int semitone_pitch () const;
   int quartertone_pitch () const;
-  String to_string () const;
+  std::string to_string () const;
 
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
   DECLARE_SIMPLE_SMOBS (Pitch,);
index f854bf3a413a679494dd070e4475bd590f317ad9..719c140651e1e8aac903b6182d7f9fa3e259d86d 100644 (file)
@@ -36,7 +36,7 @@ protected:
 public:
   Prob (SCM, SCM);
   Prob (Prob const &);
-  virtual String name () const;
+  virtual std::string name () const;
   SCM type () const { return type_; }
   SCM get_property_alist (bool mutble) const;
   SCM internal_get_property (SCM sym) const;
index c477acaab96e71784b8560383b342d1d5012ea1a..c8ccacc02951121d76393228470e6cda39bafb22 100644 (file)
@@ -12,9 +12,9 @@
 
 
 
-#include "string.hh"
+#include "std-string.hh"
 
-int sane_putenv (char const *key, String value, bool overwrite);
+int sane_putenv (char const *key, std::string value, bool overwrite);
 void setup_paths (char const *argv0);
 extern bool relocate_binary;
 
index aa82cc21420f5cca85a3e45642c9d1a3c63cb321..19e3abc3d4da1bf630c0225c90f7aec069f711d5 100644 (file)
@@ -18,7 +18,7 @@ class Rest
 public:
   DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM));
   static bool has_interface (Grob *);
-  static String glyph_name (Grob *, int, String, bool);
+  static std::string glyph_name (Grob *, int, std::string, bool);
   static SCM brew_internal_stencil (Grob*, bool);
   static SCM generic_extent_callback (Grob*, Axis);
   DECLARE_SCHEME_CALLBACK (polyphonic_offset_callback, (SCM));
index 2e1724a35d695ebe553d96471b24b1bd9da505f6..6cb5cf927dfc5b8f86936a0d7e8054194bcbf6d8 100644 (file)
@@ -15,7 +15,7 @@
 #include "parray.hh"
 #include "smobs.hh"
 #include "virtual-methods.hh"
-#include "string.hh"
+#include "std-string.hh"
 
 class Score : public Input
 {
@@ -25,7 +25,7 @@ class Score : public Input
 
 public:
   Link_array<Output_def> defs_;
-  String user_key_;
+  std::string user_key_;
   SCM header_;
   bool error_found_;
 
index f7e2731a5c9b945811f7f2b8c866145e51e01de1..3039bd960cebf7f5fa015f6cc0dbfc3a6272071e 100644 (file)
@@ -24,7 +24,7 @@ public:
   int index_;
 
 #if DEBUG_SLUR_SCORING
-  String score_card_;
+  std::string score_card_;
 #endif
 
   Slur_configuration ();
index 161c8e3b8b4b96037f587f8fe272dfdd3de14ecc..098ae759252a57720edc0d569fca9e19bece2f43 100644 (file)
@@ -9,10 +9,11 @@
 #ifndef SOURCE_FILE_HH
 #define SOURCE_FILE_HH
 
+#include "std-string.hh"
+
 #include <iostream>
 using namespace std;
 
-#include "string.hh"
 #include "protected-scm.hh"
 #include "parray.hh"
 
@@ -27,19 +28,19 @@ using namespace std;
 class Source_file
 {
 public:
-  Source_file (String fn);
-  Source_file (String, String);
+  Source_file (std::string fn);
+  Source_file (std::string, std::string);
 
   virtual ~Source_file ();
 
   char const *c_str () const;
-  virtual String quote_input (char const *pos_str0) const;
+  virtual std::string quote_input (char const *pos_str0) const;
   istream *get_istream ();
   bool contains (char const *pos_str0) const;
   int length () const;
   virtual int get_line (char const *pos_str0) const;
-  String name_string () const;
-  String file_line_column_string (char const *str0) const;
+  std::string name_string () const;
+  std::string file_line_column_string (char const *str0) const;
 
   // return start + n
   char const *seek_str0 (int n);
@@ -48,11 +49,11 @@ public:
   // return here + n bytes
   char const *forward_str0 (int n);
   char const *pos_str0 () { return pos_str0_; }
-  String get_string (int n);
+  std::string get_string (int n);
   void set_pos (char const *pos_str0);
 public:
   Slice line_slice (char const *pos_str0) const;
-  String line_string (char const *pos_str0) const;
+  std::string line_string (char const *pos_str0) const;
   void get_counts (char const *pos_str0, int *, int *, int *) const;
 
   /*
@@ -63,7 +64,7 @@ public:
   char const *pos_str0_;
 
   SCM get_port () const;
-  String name_;
+  std::string name_;
 
 private:
   Link_array<char> newline_locations_;
@@ -76,7 +77,7 @@ private:
   Protected_scm str_port_;
 };
 
-char *gulp_file (String fn, int *len);
+char *gulp_file (std::string fn, int *len);
 
 #endif /* SOURCE_FILE_HH */
 
index 24ff6ad077938106b20801ee606d716178eb6711..a786bea4ae5cfed6cbd9118de587a109b1a9b7c1 100644 (file)
@@ -6,8 +6,10 @@
 
 #ifndef SOURCE_HH
 #define SOURCE_HH
+
 #include "cons.hh"
 #include "flower-proto.hh"
+#include "std-string.hh"
 
 /*   A set of sourcefiles.  */
 class Sources
@@ -20,7 +22,7 @@ public:
   Sources ();
   ~Sources ();
 
-  Source_file *get_file (String &file_name);
+  Source_file *get_file (std::string &file_name);
   Source_file *get_sourcefile (char const *);
   void add (Source_file *sourcefile);
   void set_path (File_path *);
index 7559d912016ba8b00739f1a4ca185be1e6590911..fe33920d647bf6da82fdbe65bce4e5928f05bce1 100644 (file)
@@ -9,17 +9,17 @@
 #ifndef STREAM_HH
 #define STREAM_HH
 
+#include "std-string.hh"
+
 #include <iostream>
 #include <sstream>
 using namespace std;
 
-#include "string.hh"
-
 #if __GNUC__ > 2
-ostream *open_file_stream (String file_name,
+ostream *open_file_stream (std::string file_name,
                                ios_base::openmode mode = ios::out);
 #else
-ostream *open_file_stream (String file_name, int mode = ios::out);
+ostream *open_file_stream (std::string file_name, int mode = ios::out);
 #endif
 void close_file_stream (ostream *os);
 
index 80765c75a16a91d5e716cdcb0ffb11f986fb0168..47004766e9d66f74dff1509a1822f4936407b5be 100644 (file)
@@ -12,7 +12,7 @@
 #include "lily-guile.hh"
 #include "box.hh"
 
-void try_load_text_metrics (String);
+void try_load_text_metrics (std::string);
 SCM ly_load_text_dimensions (SCM);
 Box lookup_tex_text_dimension (Font_metric *font,
                               SCM text);
index d18db85d0a56f23f81fc7b21c59c7d6129aed321..9b2c8e22d1021975ef79dcd1136ef4608626fc12 100644 (file)
@@ -20,7 +20,7 @@ class Tex_font_metric_reader
 private:
   Real get_U32_fix ();
   Real get_U32_fix_scaled ();
-  String get_bcpl_string ();
+  std::string get_bcpl_string ();
   void read_header ();
   void read_params ();
   void read_char_metrics ();
@@ -32,7 +32,7 @@ private:
   Binary_source_file input_;
 
 public:
-  Tex_font_metric_reader (String name);
+  Tex_font_metric_reader (std::string name);
 
   Tfm_info info_;
   Tfm_header header_;
index 394c489ea31d15cc2c6596ec7a2c5bc8bf186dcd..85e2002029c88fa9c32facda0399167e6d634c09 100644 (file)
@@ -103,7 +103,7 @@ struct Tfm_info
   Char_code first_charcode, last_charcode;
   U32 checksum;
   Real design_size;
-  String coding_scheme;
+  std::string coding_scheme;
   unsigned parameter_count;
   // Real parameters [Tex_font_metric::MAX_FONTDIMENS];
   Real parameters [TFM_MAX_FONTDIMENS];
@@ -144,14 +144,14 @@ class Tex_font_metric : public Simple_font_metric
 {
   DECLARE_CLASSNAME(Tex_font_metric);
 public:
-  static SCM make_tfm (String file_name);
+  static SCM make_tfm (std::string file_name);
 
   virtual int count () const;
   virtual Box get_ascii_char (int) const;
   virtual Real design_size () const;
   virtual void derived_mark () const;
-  virtual int name_to_index (String) const;
-  virtual String font_name () const;
+  virtual int name_to_index (std::string) const;
+  virtual std::string font_name () const;
 
   Tfm_info const &info () const;
 
@@ -161,7 +161,7 @@ protected:
   Array<Tex_font_char_metric> char_metrics_;
   Array<int> ascii_to_metric_idx_;
   SCM encoding_table_;
-  String font_name_;
+  std::string font_name_;
 private:
   Tex_font_char_metric const *find_ascii (int ascii, bool warn = true) const;
   Tex_font_metric ();
index e88ab8b4c4bbf2e72d713a22baf659e4f21b9057..2b2cb9698c6a909c360558456fd60a1b5dbd74e7 100644 (file)
@@ -10,7 +10,7 @@
 #define TRANSLATOR_HH
 
 #include "global-ctor.hh"
-#include "string.hh"
+#include "std-string.hh"
 #include "lily-proto.hh"
 #include "virtual-methods.hh"
 #include "input.hh"
index a2205c8a0ef1ceb3d4a5b1c7473bf30211faae67..f477beeb3e7e4d6a12bdbb378816099d17e35a51 100644 (file)
@@ -17,7 +17,7 @@
 class Type_swallow_translator : public Translator
 {
 protected:
-  String swallow_string_;
+  std::string swallow_string_;
   bool try_music (Music *);
 public:
   VIRTUAL_COPY_CONS (Translator);
index 6923a8b1049b3494bfce46e912e70c9c2e301988..bf5793f52dfc49f55981ccbf0f667d6d826b716a 100644 (file)
@@ -6,7 +6,7 @@
   (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "string.hh"
+#include "std-string.hh"
 #include "input-smob.hh"
 
 /* We don't use IMPLEMENT_TYPE_P, since the smobification part is
@@ -28,7 +28,7 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM
 
   msg = scm_simple_format (SCM_BOOL_F, msg, rest);
 
-  String m = ly_scm2string (msg);
+  std::string m = ly_scm2string (msg);
   ip->message (m);
 
   return SCM_UNSPECIFIED;
index 00c93305e783949c9cae23263ecb0d68c829669e..be2816719434b168dac7559437730e0100e2e37f 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "input-smob.hh"
 
-#include "string.hh"
+#include "std-string.hh"
 
 #include "ly-smobs.icc"
 
@@ -26,7 +26,7 @@ SCM mark_smob (SCM)
 static int
 print_smob (SCM s, SCM port, scm_print_state *)
 {
-  String str = "#<location " + unsmob_input (s)->location_string () + ">";
+  std::string str = "#<location " + unsmob_input (s)->location_string () + ">";
   scm_puts (str.c_str (), port);
   return 1;
 }
index 3802e7d2cd8fdcf1c7e1d701b3aa17b54f7d6cd9..ef78037fad33bbd9eb8baac75f37774bc9583f9e 100644 (file)
@@ -11,8 +11,9 @@
 #include <cstdio>
 using namespace std;
 
-#include "source.hh"
+#include "international.hh"
 #include "source-file.hh"
+#include "source.hh"
 #include "warn.hh"
 
 Input::Input (Input const &i)
@@ -66,7 +67,7 @@ Input::set_location (Input const &i_start, Input const &i_end)
   [file:line:column:][warning:]message
 */
 void
-Input::message (String s) const
+Input::message (std::string s) const
 {
   if (source_file_)
     s = location_string () + ": " + s + "\n"
@@ -75,13 +76,13 @@ Input::message (String s) const
 }
 
 void
-Input::warning (String s) const
+Input::warning (std::string s) const
 {
   message (_f ("warning: %s", s));
 }
 
 void
-Input::error (String s) const
+Input::error (std::string s) const
 {
   message (_f ("error: %s", s));
   // UGH, fix naming or usage
@@ -89,12 +90,12 @@ Input::error (String s) const
 }
 
 void
-Input::non_fatal_error (String s) const
+Input::non_fatal_error (std::string s) const
 {
   message (_f ("error: %s", s));
 }
 
-String
+std::string
 Input::location_string () const
 {
   if (source_file_)
@@ -102,7 +103,7 @@ Input::location_string () const
   return " (" + _ ("position unknown") + ")";
 }
 
-String
+std::string
 Input::line_number_string () const
 {
   if (source_file_)
@@ -110,7 +111,7 @@ Input::line_number_string () const
   return "?";
 }
 
-String
+std::string
 Input::file_string () const
 {
   if (source_file_)
index 28db248a6dc78f12f62b01e5f96e5c0d97f71a9d..d591d105d979d3c20878ee112e88a472bb77233a 100644 (file)
@@ -8,12 +8,13 @@
   keyplacement by Mats Bengtsson
 */
 
+#include "accidental-interface.hh"
+#include "font-interface.hh"
+#include "international.hh"
 #include "item.hh"
+#include "lookup.hh"
 #include "output-def.hh"
-#include "font-interface.hh"
 #include "staff-symbol-referencer.hh"
-#include "lookup.hh"
-#include "accidental-interface.hh"
 
 struct Key_signature_interface
 {
@@ -91,7 +92,7 @@ Key_signature_interface::print (SCM smob)
   Real inter = Staff_symbol_referencer::staff_space (me) / 2.0;
 
   SCM scm_style = me->get_property ("style");
-  String style;
+  std::string style;
   if (scm_is_symbol (scm_style))
     style = ly_symbol2string (scm_style);
   else
@@ -115,7 +116,7 @@ Key_signature_interface::print (SCM smob)
   for (SCM s = newas; scm_is_pair (s); s = scm_cdr (s))
     {
       int alteration = scm_to_int (scm_cdar (s));
-      String font_char
+      std::string font_char
        = Accidental_interface::get_fontcharname (style, alteration);
       Stencil acc (fm->find_by_name ("accidentals." + font_char));
 
index 92bbdc5e623c9d2a05ecc0130c8c5b8e6e87e08e..0a4db9346160b2648accf5d6f10b1026b9c304c3 100644 (file)
 #include <iostream>
 using namespace std;
 
-#include "music-function.hh"
-#include "source-file.hh"
-#include "parse-scm.hh"
-#include "lily-guile.hh"
-#include "string.hh"
-#include "string-convert.hh"
-#include "lily-lexer.hh"
+#include "context-def.hh"
+#include "identifier-smob.hh"
+#include "international.hh"
 #include "interval.hh"
 #include "lily-guile.hh"
-#include "parser.hh"
-#include "warn.hh"
+#include "lily-lexer.hh"
+#include "lilypond-input-version.hh"
 #include "main.hh"
+#include "music-function.hh"
+#include "parse-scm.hh"
+#include "parser.hh"
+#include "source-file.hh"
+#include "std-string.hh"
+#include "string-convert.hh"
 #include "version.hh"
-#include "lilypond-input-version.hh"
-#include "context-def.hh"
-#include "identifier-smob.hh"
+#include "warn.hh"
 
 /*
 RH 7 fix (?)
 */
 #define isatty HORRIBLEKLUDGE
 
-void strip_trailing_white (String&);
-void strip_leading_white (String&);
-String lyric_fudge (String s);
+void strip_trailing_white (std::string&);
+void strip_leading_white (std::string&);
+std::string lyric_fudge (std::string s);
 int music_function_type (SCM);
-SCM lookup_markup_command (String s);
-bool is_valid_version (String s);
+SCM lookup_markup_command (std::string s);
+bool is_valid_version (std::string s);
 
 
 #define start_quote()  \
        yy_push_state (quote);\
-       yylval.string = new String
+       yylval.string = new std::string
 
 #define start_lyric_quote()    \
        yy_push_state (lyric_quote);\
-       yylval.string = new String
+       yylval.string = new std::string
 
 #define yylval \
        (*(YYSTYPE*)lexval)
@@ -87,7 +87,7 @@ LYRICS                ({AA}|{TEX})[^0-9 \t\n\f]*
 */
 
 
-SCM scan_fraction (String);
+SCM scan_fraction (std::string);
 SCM (* scm_parse_error_handler) (void *);
 
 
@@ -184,8 +184,8 @@ BOM_UTF8    \357\273\277
        yy_push_state (sourcefilename);
 }
 <version>\"[^"]*\"     { /* got the version number */
-       String s (YYText () + 1);
-       s = s.left_string (s.index_last ('\"'));
+       std::string s (YYText () + 1);
+       s = s.substr (0, s.rfind ('\"'));
 
        yy_pop_state ();
        if (!is_valid_version (s))
@@ -196,8 +196,8 @@ BOM_UTF8    \357\273\277
 
 }
 <sourcefilename>\"[^"]*\"     {
-       String s (YYText () + 1);
-       s = s.left_string (s.index_last ('\"'));
+       std::string s (YYText () + 1);
+       s = s.substr (0, s.rfind ('\"'));
 
        yy_pop_state ();
        this->here_input().get_source_file ()->name_ = s;
@@ -248,24 +248,24 @@ BOM_UTF8  \357\273\277
        yy_push_state (incl);
 }
 <incl>\"[^"]*\"   { /* got the include file name */
-       String s (YYText ()+1);
-       s = s.left_string (s.index_last ('"'));
+       std::string s (YYText ()+1);
+       s = s.substr (0, s.rfind ('"'));
 
        new_input (s, sources_);
        yy_pop_state ();
 }
 <incl>\\{BLACK}*{WHITE} { /* got the include identifier */
-       String s = YYText () + 1;
+       std::string s = YYText () + 1;
        strip_trailing_white (s);
        if (s.length () && (s[s.length () - 1] == ';'))
-         s = s.left_string (s.length () - 1);
+         s = s.substr (0, s.length () - 1);
 
        SCM sid = lookup_identifier (s);
        if (scm_is_string (sid)) {
                new_input (ly_scm2string (sid), sources_);
                yy_pop_state ();
        } else { 
-           String msg (_f ("wrong or undefined identifier: `%s'", s ));
+           std::string msg (_f ("wrong or undefined identifier: `%s'", s ));
 
            LexerError (msg.c_str ());
            SCM err = scm_current_error_port ();
@@ -347,15 +347,15 @@ BOM_UTF8  \357\273\277
        }
 
        {DIGIT}         {
-               yylval.i = String_convert::dec2int (String (YYText ()));
+               yylval.i = String_convert::dec2int (std::string (YYText ()));
                return DIGIT;
        }
        {UNSIGNED}              {
-               yylval.i = String_convert::dec2int (String (YYText ()));
+               yylval.i = String_convert::dec2int (std::string (YYText ()));
                return UNSIGNED;
        }
        {E_UNSIGNED}    {
-               yylval.i = String_convert::dec2int (String (YYText () +1));
+               yylval.i = String_convert::dec2int (std::string (YYText () +1));
                return E_UNSIGNED;
        }
        \" {
@@ -378,7 +378,7 @@ BOM_UTF8    \357\273\277
                yy_pop_state ();
 
                /* yylval is union. Must remember STRING before setting SCM*/
-               String *sp = yylval.string;
+               std::string *sp = yylval.string;
                yylval.scm = scm_makfrom0str (sp->c_str ());
                delete sp;
                return STRING;
@@ -399,7 +399,7 @@ BOM_UTF8    \357\273\277
                yy_pop_state ();
 
                /* yylval is union. Must remember STRING before setting SCM*/
-               String *sp = yylval.string;
+               std::string *sp = yylval.string;
                yylval.scm = scm_makfrom0str (sp->c_str ());
                delete sp;
                return LYRICS_STRING;
@@ -418,7 +418,7 @@ BOM_UTF8    \357\273\277
                return FRACTION;
        }
        {UNSIGNED}              {
-               yylval.i = String_convert::dec2int (String (YYText ()));
+               yylval.i = String_convert::dec2int (std::string (YYText ()));
                return UNSIGNED;
        }
        {NOTECOMMAND}   {
@@ -426,7 +426,7 @@ BOM_UTF8    \357\273\277
        }
        {LYRICS} {
                /* ugr. This sux. */
-               String s (YYText ()); 
+               std::string s (YYText ()); 
                if (s == "__")
                        return yylval.i = EXTENDER;
                if (s == "--")
@@ -458,7 +458,7 @@ BOM_UTF8    \357\273\277
                return FRACTION;
        }
        {UNSIGNED}              {
-               yylval.i = String_convert::dec2int (String (YYText ()));
+               yylval.i = String_convert::dec2int (std::string (YYText ()));
                return UNSIGNED;
        }
        \" {
@@ -493,7 +493,7 @@ BOM_UTF8    \357\273\277
                return SCORE;
        }
        {MARKUPCOMMAND} {
-               String str (YYText () + 1);
+               std::string str (YYText () + 1);
                SCM s = lookup_markup_command (str);
 
                if (scm_is_pair (s) && scm_is_symbol (scm_cdr (s)) ) {
@@ -529,7 +529,7 @@ BOM_UTF8    \357\273\277
                return YYText ()[0];
        }
        [^#{}"\\ \t\n\r\f]+ {
-               String s (YYText ()); 
+               std::string s (YYText ()); 
 
                char c = s[s.length () - 1];
                /* brace open is for not confusing dumb tools.  */
@@ -577,7 +577,7 @@ BOM_UTF8    \357\273\277
 }
 
 {UNSIGNED}     {
-       yylval.i = String_convert::dec2int (String (YYText ()));
+       yylval.i = String_convert::dec2int (std::string (YYText ()));
        return UNSIGNED;
 }
 
@@ -627,7 +627,7 @@ BOM_UTF8    \357\273\277
 }
 
 <*>.           {
-       String msg = _f ("invalid character: `%c'", YYText ()[0]);
+       std::string msg = _f ("invalid character: `%c'", YYText ()[0]);
        LexerError (msg.c_str ());
        return YYText ()[0];
 }
@@ -689,7 +689,7 @@ Lily_lexer::identifier_type (SCM sid)
 
 
 int
-Lily_lexer::scan_escaped_word (String str)
+Lily_lexer::scan_escaped_word (std::string str)
 {
        // use more SCM for this.
 
@@ -714,7 +714,7 @@ Lily_lexer::scan_escaped_word (String str)
                return identifier_type (sid);
        }
 
-       String msg (_f ("unknown escaped string: `\\%s'", str));        
+       std::string msg (_f ("unknown escaped string: `\\%s'", str));   
        LexerError (msg.c_str ());
 
        yylval.scm = scm_makfrom0str (str.c_str ());
@@ -723,7 +723,7 @@ Lily_lexer::scan_escaped_word (String str)
 }
 
 int
-Lily_lexer::scan_bare_word (String str)
+Lily_lexer::scan_bare_word (std::string str)
 {
        SCM sym = ly_symbol2scm (str.c_str ());
        if ((YYSTATE == notes) || (YYSTATE == chords)) {
@@ -774,29 +774,29 @@ Lily_lexer::is_figure_state () const
 }
 
 /*
- urg, belong to String (_convert)
+ urg, belong to std::string (_convert)
  and should be generalised 
  */
 void
-strip_leading_white (String&s)
+strip_leading_white (std::string&s)
 {
-       int i = 0;
-       for (;  i < s.length (); i++) 
+       ssize i = 0;
+       for (;  i < s.length (); i++)
                if (!isspace (s[i]))
                        break;
 
-       s = s.nomid_string (0, i);
+       s = s.substr (i);
 }
 
 void
-strip_trailing_white (String&s)
+strip_trailing_white (std::string&s)
 {
-       int i = s.length ();    
+       ssize i = s.length ();  
        while (i--) 
                if (!isspace (s[i]))
                        break;
 
-       s = s.left_string (i+1);
+       s = s.substr (0, i + 1);
 }
 
 
@@ -806,7 +806,7 @@ Lilypond_version oldest_version ("2.3.22");
 
 
 bool
-is_valid_version (String s)
+is_valid_version (std::string s)
 {
   Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
   Lilypond_version ver (s);
@@ -823,25 +823,25 @@ is_valid_version (String s)
 /*
   substitute _ and \,
 */
-String
-lyric_fudge (String s)
+std::string
+lyric_fudge (std::string s)
 {
-  char  * chars  = s.get_copy_str0 ();
+  char *chars = string_copy (s);
 
-  for (char * p = chars; *p ; p++)
+  for (char *p = chars; *p ; p++)
     {
       if (*p == '_' && (p == chars || *(p-1) != '\\'))
        *p = ' ';
     }
   
-  s = String (chars);
+  s = std::string (chars);
   delete[] chars;
 
-  int i = 0;   
-  if ((i = s.index ("\\,")) != -1)   // change "\," to TeX's "\c "
+  ssize i = 0; 
+  if ((i = s.find ("\\,")) != NPOS)   // change "\," to TeX's "\c "
     {
-      * (s.get_str0 () + i + 1) = 'c';
-      s = s.left_string (i+2) + " " + s.right_string (s.length ()-i-2);
+      * (((char*)s.c_str ()) + i + 1) = 'c';
+      s = s.substr (0, i + 2) + " " + s.substr (i - 2);
     }
 
   return s;
@@ -851,12 +851,11 @@ lyric_fudge (String s)
 Convert "NUM/DEN" into a '(NUM . DEN) cons.
 */
 SCM
-scan_fraction (String frac)
+scan_fraction (std::string frac)
 {
-       int i = frac.index ('/');
-       int l = frac.length ();
-       String left = frac.left_string (i);
-       String right = frac.right_string (l - i - 1);
+       ssize i = frac.find ('/');
+       std::string left = frac.substr (0, i);
+       std::string right = frac.substr (i - 1);
 
        int n = String_convert::dec2int (left);
        int d = String_convert::dec2int (right);
@@ -864,7 +863,7 @@ scan_fraction (String frac)
 }
 
 SCM
-lookup_markup_command (String s)
+lookup_markup_command (std::string s)
 {
        SCM proc = ly_lily_module_constant ("lookup-markup-command");
        return scm_call_1 (proc, scm_makfrom0str (s.c_str ()));
index 7649daf1e16cc917739fd615a806f163f247cf39..8c77ceb45694d8cb66079d5bae2d8afea8623a3d 100644 (file)
@@ -8,12 +8,13 @@
 
 #include "ligature-engraver.hh"
 
-#include "spanner.hh"
-#include "score-engraver.hh"
+#include "context.hh"
+#include "international.hh"
 #include "note-head.hh"
 #include "rest.hh"
+#include "score-engraver.hh"
+#include "spanner.hh"
 #include "warn.hh"
-#include "context.hh"
 
 #include "translator.icc"
 
index faa02a66e66ef2fdc0a518d7aa4e607281bf0707..3ab11f3ccc89f17676cc722ab39cc2cdb9f72305 100644 (file)
@@ -75,7 +75,7 @@ ly_quote_scm (SCM s)
   return scm_list_n (ly_symbol2scm ("quote"), s, SCM_UNDEFINED);
 }
 
-String
+std::string
 ly_symbol2string (SCM s)
 {
   /*
@@ -85,15 +85,15 @@ ly_symbol2string (SCM s)
   return ly_scm2string (str);
 }
 
-String
-gulp_file_to_string (String fn, bool must_exist, int size)
+std::string
+gulp_file_to_string (std::string fn, bool must_exist, int size)
 {
-  String s = global_path.find (fn);
+  std::string s = global_path.find (fn);
   if (s == "")
     {
       if (must_exist)
        {
-         String e = _f ("can't find file: `%s'", fn);
+         std::string e = _f ("can't find file: `%s'", fn);
          e += " ";
          e += _f ("(load path: `%s')", global_path.to_string ());
          error (e);
@@ -107,7 +107,7 @@ gulp_file_to_string (String fn, bool must_exist, int size)
 
   int n = size;
   char *str = gulp_file (s, &n);
-  String result ((Byte *) str, n);
+  std::string result (str, n);
   delete[] str;
 
   if (be_verbose_global)
@@ -126,12 +126,12 @@ extern "C" {
   }
 };
 
-String
+std::string
 ly_scm2string (SCM str)
 {
   assert (scm_is_string (str));
-  return String ((Byte *)scm_i_string_chars (str),
-                (int) scm_i_string_length (str));
+  return std::string (scm_i_string_chars (str),
+                    (int) scm_i_string_length (str));
 }
 
 char *
@@ -356,7 +356,7 @@ ly_assoc_cdr (SCM key, SCM alist)
 }
 
 SCM
-ly_string_array_to_scm (Array<Std_string> a)
+ly_string_array_to_scm (Array<std::string> a)
 {
   SCM s = SCM_EOL;
   for (int i = a.size () - 1; i >= 0; i--)
@@ -370,9 +370,9 @@ parse_symbol_list (char const *symbols)
 {
   while (isspace (*symbols))
     *symbols++;
-  String s = symbols;
-  s.substitute ('\n', ' ');
-  s.substitute ('\t', ' ');
+  std::string s = symbols;
+  replace_all (s, '\n', ' ');
+  replace_all (s, '\t', ' ');
   return ly_string_array_to_scm (String_convert::split (s, ' '));
 }
 
@@ -394,14 +394,14 @@ ly_truncate_list (int k, SCM lst)
   return lst;
 }
 
-String
+std::string
 print_scm_val (SCM val)
 {
-  String realval = ly_scm2string (ly_write2scm (val));
+  std::string realval = ly_scm2string (ly_write2scm (val));
   if (realval.length () > 200)
-    realval = realval.left_string (100)
+    realval = realval.substr (0, 100)
       + "\n :\n :\n"
-      + realval.right_string (100);
+      + realval.substr (realval.length () - 100);
   return realval;
 }
 
index 9117decb5f2f84db46929f13207afe894a22ef67..a5c03cf7364474c2a19bce95ef1424f7b660766c 100644 (file)
 #include <sstream>
 using namespace std;
 
-#include "scm-hash.hh"
+#include "international.hh"
 #include "interval.hh"
-#include "parser.hh"
 #include "keyword.hh"
-#include "warn.hh"
-#include "source-file.hh"
 #include "main.hh"
 #include "moment.hh"
+#include "parser.hh"
+#include "scm-hash.hh"
+#include "source-file.hh"
+#include "warn.hh"
 
 static Keyword_ent the_key_tab[]
 = {
@@ -171,7 +172,7 @@ Lily_lexer::set_current_scope ()
 }
 
 int
-Lily_lexer::lookup_keyword (String s)
+Lily_lexer::lookup_keyword (std::string s)
 {
   return keytable_->lookup (s.c_str ());
 }
@@ -190,7 +191,7 @@ Lily_lexer::lookup_identifier_symbol (SCM sym)
 }
 
 SCM
-Lily_lexer::lookup_identifier (String name)
+Lily_lexer::lookup_identifier (std::string name)
 {
   return lookup_identifier_symbol (ly_symbol2scm (name.c_str ()));
 }
@@ -220,7 +221,7 @@ Lily_lexer::set_identifier (SCM name, SCM s)
     {
       if (lookup_keyword (ly_symbol2string (sym)) >= 0)
        {
-         String symstr = ly_symbol2string (sym);
+         std::string symstr = ly_symbol2string (sym);
          warning (_f ("identifier name is a keyword: `%s'", symstr.c_str ()));
        }
 
index 6d615ea915c5e8db9444cc545e94a488926ee439..212ca92e682b8e783323f6d820c2a1b972e22ec8 100644 (file)
@@ -11,6 +11,7 @@
 #include "file-name-map.hh"
 #include "file-name.hh"
 #include "file-path.hh"
+#include "international.hh"
 #include "lily-lexer.hh"
 #include "lily-parser.hh"
 #include "ly-module.hh"
@@ -38,7 +39,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
   char const *file = scm_i_string_chars (name);
   char const *extensions[] = {"ly", "", 0};
 
-  String file_name = global_path.find (file, extensions);
+  std::string file_name = global_path.find (file, extensions);
 
   /* By default, use base name of input file for output file name,
      write output to cwd; do not use root and directory parts of input
@@ -82,13 +83,13 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
        out_file_name = File_name (output_name_global);
     }
 
-  String init;
+  std::string init;
   if (!init_name_global.empty ())
     init = init_name_global;
   else
     init = "init.ly";
 
-  String out_file = out_file_name.to_string ();
+  std::string out_file = out_file_name.to_string ();
 
   if (init.length () && global_path.find (init).empty ())
     {
@@ -109,7 +110,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
       Sources sources;
       sources.set_path (&global_path);
 
-      String mapped_fn = map_file_name (file_name);
+      std::string mapped_fn = map_file_name (file_name);
       message (_f ("Processing `%s'", mapped_fn.c_str ()));
       progress_indication ("\n");
 
index 7ede1f2e7abe21409805047c3897c81f8980506a..39e5c197a633ec08c07d4c3bc17a7ef34adc7362 100644 (file)
@@ -8,19 +8,21 @@
 */
 
 #include "lily-parser.hh"
-#include "text-metrics.hh"
+
 #include "book.hh"
-#include "lilypond-key.hh"
+#include "file-name.hh"
+#include "file-path.hh"
+#include "international.hh"
+#include "lily-lexer.hh"
 #include "lily-version.hh"
+#include "lilypond-key.hh"
 #include "main.hh"
-#include "lily-lexer.hh"
 #include "output-def.hh"
 #include "paper-book.hh"
 #include "parser.hh"
 #include "score.hh"
-#include "file-name.hh"
-#include "file-path.hh"
 #include "source.hh"
+#include "text-metrics.hh"
 #include "warn.hh"
 
 #include "ly-smobs.icc"
@@ -80,7 +82,7 @@ Lily_parser::print_smob (SCM s, SCM port, scm_print_state*)
 
 /* Process one .ly file, or book.  */
 void
-Lily_parser::parse_file (String init, String name, String out_name)
+Lily_parser::parse_file (std::string init, std::string name, std::string out_name)
 {
   if (output_backend_global == "tex")
     try_load_text_metrics (out_name);
@@ -100,7 +102,7 @@ Lily_parser::parse_file (String init, String name, String out_name)
   lexer_->new_input (init, sources_);
 
   File_name f (name);
-  String s = global_path.find (f.base_ + ".twy");
+  std::string s = global_path.find (f.base_ + ".twy");
   s = gulp_file_to_string (s, false, -1);
   scm_eval_string (scm_makfrom0str (s.c_str ()));
 
@@ -130,7 +132,7 @@ Lily_parser::parse_file (String init, String name, String out_name)
 }
 
 void
-Lily_parser::parse_string (String ly_code)
+Lily_parser::parse_string (std::string ly_code)
 {
   // TODO: use $parser 
   lexer_->set_identifier (ly_symbol2scm ("parser"),
@@ -163,14 +165,14 @@ Lily_parser::here_str0 () const
 }
 
 void
-Lily_parser::parser_error (String s)
+Lily_parser::parser_error (std::string s)
 {
   lexer_->here_input ().error (_ (s.c_str ()));
   error_level_ = 1;
 }
 
 void
-Lily_parser::parser_error (Input const &i, String s)
+Lily_parser::parser_error (Input const &i, std::string s)
 {
   i.error (s);
   error_level_ = 1;
index 4cf80766ebe5f731b2791e19c37e514e2cd1be23..28f2fbaa1ac041cb0b3a80b00667dddf5dbf1919 100644 (file)
 #include "config.hh"
 #include "version.hh"
 
-String
+std::string
 version_string ()
 {
-  String str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL;
-  String mpl ("." MY_PATCH_LEVEL);
+  std::string str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL;
+  std::string mpl ("." MY_PATCH_LEVEL);
   if (mpl != ".")
     str += mpl;
   return str;
 }
 
-String
+std::string
 gnu_lilypond_string ()
 {
-  String str = "GNU LilyPond";
+  std::string str = "GNU LilyPond";
   return str;
 }
 
-String
+std::string
 gnu_lilypond_version_string ()
 {
-  String str = gnu_lilypond_string () + " " + version_string ();
+  std::string str = gnu_lilypond_string () + " " + version_string ();
   return str;
 }
 
index ecdb9f4b4c78764732926a7a91b5a412cb053295..f43d247a00e4c2d68354568197ca01c1c1ed445d 100644 (file)
@@ -10,7 +10,7 @@
 
 Lilypond_grob_key::Lilypond_grob_key (Object_key const *context,
                                      Moment start,
-                                     String name,
+                                     std::string name,
                                      int disambiguation_count)
 {
   context_ = context;
@@ -41,7 +41,7 @@ Lilypond_grob_key::do_compare (Object_key const *key) const
   if (c)
     return c;
 
-  c = String::compare (grob_name_, other->grob_name_);
+  c = grob_name_.compare (other->grob_name_);
   if (c)
     return c;
 
@@ -87,8 +87,8 @@ Lilypond_context_key::derived_mark () const
 
 Lilypond_context_key::Lilypond_context_key (Object_key const *parent,
                                            Moment start,
-                                           String type,
-                                           String id,
+                                           std::string type,
+                                           std::string id,
                                            int count)
 {
   disambiguation_count_ = count;
@@ -120,11 +120,11 @@ Lilypond_context_key::do_compare (Object_key const *key) const
   if (c)
     return c;
 
-  c = String::compare (context_name_, other->context_name_);
+  c = context_name_.compare (other->context_name_);
   if (c)
     return c;
 
-  c = String::compare (id_, other->id_);
+  c = id_.compare (other->id_);
   if (c)
     return c;
 
@@ -177,7 +177,7 @@ Lilypond_general_key::derived_mark () const
 }
 
 Lilypond_general_key::Lilypond_general_key (Object_key const *parent,
-                                           String name,
+                                           std::string name,
                                            int count)
 {
   parent_ = parent;
@@ -198,7 +198,7 @@ Lilypond_general_key::do_compare (Object_key const *key)const
   else if (other->parent_)
     return 1;
 
-  int c = String::compare (name_, other->name_);
+  int c = name_.compare (other->name_);
   if (c)
     return c;
 
index da44cba73b1b11b998869e6c38ac8c7068981fd2..984c4e7c80db96f69086598bf631bae3ced3e860 100644 (file)
@@ -19,13 +19,13 @@ Lilypond_version::Lilypond_version (int major, int minor, int patch)
   patch_ = patch;
 }
 
-Lilypond_version::Lilypond_version (String str)
+Lilypond_version::Lilypond_version (std::string str)
 {
   major_ = 0; 
   minor_ = 0;
   patch_ = 0;
   
-  Array<Std_string> version;
+  Array<std::string> version;
   version = String_convert::split (str, '.');
 
   if (version.size () > 0 && isdigit (version[0][0]))
@@ -42,10 +42,10 @@ Lilypond_version::Lilypond_version (String str)
     extra_patch_string_ = version[3];
 }
 
-String
+std::string
 Lilypond_version::to_string () const
 {
-  return ::to_string (major_) + "." + ::to_string (minor_) + "." + ::to_string (patch_);
+  return std::to_string (major_) + "." + std::to_string (minor_) + "." + std::to_string (patch_);
 }
 
 Lilypond_version::operator int () const
index a1ef5ef4325cd572b0a47df621975b13a642e52d..4ed1226b4ce3938fc95fd38685c933c6e48ebab2 100644 (file)
@@ -451,40 +451,40 @@ Stencil
 Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
 {
   Stencil m;
-  String sym = ly_scm2string (scm_car (s));
-  String reg = ly_scm2string (scm_car (scm_cdr (s)));
+  std::string sym = ly_scm2string (scm_car (s));
+  std::string reg = ly_scm2string (scm_car (scm_cdr (s)));
 
   if (sym == "Discant")
     {
       Stencil r = fm->find_by_name ("accordion.accDiscant");
       m.add_stencil (r);
-      if (reg.left_string (1) == "F")
+      if (reg.substr (0, 1) == "F")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
       int eflag = 0x00;
-      if (reg.left_string (3) == "EEE")
+      if (reg.substr (0, 3) == "EEE")
        {
          eflag = 0x07;
-         reg = reg.right_string (reg.length () - 3);
+         reg = reg.substr (3);
        }
-      else if (reg.left_string (2) == "EE")
+      else if (reg.substr (0, 2) == "EE")
        {
          eflag = 0x05;
-         reg = reg.right_string (reg.length () - 2);
+         reg = reg.substr (2);
        }
-      else if (reg.left_string (2) == "Eh")
+      else if (reg.substr (0, 2) == "Eh")
        {
          eflag = 0x04;
-         reg = reg.right_string (reg.length () - 2);
+         reg = reg.substr (2);
        }
-      else if (reg.left_string (1) == "E")
+      else if (reg.substr (0, 1) == "E")
        {
          eflag = 0x02;
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
       if (eflag & 0x02)
        {
@@ -506,7 +506,7 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          d.translate_axis (-0.8 * staff_space PT, X_AXIS);
          m.add_stencil (d);
        }
-      if (reg.left_string (2) == "SS")
+      if (reg.substr (0, 2) == "SS")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (0.5 * staff_space PT, Y_AXIS);
@@ -514,26 +514,26 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          m.add_stencil (d);
          d.translate_axis (-0.8 * staff_space PT, X_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 2);
+         reg = reg.substr (2);
        }
-      if (reg.left_string (1) == "S")
+      if (reg.substr (0, 1) == "S")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (0.5 * staff_space PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
     }
   else if (sym == "Freebase")
     {
       Stencil r = fm->find_by_name ("accordion.accFreebase");
       m.add_stencil (r);
-      if (reg.left_string (1) == "F")
+      if (reg.substr (0, 1) == "F")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
       if (reg == "E")
        {
@@ -546,22 +546,22 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
     {
       Stencil r = fm->find_by_name ("accordion.accBayanbase");
       m.add_stencil (r);
-      if (reg.left_string (1) == "T")
+      if (reg.substr (0, 1) == "T")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
       /* include 4' reed just for completeness. You don't want to use this. */
-      if (reg.left_string (1) == "F")
+      if (reg.substr (0, 1) == "F")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
-      if (reg.left_string (2) == "EE")
+      if (reg.substr (0, 2) == "EE")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
@@ -569,55 +569,55 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          m.add_stencil (d);
          d.translate_axis (-0.8 * staff_space PT, X_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 2);
+         reg = reg.substr (2);
        }
-      if (reg.left_string (1) == "E")
+      if (reg.substr (0, 1) == "E")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
     }
   else if (sym == "Stdbase")
     {
       Stencil r = fm->find_by_name ("accordion.accStdbase");
       m.add_stencil (r);
-      if (reg.left_string (1) == "T")
+      if (reg.substr (0, 1) == "T")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 3.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
-      if (reg.left_string (1) == "F")
+      if (reg.substr (0, 1) == "F")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
-      if (reg.left_string (1) == "M")
+      if (reg.substr (0, 1) == "M")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 2 PT, Y_AXIS);
          d.translate_axis (staff_space PT, X_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
-      if (reg.left_string (1) == "E")
+      if (reg.substr (0, 1) == "E")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
-      if (reg.left_string (1) == "S")
+      if (reg.substr (0, 1) == "S")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length () - 1);
+         reg = reg.substr (1);
        }
     }
   /* ugh maybe try to use regular font for S.B. and B.B and only use one font
index 4968c8255ba261dcd1b9e1b865c79454f066f31d..45db747819a97ff1a58beb522566d7d8513c5673 100644 (file)
@@ -9,7 +9,7 @@
 #include "lily-guile.hh"
 #include "warn.hh"
 #include "main.hh"
-#include "string.hh"
+#include "std-string.hh"
 #include "protected-scm.hh"
 
 #ifdef MODULE_GC_KLUDGE
index 484167c109a4c792166c3c8bb3e76e69ceccd300..4048ed2f26dac76a30e1bd243344317ec15a9a04 100644 (file)
@@ -83,15 +83,15 @@ get_voice_to_lyrics (Context *lyrics)
     return c;
 
   SCM voice_name = lyrics->get_property ("associatedVoice");
-  String nm = lyrics->id_string ();
+  std::string nm = lyrics->id_string ();
 
   if (scm_is_string (voice_name))
     nm = ly_scm2string (voice_name);
   else
     {
-      int idx = nm.index_last ('-');
+      ssize idx = nm.rfind ('-');
       if (idx != NPOS)
-       nm = nm.left_string (idx);
+       nm = nm.substr (0, idx);
     }
 
   Context *parent = lyrics;
index 36ae928b47dc9ac6f72c72594ca36338d52fe27e..73218de4b331c47822db7448bb1f7b9264e7895c 100644 (file)
@@ -33,37 +33,38 @@ using namespace std;
 #include "freetype.hh"
 #include "getopt-long.hh"
 #include "global-ctor.hh"
+#include "international.hh"
 #include "lily-guile.hh"
 #include "lily-version.hh"
 #include "misc.hh"
 #include "output-def.hh"
+#include "program-option.hh"
+#include "relocate.hh"
 #include "string-convert.hh"
 #include "version.hh"
 #include "warn.hh"
-#include "program-option.hh"
-#include "relocate.hh"
 
 /*
  * Global options that can be overridden through command line.
  */
 
 /* Names of header fields to be dumped to a separate file. */
-Array<String> dump_header_fieldnames_global;
+Array<std::string> dump_header_fieldnames_global;
 
 /* Name of initialisation file. */
-String init_name_global;
+std::string init_name_global;
 
 /* Selected output backend
    One of (gnome, ps [default], eps, scm, svg, tex, texstr)") */
-String output_backend_global = "ps";
+std::string output_backend_global = "ps";
 /* Output formats to generate.  */
-String output_format_global = "";
+std::string output_format_global = "";
 
 bool is_pango_format_global;
 bool is_TeX_format_global;
 
 /* Current output name. */
-String output_name_global;
+std::string output_name_global;
 
 /* Run in safe mode? */
 bool be_safe_global = false;
@@ -76,8 +77,8 @@ bool be_verbose_global = false;
 
 /* Scheme code to execute before parsing, after .scm init.
    This is where -e arguments are appended to.  */
-String init_scheme_code_string;
-String init_scheme_variables;
+std::string init_scheme_code_string;
+std::string init_scheme_variables;
 
 /* Generate preview of first system.  */
 bool make_preview = false;
@@ -135,10 +136,10 @@ static char const *WARRANTY
 /* Where the init files live.  Typically:
    LILYPOND_DATADIR = /usr/share/lilypond
 */
-String prefix_directory;
+std::string prefix_directory;
 
 /* The jail specification: USER,GROUP,JAIL,DIR. */
-String jail_spec;
+std::string jail_spec;
 
 /*  The option parser */
 static Getopt_long *option_parser = 0;
@@ -275,9 +276,9 @@ warranty ()
 }
 
 static void
-prepend_load_path (String dir)
+prepend_load_path (std::string dir)
 {
-  String s = "(set! %load-path (cons \"" + dir + "\" %load-path))";
+  std::string s = "(set! %load-path (cons \"" + dir + "\" %load-path))";
   scm_c_eval_string (s.c_str ());
 }
 
@@ -299,7 +300,7 @@ do_chroot_jail ()
       USER_NAME, GROUP_NAME, JAIL, DIR, JAIL_MAX
     };
 
-  Array<Std_string> components = String_convert::split (jail_spec, ',');
+  Array<std::string> components = String_convert::split (jail_spec, ',');
   if (components.size () != JAIL_MAX)
     {
       error (_f ("expected %d arguments with jail, found: %d", JAIL_MAX,
@@ -450,7 +451,7 @@ setup_localisation ()
      Disable localisation of float values.  This breaks TeX output.  */
   setlocale (LC_NUMERIC, "C");
 
-  String localedir = LOCALEDIR;
+  std::string localedir = LOCALEDIR;
   if (char const *env = getenv ("LILYPOND_LOCALEDIR"))
     localedir = env;
 
@@ -460,7 +461,7 @@ setup_localisation ()
 }
 
 static void
-add_output_format (String format)
+add_output_format (std::string format)
 {
   if (output_format_global != "")
     output_format_global += ",";
@@ -477,32 +478,32 @@ parse_argv (int argc, char **argv)
       switch (opt->shortname_char_)
        {
        case 0:
-         if (String (opt->longname_str0_) == "dvi"
-             || String (opt->longname_str0_) == "pdf"
-             || String (opt->longname_str0_) == "png"
-             || String (opt->longname_str0_) == "ps"
-             || String (opt->longname_str0_) == "tex")
+         if (std::string (opt->longname_str0_) == "dvi"
+             || std::string (opt->longname_str0_) == "pdf"
+             || std::string (opt->longname_str0_) == "png"
+             || std::string (opt->longname_str0_) == "ps"
+             || std::string (opt->longname_str0_) == "tex")
            add_output_format (opt->longname_str0_);
-         else if (String (opt->longname_str0_) == "preview")
+         else if (std::string (opt->longname_str0_) == "preview")
            make_preview = true;
-         else if (String (opt->longname_str0_) == "no-pages")
+         else if (std::string (opt->longname_str0_) == "no-pages")
            make_print = false;
-         else if (String (opt->longname_str0_) == "relocate")
+         else if (std::string (opt->longname_str0_) == "relocate")
            relocate_binary = true;
          break;
 
        case 'd':
          {
-           String arg (option_parser->optional_argument_str0_);
-           int eq = arg.index ('=');
+           std::string arg (option_parser->optional_argument_str0_);
+           ssize eq = arg.find ('=');
 
-           String key = arg;
-           String val = "#t";
+           std::string key = arg;
+           std::string val = "#t";
 
            if (eq != NPOS)
              {
-               key = arg.left_string (eq);
-               val = arg.right_string (arg.length () - eq - 1);
+               key = arg.substr (0, eq);
+               val = arg.substr (eq + 1);
              }
 
            init_scheme_variables
@@ -516,7 +517,7 @@ parse_argv (int argc, char **argv)
          break;
        case 'o':
          {
-           String s = option_parser->optional_argument_str0_;
+           std::string s = option_parser->optional_argument_str0_;
            File_name file_name (s);
            output_name_global = file_name.to_string ();
          }
index 2715cf8ad036f8346b5cdf238c029373326da276..2a4fbe351048efaedc63ef1ef0783c0ea40eadab 100644 (file)
@@ -11,13 +11,14 @@ using namespace std;
 
 #include "engraver.hh"
 
+#include "axis-group-interface.hh"
 #include "bar-line.hh"
 #include "context.hh"
+#include "grob-array.hh"
+#include "international.hh"
 #include "item.hh"
-#include "warn.hh"
 #include "text-interface.hh"
-#include "grob-array.hh"
-#include "axis-group-interface.hh"
+#include "warn.hh"
 
 /**
    put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
index 79b6ccdf2b474cd80b8f07d0b144842060526263..92bcf5840588012b29fc87580af0bb815fadc9e9 100644 (file)
@@ -8,17 +8,18 @@
 */
 
 #include "coherent-ligature-engraver.hh"
+#include "font-interface.hh"
+#include "international.hh"
 #include "mensural-ligature.hh"
 #include "music.hh"
-#include "warn.hh"
-#include "spanner.hh"
-#include "paper-column.hh"
 #include "note-column.hh"
-#include "rhythmic-head.hh"
 #include "note-head.hh"
-#include "staff-symbol-referencer.hh"
 #include "output-def.hh"
-#include "font-interface.hh"
+#include "paper-column.hh"
+#include "rhythmic-head.hh"
+#include "spanner.hh"
+#include "staff-symbol-referencer.hh"
+#include "warn.hh"
 
 /*
  * TODO: accidentals are aligned with the first note;
index 36e5ef2026a868c895dc7ac3fc79a5887082f512..aeb0194a3b91ae45e30fb209bf67d1859a8fd2d8 100644 (file)
@@ -7,14 +7,15 @@
   Pal Benko <benkop@freestart.hu>
 */
 
-
 #include "mensural-ligature.hh"
-#include "item.hh"
+
 #include "font-interface.hh"
+#include "international.hh"
+#include "item.hh"
 #include "lookup.hh"
-#include "staff-symbol-referencer.hh"
 #include "note-head.hh"
 #include "output-def.hh"
+#include "staff-symbol-referencer.hh"
 #include "warn.hh"
 
 /*
index d094899dc31e3b0840fd0075bcf260aa6587e9f2..34184b636a1602a4ae526adbf752cb9a366c9944 100644 (file)
@@ -8,13 +8,14 @@
 
 #include "midi-item.hh"
 
-#include "warn.hh"
+#include "duration.hh"
+#include "international.hh"
 #include "main.hh"
-#include "misc.hh"
-#include "string-convert.hh"
 #include "midi-stream.hh"
-#include "duration.hh"
+#include "misc.hh"
 #include "program-option.hh"
+#include "string-convert.hh"
+#include "warn.hh"
 
 #include "killing-cons.tcc"
 
@@ -51,25 +52,25 @@ Midi_item::get_midi (Audio_item *a)
 }
 
 void
-Midi_chunk::set (String header_string, String data_string, String footer_string)
+Midi_chunk::set (std::string header_string, std::string data_string, std::string footer_string)
 {
   data_string_ = data_string;
   footer_string_ = footer_string;
   header_string_ = header_string;
 }
 
-String
+std::string
 Midi_chunk::data_string () const
 {
   return data_string_;
 }
 
-String
+std::string
 Midi_chunk::to_string () const
 {
-  String str = header_string_;
-  String dat = data_string ();
-  String length_string = String_convert::int2hex (dat.length ()
+  std::string str = header_string_;
+  std::string dat = data_string ();
+  std::string length_string = String_convert::int2hex (dat.length ()
                                                  + footer_string_.length (), 8, '0');
   length_string = String_convert::hex2bin (length_string);
 
@@ -85,10 +86,10 @@ Midi_duration::Midi_duration (Real seconds_f)
   seconds_ = seconds_f;
 }
 
-String
+std::string
 Midi_duration::to_string () const
 {
-  return String ("<duration: ") + ::to_string (seconds_) + ">";
+  return std::string ("<duration: ") + std::to_string (seconds_) + ">";
 }
 
 Midi_event::Midi_event (Moment delta_mom, Midi_item *midi)
@@ -100,30 +101,30 @@ Midi_event::Midi_event (Moment delta_mom, Midi_item *midi)
 /*
   ugh. midi output badly broken since grace note hackage.
 */
-String
+std::string
 Midi_event::to_string () const
 {
   Rational rat_dt = (delta_mom_.main_part_ * Rational (384)
                     + delta_mom_.grace_part_ * Rational (100)) * Rational (4);
   int delta_i = rat_dt.to_int ();
 
-  String delta_string = Midi_item::i2varint_string (delta_i);
-  String midi_string = midi_->to_string ();
+  std::string delta_string = Midi_item::i2varint_string (delta_i);
+  std::string midi_string = midi_->to_string ();
   assert (midi_string.length ());
   return delta_string + midi_string;
 }
 
 Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
 {
-  String str;
+  std::string str;
 
-  String format_string = String_convert::int2hex (format_i, 4, '0');
+  std::string format_string = String_convert::int2hex (format_i, 4, '0');
   str += String_convert::hex2bin (format_string);
 
-  String tracks_string = String_convert::int2hex (tracks_i, 4, '0');
+  std::string tracks_string = String_convert::int2hex (tracks_i, 4, '0');
   str += String_convert::hex2bin (tracks_string);
 
-  String tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0');
+  std::string tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0');
   str += String_convert::hex2bin (tempo_string);
 
   set ("MThd", str, "");
@@ -132,10 +133,10 @@ Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
 Midi_instrument::Midi_instrument (Audio_instrument *a)
 {
   audio_ = a;
-  audio_->str_.to_lower ();
+  audio_->str_ = String_convert::to_lower (audio_->str_);
 }
 
-String
+std::string
 Midi_instrument::to_string () const
 {
   Byte program_byte = 0;
@@ -152,8 +153,8 @@ Midi_instrument::to_string () const
   else
     warning (_f ("no such MIDI instrument: `%s'", audio_->str_.c_str ()));
 
-  String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz
-  str += ::to_string ((char)program_byte);
+  std::string str = std::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz
+  str += std::to_string ((char)program_byte);
   return str;
 }
 
@@ -166,7 +167,7 @@ Midi_item::~Midi_item ()
 {
 }
 
-String
+std::string
 Midi_item::i2varint_string (int i)
 {
   int buffer_i = i & 0x7f;
@@ -177,10 +178,10 @@ Midi_item::i2varint_string (int i)
       buffer_i += (i & 0x7f);
     }
 
-  String str;
+  std::string str;
   while (1)
     {
-      str += ::to_string ((char)buffer_i);
+      str += std::to_string ((char)buffer_i);
       if (buffer_i & 0x80)
        buffer_i >>= 8;
       else
@@ -194,10 +195,10 @@ Midi_key::Midi_key (Audio_key *a)
   audio_ = a;
 }
 
-String
+std::string
 Midi_key::to_string () const
 {
-  String str = "ff5902";
+  std::string str = "ff5902";
   str += String_convert::int2hex (audio_->accidentals_, 2, '0');
   if (audio_->major_)
     str += String_convert::int2hex (0, 2, '0');
@@ -212,13 +213,13 @@ Midi_time_signature::Midi_time_signature (Audio_time_signature *a)
   clocks_per_1_ = 18;
 }
 
-String
+std::string
 Midi_time_signature::to_string () const
 {
   int num = audio_->beats_;
   int den = audio_->one_beat_;
 
-  String str = "ff5804";
+  std::string str = "ff5804";
   str += String_convert::int2hex (num, 2, '0');
   str += String_convert::int2hex (intlog2 (den), 2, '0');
   str += String_convert::int2hex (clocks_per_1_, 2, '0');
@@ -260,11 +261,11 @@ Midi_note::get_pitch () const
   return p;
 }
 
-String
+std::string
 Midi_note::to_string () const
 {
   Byte status_byte = (char) (0x90 + channel_);
-  String str = "";
+  std::string str = "";
   int finetune;
 
   // print warning if fine tuning was needed, HJJ
@@ -278,15 +279,15 @@ Midi_note::to_string () const
       // The pitch wheel range (of 4 semitones) is multiplied by the cents.
       finetune += (PITCH_WHEEL_RANGE *get_fine_tuning ()) / (4 * 100);
 
-      str += ::to_string ((char) (0xE0 + channel_));
-      str += ::to_string ((char) (finetune & 0x7F));
-      str += ::to_string ((char) (finetune >> 7));
-      str += ::to_string ((char) (0x00));
+      str += std::to_string ((char) (0xE0 + channel_));
+      str += std::to_string ((char) (finetune & 0x7F));
+      str += std::to_string ((char) (finetune >> 7));
+      str += std::to_string ((char) (0x00));
     }
 
-  str += ::to_string ((char)status_byte);
-  str += ::to_string ((char) (get_pitch () + c0_pitch_i_));
-  str += ::to_string ((char)dynamic_byte_);
+  str += std::to_string ((char)status_byte);
+  str += std::to_string ((char) (get_pitch () + c0_pitch_i_));
+  str += std::to_string ((char)dynamic_byte_);
 
   return str;
 }
@@ -304,22 +305,22 @@ Midi_note_off::Midi_note_off (Midi_note *n)
   aftertouch_byte_ = 64;
 }
 
-String
+std::string
 Midi_note_off::to_string () const
 {
   Byte status_byte = (char) (0x80 + channel_);
 
-  String str = ::to_string ((char)status_byte);
-  str += ::to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_));
-  str += ::to_string ((char)aftertouch_byte_);
+  std::string str = std::to_string ((char)status_byte);
+  str += std::to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_));
+  str += std::to_string ((char)aftertouch_byte_);
 
   if (get_fine_tuning () != 0)
     {
       // Move pitch wheel back to the central position.
-      str += ::to_string ((char) 0x00);
-      str += ::to_string ((char) (0xE0 + channel_));
-      str += ::to_string ((char) (PITCH_WHEEL_CENTER &0x7F));
-      str += ::to_string ((char) (PITCH_WHEEL_CENTER >> 7));
+      str += std::to_string ((char) 0x00);
+      str += std::to_string ((char) (0xE0 + channel_));
+      str += std::to_string ((char) (PITCH_WHEEL_CENTER &0x7F));
+      str += std::to_string ((char) (PITCH_WHEEL_CENTER >> 7));
     }
 
   return str;
@@ -330,11 +331,11 @@ Midi_dynamic::Midi_dynamic (Audio_dynamic *a)
   audio_ = a;
 }
 
-String
+std::string
 Midi_dynamic::to_string () const
 {
   Byte status_byte = (char) (0xB0 + channel_);
-  String str = ::to_string ((char)status_byte);
+  std::string str = std::to_string ((char)status_byte);
 
   /*
     Main volume controller (per channel):
@@ -349,8 +350,8 @@ Midi_dynamic::to_string () const
   if (volume > full_scale)
     volume = (int)full_scale;
 
-  str += ::to_string ((char)0x07);
-  str += ::to_string ((char)volume);
+  str += std::to_string ((char)0x07);
+  str += std::to_string ((char)volume);
   return str;
 }
 
@@ -359,21 +360,21 @@ Midi_piano_pedal::Midi_piano_pedal (Audio_piano_pedal *a)
   audio_ = a;
 }
 
-String
+std::string
 Midi_piano_pedal::to_string () const
 {
   Byte status_byte = (char) (0xB0 + channel_);
-  String str = ::to_string ((char)status_byte);
+  std::string str = std::to_string ((char)status_byte);
 
   if (audio_->type_string_ == "Sostenuto")
-    str += ::to_string ((char)0x42);
+    str += std::to_string ((char)0x42);
   else if (audio_->type_string_ == "Sustain")
-    str += ::to_string ((char)0x40);
+    str += std::to_string ((char)0x40);
   else if (audio_->type_string_ == "UnaCorda")
-    str += ::to_string ((char)0x43);
+    str += std::to_string ((char)0x43);
 
   int pedal = ((1 - audio_->dir_) / 2) * 0x7f;
-  str += ::to_string ((char)pedal);
+  str += std::to_string ((char)pedal);
   return str;
 }
 
@@ -382,11 +383,11 @@ Midi_tempo::Midi_tempo (Audio_tempo *a)
   audio_ = a;
 }
 
-String
+std::string
 Midi_tempo::to_string () const
 {
   int useconds_per_4_i = 60 * (int)1e6 / audio_->per_minute_4_;
-  String str = "ff5103";
+  std::string str = "ff5103";
   str += String_convert::int2hex (useconds_per_4_i, 6, '0');
   return String_convert::hex2bin (str);
 }
@@ -396,10 +397,10 @@ Midi_text::Midi_text (Audio_text *a)
   audio_ = a;
 }
 
-String
+std::string
 Midi_text::to_string () const
 {
-  String str = "ff" + String_convert::int2hex (audio_->type_, 2, '0');
+  std::string str = "ff" + String_convert::int2hex (audio_->type_, 2, '0');
   str = String_convert::hex2bin (str);
   str += i2varint_string (audio_->text_string_.length ());
   str += audio_->text_string_;
@@ -435,12 +436,12 @@ Midi_track::Midi_track ()
     //                           "00" "ff59" "02" "ff" "00"
     ;
 
-  String data_string;
+  std::string data_string;
   // only for format 0 (currently using format 1)?
   data_string += String_convert::hex2bin (data_str0);
 
   char const *footer_str0 = "00" "ff2f" "00";
-  String footer_string = String_convert::hex2bin (footer_str0);
+  std::string footer_string = String_convert::hex2bin (footer_str0);
 
   set ("MTrk", data_string, footer_string);
 }
@@ -454,10 +455,10 @@ Midi_track::add (Moment delta_time_mom, Midi_item *midi)
   event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
 }
 
-String
+std::string
 Midi_track::data_string () const
 {
-  String str = Midi_chunk::data_string ();
+  std::string str = Midi_chunk::data_string ();
   if (do_midi_debugging_global)
     str += "\n";
   for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_)
index b139c8239ea4efb48c6dc3abf863a9bc6d666faf..b03d63b7214731e27aac12040b7e0c146b9b2e7a 100644 (file)
 #include <cerrno>
 using namespace std;
 
-#include "stream.hh"
-#include "string-convert.hh"
+#include "international.hh"
 #include "main.hh"
-#include "misc.hh"
 #include "midi-item.hh"
-#include "warn.hh"
+#include "misc.hh"
 #include "program-option.hh"
+#include "stream.hh"
+#include "string-convert.hh"
+#include "warn.hh"
 
-Midi_stream::Midi_stream (String file_name)
+Midi_stream::Midi_stream (std::string file_name)
 {
   file_name_string_ = file_name;
   out_file_ = fopen (file_name.c_str (), "wb");
@@ -33,12 +34,11 @@ Midi_stream::~Midi_stream ()
 }
 
 Midi_stream &
-Midi_stream::operator << (String str)
+Midi_stream::operator << (std::string str)
 {
   size_t sz = sizeof (Byte);
   size_t n = str.length ();
-  size_t written = fwrite (str.get_bytes (),
-                          sz, n, out_file_);
+  size_t written = fwrite (str.data (), sz, n, out_file_);
 
   if (written != sz * n)
     warning (_ ("can't write to file: `%s'"));
@@ -49,13 +49,13 @@ Midi_stream::operator << (String str)
 Midi_stream &
 Midi_stream::operator << (Midi_item const &midi_c_r)
 {
-  String str = midi_c_r.to_string ();
+  std::string str = midi_c_r.to_string ();
 
   // ugh, should have separate debugging output with Midi*::print routines
   if (do_midi_debugging_global)
     {
       str = String_convert::bin2hex (str) + "\n";
-      for (int i = str.index ("0a"); i != NPOS; i = str.index ("0a"))
+      for (ssize i = str.find ("0a"); i != NPOS; i = str.find ("0a"))
        {
          str[i] = '\n';
          str[i + 1] = '\t';
index d605eb88a5fa9ec3fec46a339da4b9f5a7b0836c..607cbe99534ccc246d421cf725bec332144b643a 100644 (file)
@@ -9,7 +9,7 @@
 
 
 #include "misc.hh"
-#include "string.hh"
+#include "std-string.hh"
 
 /*
   Return the 2-log, rounded down
@@ -35,25 +35,25 @@ log_2 (double x)
   return log (x) / log (2.0);
 }
 
-Array<String>
-split_string (String s, char c)
+Array<std::string>
+split_string (std::string s, char c)
 {
-  Array<String> rv;
+  Array<std::string> rv;
   while (s.length ())
     {
-      int i = s.index (c);
+      ssize i = s.find (c);
 
       if (i == 0)
        {
-         s = s.nomid_string (0, 1);
+         s = s.substr (1);
          continue;
        }
 
       if (i == NPOS)
        i = s.length ();
 
-      rv.push (s.cut_string (0, i));
-      s = s.nomid_string (0, i);
+      rv.push (s.substr (0, i));
+      s = s.substr (i);
     }
 
   return rv;
index 74f744d87240359fbb13a4a747fedf2270a1679e..771ec857e9142dbdedab1db82174476f0e727b22 100644 (file)
@@ -66,7 +66,7 @@ Modified_font_metric::count () const
 }
 
 Offset
-Modified_font_metric::attachment_point (String s) const
+Modified_font_metric::attachment_point (std::string s) const
 {
   Offset o = orig_->attachment_point (s);
   return o * magnification_;
@@ -80,7 +80,7 @@ Modified_font_metric::get_indexed_wxwy (int k) const
 }
 
 int
-Modified_font_metric::name_to_index (String s) const
+Modified_font_metric::name_to_index (std::string s) const
 {
   return orig_->name_to_index (s);
 }
@@ -104,17 +104,17 @@ Modified_font_metric::derived_mark () const
 
 /* TODO: put this klutchness behind ly:option switch.  */
 Box
-Modified_font_metric::tex_kludge (String text) const
+Modified_font_metric::tex_kludge (std::string text) const
 {
   Interval ydims;
   Real w = 0;
-  for (int i = 0; i < text.length (); i++)
+  for (ssize i = 0; i < text.length (); i++)
     {
       switch (text[i])
        {
        case '\\':
          /* Accent marks use width of base letter */
-         if (i +1 < text.length ())
+         if (i < text.length () - 1)
            {
              if (text[i + 1]=='\'' || text[i + 1]=='`' || text[i + 1]=='"'
                  || text[i + 1]=='^')
@@ -159,7 +159,7 @@ Modified_font_metric::tex_kludge (String text) const
 }
 
 Stencil
-Modified_font_metric::text_stencil (String text) const
+Modified_font_metric::text_stencil (std::string text) const
 {
   Box b;
   if (Pango_font *pf = dynamic_cast<Pango_font *> (orig_))
@@ -177,7 +177,7 @@ Modified_font_metric::text_stencil (String text) const
 }
 
 Box
-Modified_font_metric::text_dimension (String text) const
+Modified_font_metric::text_dimension (std::string text) const
 {
   SCM stext = scm_makfrom0str (text.c_str ());
   Box b = lookup_tex_text_dimension (orig_, stext);
@@ -197,7 +197,7 @@ Modified_font_metric::text_dimension (String text) const
 
   Real w = 0.0;
 
-  for (int i = 0; i < text.length (); i++)
+  for (ssize i = 0; i < text.length (); i++)
     {
       Box b = get_ascii_char ((unsigned char)text[i]);
 
@@ -223,7 +223,7 @@ Modified_font_metric::sub_fonts () const
   return orig_->sub_fonts ();
 }
 
-String
+std::string
 Modified_font_metric::font_name () const
 {
   return original_font ()->font_name ();
index c8a9002a638ed70b62003233477fc56cf00b9bf1..0d64fa52905df0dba49710285737942302aa8078 100644 (file)
@@ -9,7 +9,7 @@
 #include "lily-guile.hh"
 #include "warn.hh"
 #include "main.hh"
-#include "string.hh"
+#include "std-string.hh"
 
 #include "ly-module.hh"
 
index f0d34b8bc1562b719fc37d6f132027125a8afa87..1bab8f8fc57c25a197122cf9976865e702933379 100644 (file)
@@ -49,7 +49,7 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *)
   Moment *r = (Moment *) SCM_CELL_WORD_1 (s);
 
   scm_puts ("#<Mom ", port);
-  String str = r->to_string ();
+  std::string str = r->to_string ();
   scm_puts ((char *)str.c_str (), port);
   scm_puts (">", port);
 
@@ -153,10 +153,10 @@ Moment::set_infinite (int k)
   main_part_.set_infinite (k);
 }
 
-String
+std::string
 Moment::to_string () const
 {
-  String s = main_part_.to_string ();
+  std::string s = main_part_.to_string ();
   if (grace_part_)
     s += "G" + grace_part_.to_string ();
   return s;
index 4f49a05519775cae7093c7352755cbcfd67468fc..984edc9c0f3099c5bcc6505ac3894931613cd2d6 100644 (file)
@@ -35,7 +35,7 @@ LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
 {
   extern SCM ly_music_p_proc;
   
-  String str = "";
+  std::string str = "";
   for (SCM s = signature; scm_is_pair (s); s = scm_cdr (s))
     {
       if (str != "")
index cf48775f00ee06fb0ac2d74f33a1dc4b255793d2..715df36c36a7f3c4dfc9028bb1fdbd5c3e6b2eb3 100644 (file)
@@ -7,11 +7,13 @@
 */
 
 #include "music.hh"
-#include "music-sequence.hh"
+
 #include "duration.hh"
 #include "input-smob.hh"
+#include "international.hh"
 #include "ly-smobs.icc"
 #include "main.hh"
+#include "music-sequence.hh"
 #include "pitch.hh"
 #include "score.hh"
 #include "warn.hh"
index 934d4e40cfa95f90b59f046b92f8aa993a34db4f..0b796673e8932604bad82c27800acd0efd672370 100644 (file)
@@ -6,14 +6,16 @@
   (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "warn.hh"
 #include "engraver.hh"
-#include "side-position-interface.hh"
-#include "stem.hh"
+
+#include "international.hh"
 #include "rhythmic-head.hh"
-#include "self-alignment-interface.hh"
 #include "script-interface.hh"
+#include "self-alignment-interface.hh"
+#include "side-position-interface.hh"
 #include "stem.hh"
+#include "stem.hh"
+#include "warn.hh"
 
 #include "translator.icc"
 
index 0603ea7ea56899ec03b80fd7b91d7529687e7f48..0adccba96d02931199c89651ce746cc68e0b99d6 100644 (file)
@@ -7,10 +7,11 @@
 */
 
 #include "context.hh"
-#include "music.hh"
 #include "grob.hh"
-#include "music-iterator.hh"
 #include "input.hh"
+#include "international.hh"
+#include "music-iterator.hh"
+#include "music.hh"
 
 class Lyric_combine_music_iterator : public Music_iterator
 {
@@ -182,7 +183,7 @@ Lyric_combine_music_iterator::find_voice ()
       while (t && t->get_parent_context ())
        t = t->get_parent_context ();
 
-      String name = ly_scm2string (voice_name);
+      std::string name = ly_scm2string (voice_name);
       Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
 
       if (voice)
@@ -236,7 +237,7 @@ Lyric_combine_music_iterator::do_quit ()
     {
       SCM voice_name = get_music ()->get_property ("associated-context");
 
-      String name;
+      std::string name;
       if (scm_is_string (voice_name))
        name = ly_scm2string (voice_name);
 
index cdd5bf7423ac49cc35ce36aaf64a165945f029ae..99be0410ddc040a23e41270a4b6d7922377a720b 100644 (file)
@@ -8,18 +8,17 @@
 
 #include "note-collision.hh"
 
-
-#include "warn.hh"
+#include "axis-group-interface.hh"
+#include "dot-column.hh"
+#include "international.hh"
 #include "note-column.hh"
 #include "note-head.hh"
-#include "rhythmic-head.hh"
 #include "output-def.hh"
-#include "axis-group-interface.hh"
-#include "stem.hh"
-#include "side-position-interface.hh"
-#include "dot-column.hh"
 #include "pointer-group-interface.hh"
-
+#include "rhythmic-head.hh"
+#include "side-position-interface.hh"
+#include "stem.hh"
+#include "warn.hh"
 
 
 void
index 2b84370faa42a479a6d6831df4326c3fda96d416..8d4204b674a7a941e2b64df18b797207a7ef8237 100644 (file)
 #include <cmath>               // ceil
 using namespace std;
 
+#include "accidental-placement.hh"
 #include "axis-group-interface.hh"
-#include "stem.hh"
-#include "warn.hh"
-#include "output-def.hh"
-#include "staff-symbol-referencer.hh"
-#include "rest.hh"
+#include "directional-element-interface.hh"
+#include "international.hh"
 #include "note-head.hh"
-#include "accidental-placement.hh"
+#include "output-def.hh"
 #include "pointer-group-interface.hh"
-#include "directional-element-interface.hh"
+#include "rest.hh"
+#include "staff-symbol-referencer.hh"
+#include "stem.hh"
+#include "warn.hh"
 
 /*
   TODO: figure out if we can prune this class. This is just an
index b1cbf0d7caa409c60aefac528ab3f33bc76e6dcf..5a0c9abf8465c5ee4c106b5f5f0fcb3484d9b668 100644 (file)
 using namespace std;
 
 #include "directional-element-interface.hh"
-#include "staff-symbol.hh"
-#include "misc.hh"
 #include "dots.hh"
-#include "warn.hh"
 #include "font-interface.hh"
+#include "international.hh"
+#include "lookup.hh"
+#include "misc.hh"
 #include "music.hh"
+#include "output-def.hh"
 #include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
-#include "lookup.hh"
-#include "output-def.hh"
+#include "staff-symbol.hh"
+#include "warn.hh"
 
 /*
   clean up the mess left by ledger line handling.
 */
 static Stencil
-internal_print (Grob *me, String *font_char)
+internal_print (Grob *me, std::string *font_char)
 {
   SCM style = me->get_property ("style");
   if (!scm_is_symbol (style))
     style = ly_symbol2scm ("default");
 
-  String suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
+  std::string suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
   if (style != ly_symbol2scm ("default"))
     {
       SCM gn = me->get_property ("glyph-name");
@@ -45,12 +46,12 @@ internal_print (Grob *me, String *font_char)
 
   Font_metric *fm = Font_interface::get_default_font (me);
 
-  String idx = "noteheads.s" + suffix;
+  std::string idx = "noteheads.s" + suffix;
 
   Stencil out = fm->find_by_name (idx);
   if (out.is_empty ())
     {
-      String prefix = "noteheads.";
+      std::string prefix = "noteheads.";
       Grob *stem = unsmob_grob (me->get_object ("stem"));
       Direction stem_dir = stem ? get_grob_direction (stem) : CENTER;
 
@@ -93,7 +94,7 @@ Note_head::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
-  String idx;
+  std::string idx;
   return internal_print (me, &idx).smobbed_copy ();
 }
 
@@ -112,7 +113,7 @@ Note_head::calc_stem_attachment (SCM smob)
 {
   Grob *me  = unsmob_grob (smob);
   Font_metric *fm = Font_interface::get_default_font (me);
-  String key;
+  std::string key;
   internal_print (me, &key);
 
   Offset att;
index 8946a43a82a8c54f79b432487e8c690d373653bf..b464eeefcf7bba9fb5aa853d3da96e58a9b72f29 100644 (file)
@@ -35,7 +35,7 @@ Note_name_engraver::try_music (Music *m)
 void
 Note_name_engraver::process_music ()
 {
-  String s;
+  std::string s;
   for (int i = 0; i < events_.size (); i++)
     {
       if (i)
index 5eb45a76a8adc2596116f84856ff229dd3064f02..b2692d994b6d4c5de60845b713c3a02acb66e918 100644 (file)
@@ -51,12 +51,12 @@ LY_DEFINE (ly_otf_font_table_data, "ly:otf-font-table-data", 2, 0, 0,
 
   char ctag [5] = "    ";
 
-  String tag_string = ly_scm2string (tag);
+  std::string tag_string = ly_scm2string (tag);
   strncpy (ctag, tag_string.c_str (), tag_string.length ());
 
-  String tab = otf->get_otf_table (String (ctag));
+  std::string tab = otf->get_otf_table (std::string (ctag));
 
-  return scm_from_locale_stringn ((char const *) tab.to_bytes (), tab.length ());
+  return scm_from_locale_stringn ((char const *) tab.data (), tab.length ());
 }
 
 LY_DEFINE (ly_otf_font_p, "ly:otf-font?", 1, 0, 0,
index 7f165ce8fcd4fa2aa71662ccb5f4478ab922dc0c..1a9623cdf014b77d81b8f29ba73ed2e40100e872 100644 (file)
@@ -15,6 +15,7 @@ using namespace std;
 #include <freetype/tttables.h>
 
 #include "dimensions.hh"
+#include "international.hh"
 #include "modified-font-metric.hh"
 #include "warn.hh"
 
@@ -43,8 +44,8 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length)
   return 0;
 }
 
-String
-Open_type_font::get_otf_table (String tag) const
+std::string
+Open_type_font::get_otf_table (std::string tag) const
 {
   return ::get_otf_table (face_, tag);
 }
@@ -58,7 +59,7 @@ load_scheme_table (char const *tag_str, FT_Face face)
   SCM tab = SCM_EOL;
   if (buffer)
     {
-      String contents ((Byte const *)buffer, length);
+      std::string contents ((char const*)buffer, length);
       contents = "(quote (" + contents + "))";
 
       tab = scm_c_eval_string (contents.c_str ());
@@ -88,17 +89,17 @@ Open_type_font::~Open_type_font ()
 /*
   UGH fix naming
 */
-String
-get_otf_table (FT_Face face, String tag)
+std::string
+get_otf_table (FT_Face face, std::string tag)
 {
   FT_ULong len;
   FT_Byte *tab = load_table (tag.c_str (), face, &len);
 
-  return String (tab, len);
+  return std::string ((char const*) tab, len);
 }
 
 FT_Face
-open_ft_face (String str)
+open_ft_face (std::string str)
 {
   FT_Face face;
   int error_code = FT_New_Face (freetype2_library, str.c_str (), 0, &face);
@@ -112,7 +113,7 @@ open_ft_face (String str)
 }
 
 SCM
-Open_type_font::make_otf (String str)
+Open_type_font::make_otf (std::string str)
 {
   FT_Face face = open_ft_face (str);
   Open_type_font *otf = new Open_type_font (face);
@@ -146,7 +147,7 @@ Open_type_font::derived_mark () const
 }
 
 Offset
-Open_type_font::attachment_point (String glyph_name) const
+Open_type_font::attachment_point (std::string glyph_name) const
 {
   SCM sym = ly_symbol2scm (glyph_name.c_str ());
   SCM entry = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F);
@@ -222,7 +223,7 @@ Open_type_font::get_indexed_char (int signed_idx) const
 }
 
 int
-Open_type_font::name_to_index (String nm) const
+Open_type_font::name_to_index (std::string nm) const
 {
   char *nm_str = (char *) nm.c_str ();
   if (int idx = FT_Get_Name_Index (face_, nm_str))
@@ -282,7 +283,7 @@ Open_type_font::get_global_table () const
   return lily_global_table_;
 }
 
-String
+std::string
 Open_type_font::font_name () const
 {
   return FT_Get_Postscript_Name (face_);
index eda08dd7b4a05d3b3709012756a51cc0d524e053..99015153f9cf90bc54b8b0adfec79fd6f261ad05 100644 (file)
@@ -127,7 +127,7 @@ Output_def::lookup_variable (SCM sym) const
 }
 
 SCM
-Output_def::c_variable (String s) const
+Output_def::c_variable (std::string s) const
 {
   return lookup_variable (ly_symbol2scm (s.c_str ()));
 }
index feffeedd2f61cf6b8e2ec2cdf85c898207558491..a08b88413c6c94bcba036d0c2c86fed67edf4752 100644 (file)
@@ -6,8 +6,10 @@
   (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
  */
 
-#include "input.hh"
 #include "simple-music-iterator.hh"
+
+#include "input.hh"
+#include "international.hh"
 #include "music.hh"
 
 class Output_property_music_iterator : public Simple_music_iterator
index e97c914b24d9b8230ddf4b9acfc473891157cc7d..da0f1022d2a744a52f37d20221add4cfbe96bbf4 100644 (file)
 
 #include "dimensions.hh"
 #include "file-name.hh"
+#include "international.hh"
 #include "lookup.hh"
 #include "main.hh"
+#include "string-convert.hh"
 #include "warn.hh"
 
 #if HAVE_PANGO_FT2
@@ -60,7 +62,7 @@ Pango_font::~Pango_font ()
 }
 
 void
-Pango_font::register_font_file (String filename, String ps_name)
+Pango_font::register_font_file (std::string filename, std::string ps_name)
 {
   scm_hash_set_x (physical_font_tab_,
                  scm_makfrom0str (ps_name.c_str ()),
@@ -74,7 +76,7 @@ Pango_font::derived_mark () const
 }
 
 Stencil
-Pango_font::pango_item_string_stencil (PangoItem const *item, String str) const
+Pango_font::pango_item_string_stencil (PangoItem const *item, std::string str) const
 {
   const int GLYPH_NAME_LEN = 256;
   char glyph_name[GLYPH_NAME_LEN];
@@ -142,7 +144,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, String str) const
   char *file_name_as_ptr = 0;
   FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & file_name_as_ptr);
 
-  String file_name;
+  std::string file_name;
   if (file_name_as_ptr)
     {
       /* Normalize file name.  */
@@ -154,28 +156,29 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, String str) const
   if (!ps_name_str0)
     warning (_f ("no PostScript font name for font `%s'", file_name));
 
-  String ps_name;
+  std::string ps_name;
   if (!ps_name_str0
       && file_name != ""
-      && (file_name.index (".otf") != NPOS
-         || file_name.index (".cff") != NPOS))
+      && (file_name.find (".otf") != NPOS
+         || file_name.find (".cff") != NPOS))
     {
 
       /* UGH: kludge a PS name for OTF/CFF fonts.  */
-      String name = file_name;
-      int idx = max (file_name.index (".otf"),
-                    file_name.index (".cff"));
+      std::string name = file_name;
+      ssize idx = file_name.find (".otf");
+      if (idx == NPOS)
+       idx = file_name.find (".cff");
 
-      name = name.left_string (idx);
+      name = name.substr (0, idx);
 
-      int slash_idx = name.index_last ('/');
+      ssize slash_idx = name.rfind ('/');
       if (slash_idx != NPOS)
-       name = name.right_string (name.length () - slash_idx - 1);
+       name = name.substr (slash_idx - 1);
 
-      String initial = name.cut_string (0, 1);
-      initial.to_upper ();
-      name = name.nomid_string (0, 1);
-      name.to_lower ();
+      std::string initial = name.substr (0, 1);
+      initial = String_convert::to_upper (initial);
+      name = name.substr (1);
+      name = String_convert::to_lower (name);
       ps_name = initial + name;
     }
   else if (ps_name_str0)
@@ -206,7 +209,7 @@ Pango_font::physical_font_tab () const
 }
 
 Stencil
-Pango_font::text_stencil (String str) const
+Pango_font::text_stencil (std::string str) const
 {
   GList *items
     = pango_itemize (context_,
index 8f7eb462a3149ab9a90780f1f108925966efe103..6f832e7621fb8511d51c1a1d440d3c4483eef3b6 100644 (file)
@@ -19,7 +19,7 @@ properties_to_pango_description (SCM chain, Real text_size)
   PangoFontDescription *description = 0;
   if (scm_is_string (name))
     {
-      String name_str = ly_scm2string (name);
+      std::string name_str = ly_scm2string (name);
       description = pango_font_description_from_string (name_str.c_str ());
     }
   else
@@ -133,7 +133,7 @@ symbols_to_pango_font_description (SCM family,
 {
   PangoFontDescription *description = pango_font_description_new ();
 
-  String family_str = "roman";
+  std::string family_str = "roman";
   if (scm_is_symbol (family))
     family_str = ly_symbol2string (family);
   else if (scm_is_string (family))
index 48b0fe34f77ebc62d156c00d9da67e1a18db09b2..bf125664606629b861c51ff7348a6a8c59fcc722 100644 (file)
@@ -104,7 +104,7 @@ Paper_book::output (SCM output_channel)
   if (ly_is_module (header_))
     scopes = scm_cons (header_, scopes);
 
-  String mod_nm = "scm framework-" + output_backend_global;
+  std::string mod_nm = "scm framework-" + output_backend_global;
 
   SCM mod = scm_c_resolve_module (mod_nm.c_str ());
   if (make_print)
@@ -144,8 +144,8 @@ Paper_book::classic_output (SCM output)
   if (ly_is_module (header_0_))
     scopes = scm_cons (header_0_, scopes);
 
-  String format = output_backend_global;
-  String mod_nm = "scm framework-" + format;
+  std::string format = output_backend_global;
+  std::string mod_nm = "scm framework-" + format;
 
   SCM mod = scm_c_resolve_module (mod_nm.c_str ());
   SCM func = scm_c_module_lookup (mod, "output-classic-framework");
index 188b24f12b0f212a1f47ed40808312280e5d2e38..9993b029ed94b3e782c365733cb1732dba1ab240 100644 (file)
@@ -113,10 +113,10 @@ Paper_column::print (SCM p)
 {
   Grob *me = unsmob_grob (p);
 
-  String r = to_string (Paper_column::get_rank (me));
+  std::string r = to_string (Paper_column::get_rank (me));
 
   Moment *mom = unsmob_moment (me->get_property ("when"));
-  String when = mom ? mom->to_string () : "?/?";
+  std::string when = mom ? mom->to_string () : "?/?";
 
   SCM properties = Font_interface::text_font_alist_chain (me);
 
index 2bfdde5bc4034b66c1d2b717c3c1a1c848d7f494..e05f6cc8acbb342fbb9ad38a7f9ec7b633a7d087 100644 (file)
@@ -7,8 +7,10 @@
 */
 
 #include "paper-outputter.hh"
-#include "warn.hh"
+
+#include "international.hh"
 #include "stencil.hh"
+#include "warn.hh"
 
 LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter",
           2, 0, 0, (SCM port, SCM format),
@@ -20,9 +22,9 @@ LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter",
   SCM_ASSERT_TYPE (scm_is_string (format), format, SCM_ARG2, __FUNCTION__,
                   "String");
 
-  String f = ly_scm2string (format);
+  std::string f = ly_scm2string (format);
 
-  String output_name = "<unknown>";
+  std::string output_name = "<unknown>";
 
   SCM port_name = scm_port_filename (port);
   if (scm_is_string (port_name))
index bbefe954f99e75265dfed2e2c5236f5b25de4c19..aff76981f7c42b41ceb29b696ba9ad3651a0e5b8 100644 (file)
@@ -29,13 +29,13 @@ using namespace std;
 
 #include "ly-smobs.icc"
 
-Paper_outputter::Paper_outputter (SCM port, String format)
+Paper_outputter::Paper_outputter (SCM port, std::string format)
 {
   file_ = port;
   output_module_ = SCM_EOL;
   smobify_self ();
 
-  String module_name = "scm output-" + format;
+  std::string module_name = "scm output-" + format;
   output_module_ = scm_c_resolve_module (module_name.c_str ());
 }
 
index 9e932349091c41b1ae6de063356e25b20a485991..424773227333a4fab965dffe59047a3dd0e15638 100644 (file)
@@ -7,9 +7,11 @@
 */
 
 #include "paper-score.hh"
-#include "book.hh"
+
 #include "all-font-metrics.hh"
+#include "book.hh"
 #include "gourlay-breaking.hh"
+#include "international.hh"
 #include "main.hh"
 #include "misc.hh"
 #include "output-def.hh"
index 4aee3942903de7959dbb7dc5800deb99180780d6..75f161540dfd0e705520c4fabf3f80b82d7c7b26 100644 (file)
@@ -11,6 +11,7 @@
 #include <cstdio>
 using namespace std;
 
+#include "international.hh"
 #include "main.hh"
 #include "paper-book.hh"
 #include "source-file.hh"
index dcba6806ce1d56c40aefdd32240ac12fd8507a39..0f6e2c120ffcebfdc35fbc0fa7713fb7e6d60a46 100644 (file)
@@ -74,24 +74,25 @@ using namespace std;
 #include "book.hh"
 #include "context-def.hh"
 #include "dimensions.hh"
-#include "music.hh"
 #include "file-path.hh"
 #include "input-smob.hh"
 #include "input.hh"
+#include "international.hh"
 #include "lily-guile.hh"
+#include "lily-lexer.hh"
+#include "lily-parser.hh"
 #include "lilypond-input-version.hh"
 #include "main.hh"
 #include "misc.hh"
-#include "lily-lexer.hh"
-#include "lily-parser.hh"
-#include "paper-book.hh"
+#include "music.hh"
+#include "music.hh"
 #include "output-def.hh"
-#include "scm-hash.hh"
+#include "paper-book.hh"
 #include "program-option.hh"
+#include "scm-hash.hh"
 #include "score.hh"
 #include "text-interface.hh"
 #include "warn.hh"
-#include "music.hh"
 
 %}
 
@@ -100,7 +101,7 @@ using namespace std;
        Book *book;
        Output_def *outputdef;
        SCM scm;
-       String *string;
+       std::string *string;
        Music *music;
        Score *score;
        int i;
@@ -2742,7 +2743,7 @@ run_music_function (Lily_parser *parser, SCM expr)
 bool
 is_regular_identifier (SCM id)
 {
-  String str = ly_scm2string (id);
+  std::string str = ly_scm2string (id);
   char const *s = str.c_str ();
 
   bool v = true;
index 9d2a520f7c0e0fbf6bec90547d3b3daf8d4a17a5..c2625f28c1cf43d3ff1972d8a7583d1a46aefb4f 100644 (file)
@@ -410,8 +410,8 @@ Part_combine_iterator::process (Moment m)
        solo2 ();
       else if (scm_is_symbol (tag))
        {
-         String s = "Unknown split directive: "
-           + (scm_is_symbol (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
+         std::string s = "Unknown split directive: "
+           + (scm_is_symbol (tag) ? ly_symbol2string (tag) : std::string ("not a symbol"));
          programming_error (s);
        }
     }
index 8b7d0d7060a004dd8b4da12017b6e28c90bb093a..0f5ef279c3591299ef3b78b28334cc4481d1dce0 100644 (file)
@@ -9,15 +9,16 @@
 
 #include "score-engraver.hh"
 
-#include "repeated-music.hh"
+#include "bar-line.hh"
 #include "global-context.hh"
-#include "warn.hh"
-#include "misc.hh"
-#include "spanner.hh"
+#include "international.hh"
 #include "item.hh"
+#include "misc.hh"
 #include "percent-repeat-iterator.hh"
-#include "bar-line.hh"
+#include "repeated-music.hh"
 #include "side-position-interface.hh"
+#include "spanner.hh"
+#include "warn.hh"
 
 #include "translator.icc"
 
index fb14f2abddec80861e7269f11f7b80b6c7a6a2f0..79fd496daaa5df0daca6ebce0cc8ed460ec3aae4 100644 (file)
@@ -8,8 +8,9 @@
 
 #include "percent-repeat-iterator.hh"
 
-#include "repeated-music.hh"
 #include "input.hh"
+#include "international.hh"
+#include "repeated-music.hh"
 
 IMPLEMENT_CTOR_CALLBACK (Percent_repeat_iterator);
 
index a70f7aff993cbc1c3337770bbfffc52bf9bbb156..695bb399f7a00cc15be7a9e6831e877521016a46 100644 (file)
@@ -14,6 +14,7 @@ using namespace std;
 #include "audio-column.hh"
 #include "audio-staff.hh"
 #include "file-name.hh"
+#include "international.hh"
 #include "lily-version.hh"
 #include "main.hh"
 #include "midi-item.hh"
@@ -88,8 +89,8 @@ Performance::output_header_track (Midi_stream &midi_stream)
   midi_track.channel_ = 9;
 
   // perhaps multiple text events?
-  String id_string;
-  String str = String (_ ("Creator: "));
+  std::string id_string;
+  std::string str = std::string (_ ("Creator: "));
   id_string = String_convert::pad_to (gnu_lilypond_version_string (), 30);
   str += id_string;
 
@@ -112,7 +113,7 @@ Performance::output_header_track (Midi_stream &midi_stream)
   str = _ ("at ");
   time_t t (time (0));
   str += ctime (&t);
-  str = str.left_string (str.length () - 1);
+  str = str.substr (0, str.length () - 1);
   str = String_convert::pad_to (str, 60);
 
   Audio_text at_a (Audio_text::TEXT, str);
@@ -149,7 +150,7 @@ Performance::add_element (Audio_element *p)
 }
 
 void
-Performance::write_output (String out)
+Performance::write_output (std::string out)
 {
   if (out == "-")
     out = "lelie.midi";
index fc20dfd5cd7591e9603bc5a13a27c8fb5c1f1055..b27fe906c55727ca62b5714dc5baff8df4436b33 100644 (file)
@@ -77,7 +77,7 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa",
   SCM_ASSERT_TYPE (scm_is_string (pfb_file_name), pfb_file_name,
                   SCM_ARG1, __FUNCTION__, "string");
 
-  String file_name = ly_scm2string (pfb_file_name);
+  std::string file_name = ly_scm2string (pfb_file_name);
   int len = -1;
 
   if (be_verbose_global)
@@ -103,14 +103,14 @@ LY_DEFINE (ly_otf_to_cff, "ly:otf->cff",
   SCM_ASSERT_TYPE (scm_is_string (otf_file_name), otf_file_name,
                   SCM_ARG1, __FUNCTION__, "string");
 
-  String file_name = ly_scm2string (otf_file_name);
+  std::string file_name = ly_scm2string (otf_file_name);
   if (be_verbose_global)
     progress_indication ("[" + file_name);
 
   FT_Face face = open_ft_face (file_name);
-  String table = get_otf_table (face, "CFF ");
+  std::string table = get_otf_table (face, "CFF ");
 
-  SCM asscm = scm_from_locale_stringn ((char *) table.get_bytes (),
+  SCM asscm = scm_from_locale_stringn ((char *) table.data (),
                                       table.length ());
 
   if (be_verbose_global)
index 7276302f574d5d6bff926c50e9ac19cffa330633..4194be280fb008741a4d48385dfeb2e0ddbe9f66 100644 (file)
@@ -6,11 +6,13 @@
   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
+#include "engraver.hh"
+
 #include "context.hh"
 #include "directional-element-interface.hh"
-#include "engraver.hh"
-#include "slur.hh"
+#include "international.hh"
 #include "note-column.hh"
+#include "slur.hh"
 #include "spanner.hh"
 #include "tie.hh"
 #include "warn.hh"
index 5ca0d358c4ab9288384c9cf518927cea829de678..716f5a474213573af5596c7db3f0c9cc6101dfaf 100644 (file)
 */
 
 #include "engraver.hh"
-#include "lily-guile.hh"
-#include "side-position-interface.hh"
-#include "staff-symbol-referencer.hh"
+
 #include "axis-group-interface.hh"
 #include "context.hh"
 #include "directional-element-interface.hh"
+#include "international.hh"
+#include "lily-guile.hh"
 #include "note-column.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
 #include "warn.hh"
 
 /*
@@ -150,7 +152,7 @@ Piano_pedal_engraver::try_music (Music *m)
     {
       for (Pedal_info *p = info_list_; p->name_; p++)
        {
-         String nm = p->name_ + String ("Event");
+         std::string nm = p->name_ + std::string ("Event");
          if (ly_is_equal (m->get_property ("name"),
                           scm_str2symbol (nm.c_str ())))
            {
@@ -172,7 +174,7 @@ Piano_pedal_engraver::process_music ()
        {
          if (!p->line_spanner_)
            {
-             String name = String (p->name_) + "PedalLineSpanner";
+             std::string name = std::string (p->name_) + "PedalLineSpanner";
              Music *rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]);
              p->line_spanner_ = make_spanner (name.c_str (), rq->self_scm ());
            }
@@ -190,7 +192,7 @@ Piano_pedal_engraver::process_music ()
            mixed:   Ped. _____/\____|
          */
 
-         String prop = String ("pedal") + p->name_ + "Style";
+         std::string prop = std::string ("pedal") + p->name_ + "Style";
          SCM style = get_property (prop.c_str ());
 
          bool mixed = style == ly_symbol2scm ("mixed");
@@ -211,14 +213,14 @@ void
 Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
 {
   SCM s = SCM_EOL;
-  SCM strings = get_property (("pedal" + String (p->name_) + "Strings").c_str ());
+  SCM strings = get_property (("pedal" + std::string (p->name_) + "Strings").c_str ());
 
   if (scm_ilength (strings) < 3)
     {
       Music *m = p->event_drul_[START];
       if (!m) m = p->event_drul_ [STOP];
 
-      String msg = _f ("expect 3 strings for piano pedals, found: %d",
+      std::string msg = _f ("expect 3 strings for piano pedals, found: %d",
                       scm_ilength (strings));
       if (m)
        m->origin ()->warning (msg);
@@ -269,7 +271,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
 
   if (scm_is_string (s))
     {
-      String propname = String (p->name_) + "Pedal";
+      std::string propname = std::string (p->name_) + "Pedal";
 
       p->item_ = make_item (propname.c_str (), (p->event_drul_[START]
                                                  ? p->event_drul_[START]
@@ -291,7 +293,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
 {
   if (!p->bracket_ && p->event_drul_[STOP])
     {
-      String msg = _f ("can't find start of piano pedal bracket: `%s'", p->name_);
+      std::string msg = _f ("can't find start of piano pedal bracket: `%s'", p->name_);
       p->event_drul_[STOP]->origin ()->warning (msg);
       p->event_drul_[STOP] = 0;
     }
index e19feb9e42c2415c8a01d5b7a7c93d3440ac297b..0edfcfb997d89e2d762b26463a5da7d05f9a258b 100644 (file)
@@ -7,7 +7,9 @@
 */
 
 #include "performer.hh"
+
 #include "audio-item.hh"
+#include "international.hh"
 #include "music.hh"
 
 /**
@@ -77,11 +79,11 @@ Piano_pedal_performer::process_music ()
       if (p->event_drul_[STOP])
        {
          if (!p->start_event_)
-           p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
+           p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", std::string (p->name_)));
          else
            {
              Audio_piano_pedal *a = new Audio_piano_pedal;
-             a->type_string_ = String (p->name_);
+             a->type_string_ = std::string (p->name_);
              a->dir_ = STOP;
              audios_.push (a);
               Audio_element_info info(a, p->event_drul_[STOP]);
@@ -94,7 +96,7 @@ Piano_pedal_performer::process_music ()
        {
          p->start_event_ = p->event_drul_[START];
          Audio_piano_pedal *a = new Audio_piano_pedal;
-         a->type_string_ = String (p->name_);
+         a->type_string_ = std::string (p->name_);
          a->dir_ = START;
          audios_.push (a);
           Audio_element_info info(a, p->event_drul_[START]);
@@ -130,7 +132,7 @@ Piano_pedal_performer::try_music (Music *r)
     {
       for (Pedal_info *p = info_alist_; p->name_; p++)
        {
-         String nm = p->name_ + String ("Event");
+         std::string nm = p->name_ + std::string ("Event");
          if (ly_is_equal (r->get_property ("name"),
                           scm_str2symbol (nm.c_str ())))
            {
index 6f5ea965eea5225bbf40811d54cd3c253543bbc0..076615391ce708a61f41a9f3eba0727d7dd77e6d 100644 (file)
@@ -7,8 +7,10 @@
 */
 
 #include "pitch.hh"
-#include "warn.hh"
+
 #include "main.hh"
+#include "string-convert.hh"
+#include "warn.hh"
 
 #include "ly-smobs.icc"
 
@@ -164,13 +166,13 @@ pitch_interval (Pitch const &from, Pitch const &to)
 char const *accname[] = {"eses", "eseh", "es", "eh", "",
                         "ih", "is", "isih", "isis"};
 
-String
+std::string
 Pitch::to_string () const
 {
   int n = (notename_ + 2) % 7;
-  String s = ::to_string (char (n + 'a'));
+  std::string s = std::to_string (char (n + 'a'));
   if (alteration_)
-    s += String (accname[alteration_ - DOUBLE_FLAT]);
+    s += std::string (accname[alteration_ - DOUBLE_FLAT]);
 
   if (octave_ >= 0)
     {
@@ -182,7 +184,7 @@ Pitch::to_string () const
     {
       int o = (-octave_) - 1;
       while (o--)
-       s += ::to_string (',');
+       s += std::to_string (',');
     }
 
   return s;
index 66829f3b2e470f956c98e13b4da600bf5dc17906..c3c95bb760b019529cf32def62ebb2fce179352a 100644 (file)
@@ -118,7 +118,7 @@ Prob::get_property_alist (bool m) const
   return (m) ? mutable_property_alist_ : immutable_property_alist_;
 }
 
-String
+std::string
 Prob::name () const
 {
   SCM nm = get_property ("name");
index 00e0fc998093c0a9d191609a4153e234a1d34cd4..894f9d0db9dc0260bdf16670660ac5325869885a 100644 (file)
 #include <cstring>
 using namespace std;
 
-#include "string-convert.hh"
+#include "international.hh"
+#include "main.hh"
 #include "parse-scm.hh"
+#include "string-convert.hh"
 #include "warn.hh"
-#include "main.hh"
 
 /* Write midi as formatted ascii stream? */
 bool do_midi_debugging_global;
@@ -79,26 +80,26 @@ void internal_set_option (SCM var, SCM val)
     }
 }
 
-const int HELP_INDENT = 30;
-const int INDENT = 2;
-const int SEPARATION = 5;
+ssize const HELP_INDENT = 30;
+ssize const INDENT = 2;
+ssize const SEPARATION = 5;
 
 /*
   Hmmm. should do in SCM / C++  ?
 */
-static String
+static std::string
 get_help_string ()
 {
   SCM alist = ly_hash2alist (option_hash);
   SCM convertor = ly_lily_module_constant ("scm->string");
 
-  Array<String> opts;
+  Array<std::string> opts;
 
   for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM sym = scm_caar (s);
       SCM val = scm_cdar (s);
-      String opt_spec
+      std::string opt_spec
        = String_convert::char_string (' ', INDENT)
        + ly_symbol2string (sym)
        + " ("
@@ -115,27 +116,28 @@ get_help_string ()
 
       SCM opt_help_scm
        = scm_object_property (sym, ly_symbol2scm ("program-option-documentation"));
-      String opt_help = ly_scm2string (opt_help_scm);
-      opt_help.substitute (String ("\n"),
-                          String ("\n")
-                          + String_convert::char_string (' ', HELP_INDENT));
+      std::string opt_help = ly_scm2string (opt_help_scm);
+      replace_all (opt_help,
+                  std::string ("\n"),
+                  std::string ("\n")
+                  + String_convert::char_string (' ', HELP_INDENT));
 
       opts.push (opt_spec + opt_help + "\n");
     }
 
-  String help ("Options supported by ly:set-option\n\n");
-  opts.sort (String::compare);
+  std::string help ("Options supported by ly:set-option\n\n");
+  opts.sort (string_compare);
   for (int i = 0; i < opts.size (); i++)
     help += opts[i];
 
-  help += String ("\n");
+  help += std::string ("\n");
   return help;
 }
 
 LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
           "Print ly:set-option usage")
 {
-  String help = get_help_string ();
+  std::string help = get_help_string ();
   fputs (help.c_str (), stdout);
 
   exit (0);
@@ -174,10 +176,10 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
   if (val == SCM_UNDEFINED)
     val = SCM_BOOL_T;
 
-  String varstr = ly_scm2string (scm_symbol_to_string (var));
-  if (varstr.left_string (3) == String ("no-"))
+  std::string varstr = ly_scm2string (scm_symbol_to_string (var));
+  if (varstr.substr (0, 3) == std::string ("no-"))
     {
-      var = ly_symbol2scm (varstr.nomid_string (0, 3).c_str ());
+      var = ly_symbol2scm (varstr.substr (3).c_str ());
       val = scm_from_bool (!to_boolean (val));
     }
 
index 4f379b4b833d0973f17d4d0f6a2cba333b070993..a4c993b75644a943fa5ce77255385bf71793c367 100644 (file)
@@ -8,9 +8,10 @@
 
 #include "property-iterator.hh"
 
-#include "music.hh"
 #include "context-def.hh"
 #include "global-context.hh"
+#include "international.hh"
+#include "music.hh"
 
 bool check_grob (Music *mus, SCM sym);
 
index e755d50fa5d769c3afe7d4e916e67ea930aa15ff..aa06734e00c363a6a65611df52e62364f8b5420d 100644 (file)
@@ -6,13 +6,15 @@
   (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
+#include "music-wrapper-iterator.hh"
+
 #include "context.hh"
-#include "music.hh"
-#include "music-sequence.hh"
+#include "input.hh"
+#include "international.hh"
 #include "lily-guile.hh"
-#include "music-wrapper-iterator.hh"
+#include "music-sequence.hh"
+#include "music.hh"
 #include "warn.hh"
-#include "input.hh"
 
 class Quote_iterator : public Music_wrapper_iterator
 {
index 9fe109b0841c7bae7d099c3935683cbe552c9f7e..07d70acc45c82d003046dc18694d27c0d9c1d679 100644 (file)
@@ -6,8 +6,9 @@
   (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "music.hh"
 #include "input.hh"
+#include "international.hh"
+#include "music.hh"
 #include "pitch.hh"
 
 class Relative_octave_check
@@ -35,7 +36,7 @@ Relative_octave_check::relative_callback (SCM music, SCM last_pitch)
 
       if (result != *check_p)
        {
-         String s = _ ("Failed octave check, got: ");
+         std::string s = _ ("Failed octave check, got: ");
          s += result.to_string ();
 
          m->origin ()->warning (s);
index d511d21be1d455e0a06d9487ba1b9236b87529b6..39ecf8670bcc174a191db6f2a42323950673a32d 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "file-name.hh"
 #include "file-path.hh"
+#include "international.hh"
 #include "lily-guile.hh"
 #include "lily-version.hh"
 #include "main.hh"
 
 
 int
-sane_putenv (char const *key, String value, bool overwrite)
+sane_putenv (char const *key, std::string value, bool overwrite)
 {
   if (overwrite || !getenv (key))
     {
-      String combine = String (key) + "=" + value;
+      std::string combine = std::string (key) + "=" + value;
       char *s = strdup (combine.c_str ());
       return putenv (s);
     }
@@ -41,7 +42,7 @@ sane_putenv (char const *key, String value, bool overwrite)
 }
 
 static int
-set_env_file (char const *key, String value, bool overwrite = false)
+set_env_file (char const *key, std::string value, bool overwrite = false)
 {
   if (is_file (value))
     return sane_putenv (key, value, overwrite);
@@ -51,7 +52,7 @@ set_env_file (char const *key, String value, bool overwrite = false)
 }
 
 static int
-set_env_dir (char const *key, String value)
+set_env_dir (char const *key, std::string value)
 {
   if (is_dir (value))
     return sane_putenv (key, value, false);
@@ -61,7 +62,7 @@ set_env_dir (char const *key, String value)
 }
 
 static int
-prepend_env_path (char const *key, String value)
+prepend_env_path (char const *key, std::string value)
 {
   if (is_dir (value))
     {
@@ -78,15 +79,15 @@ prepend_env_path (char const *key, String value)
   return -1;
 }
 
-String
-dir_name (String const file_name)
+std::string
+dir_name (std::string const file_name)
 {
-  String s = file_name;
-  s.substitute ('\\', '/');
-  int n = s.length ();
+  std::string s = file_name;
+  replace_all (s, '\\', '/');
+  ssize n = s.length ();
   if (n && s[n - 1] == '/')
     s[n - 1] = 0;
-  s = s.left_string (s.index_last ('/'));
+  s = s.substr (0, s.rfind ('/'));
   return s;
 }
 
@@ -95,17 +96,17 @@ dir_name (String const file_name)
 #endif
 
 void
-prefix_relocation (String prefix)
+prefix_relocation (std::string prefix)
 {
   if (be_verbose_global)
     warning (_f ("Relocation: compile prefix=%s, new prefix=%s",
                 prefix_directory,
                 prefix.c_str ()));
   
-  String bindir = prefix + "/bin";
-  String datadir = prefix + "/share";
-  String localedir = datadir + "/locale";
-  String lilypond_datadir = datadir + "/lilypond/" TOPLEVEL_VERSION;
+  std::string bindir = prefix + "/bin";
+  std::string datadir = prefix + "/share";
+  std::string localedir = datadir + "/locale";
+  std::string lilypond_datadir = datadir + "/lilypond/" TOPLEVEL_VERSION;
 
   if (is_dir (lilypond_datadir))
     prefix_directory = lilypond_datadir;
@@ -119,15 +120,15 @@ prefix_relocation (String prefix)
 }
 
 void
-framework_relocation (String prefix)
+framework_relocation (std::string prefix)
 {
   if (be_verbose_global)
     warning (_f ("Relocation: framework_prefix=%s", prefix));
 
-  String bindir = prefix + "/bin";
-  String datadir = prefix + "/share";
-  String libdir = prefix + "/lib";
-  String sysconfdir = prefix + "/etc";
+  std::string bindir = prefix + "/bin";
+  std::string datadir = prefix + "/share";
+  std::string libdir = prefix + "/lib";
+  std::string sysconfdir = prefix + "/etc";
 
   /* need otherwise dynamic .so's aren't found.   */
   prepend_env_path ("DYLD_LIBRARY_PATH", libdir);
@@ -160,13 +161,13 @@ framework_relocation (String prefix)
   prepend_env_path ("PATH", bindir);
 }
 
-String
+std::string
 get_working_directory ()
 {
   char cwd[PATH_MAX];
   getcwd (cwd, PATH_MAX);
 
-  return String (cwd);
+  return std::string (cwd);
 }
 
 void
@@ -178,18 +179,18 @@ setup_paths (char const *argv0_ptr)
   if (relocate_binary
       && getenv ("LILYPOND_RELOCATE_PREFIX"))
     {
-      String prefix = getenv ("LILYPOND_RELOCATE_PREFIX");
+      std::string prefix = getenv ("LILYPOND_RELOCATE_PREFIX");
 #ifdef __MINGW32__
       /* Normalize file name.  */
       prefix = File_name (prefix).to_string ().get_copy_str0 ();
 #endif /* __MINGW32__ */
       prefix_relocation (prefix);
-      String bindir = prefix + "/bin";
+      std::string bindir = prefix + "/bin";
       framework_relocation (bindir + "/" FRAMEWORKDIR);
     }
   else if (relocate_binary)
     {
-      String argv0_abs;
+      std::string argv0_abs;
       if (argv0_filename.is_absolute ())
        {
          argv0_abs = argv0_filename.to_string ();
@@ -199,7 +200,7 @@ setup_paths (char const *argv0_ptr)
       else if (argv0_filename.dir_.length ())
        {
          argv0_abs = get_working_directory ()
-           + "/" + String (argv0_filename.to_string ());
+           + "/" + std::string (argv0_filename.to_string ());
          if (be_verbose_global)
            warning (_f ("Relocation: from cwd: argv0=%s", argv0_ptr));
        }
@@ -224,12 +225,12 @@ setup_paths (char const *argv0_ptr)
            programming_error ("can't find absolute argv0.");
        }
 
-      String bindir = dir_name (argv0_abs);
-      String argv0_prefix = dir_name (bindir);
-      String compile_prefix = dir_name (dir_name (dir_name (prefix_directory)));
+      std::string bindir = dir_name (argv0_abs);
+      std::string argv0_prefix = dir_name (bindir);
+      std::string compile_prefix = dir_name (dir_name (dir_name (prefix_directory)));
       if (argv0_prefix != compile_prefix)
        prefix_relocation (argv0_prefix);
-      if (argv0_prefix != compile_prefix || String (FRAMEWORKDIR) != "..")
+      if (argv0_prefix != compile_prefix || std::string (FRAMEWORKDIR) != "..")
        framework_relocation (bindir + "/" FRAMEWORKDIR);
     }
 
@@ -258,7 +259,7 @@ setup_paths (char const *argv0_ptr)
   */
   
   struct stat statbuf;
-  String build_prefix = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION;
+  std::string build_prefix = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION;
   if (stat (build_prefix.c_str (), &statbuf) == 0)
     prefix_directory = build_prefix;
 
@@ -268,10 +269,10 @@ setup_paths (char const *argv0_ptr)
   char *suffixes[] = {"ly", "ps", "scm", 0 };
 
   
-  Array<String> dirs;
+  Array<std::string> dirs;
   for (char **s = suffixes; *s; s++)
     {
-      String path = prefix_directory + to_string ('/') + String (*s);
+      std::string path = prefix_directory + to_string ('/') + std::string (*s);
       dirs.push (path);
     }
 
index 6de07648c185698adf07d6dae6b3b6579093854b..f752d5447d82bec5ad159e7e5fea8bdc5f80d976 100644 (file)
@@ -66,7 +66,7 @@ Repeat_acknowledge_engraver::process_music ()
 
   SCM cs = get_property ("repeatCommands");
 
-  String s = "";
+  std::string s = "";
   bool start = false;
   bool end = false;
   bool volta_found = false;
index ee1e8868e909dd5a66b02cd6966b4f23046eacce..1bd6f7924e5d1c34713d3ce519d8e31d7dc360e6 100644 (file)
 #include <cmath>               // ceil.
 using namespace std;
 
-#include "warn.hh"
+#include "directional-element-interface.hh"
+#include "duration.hh"
+#include "international.hh"
 #include "note-column.hh"
-#include "stem.hh"
-#include "rhythmic-head.hh"
 #include "output-def.hh"
-#include "rest.hh"
 #include "pointer-group-interface.hh"
+#include "rest.hh"
+#include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
-#include "duration.hh"
-#include "directional-element-interface.hh"
+#include "stem.hh"
+#include "warn.hh"
 
 MAKE_SCHEME_CALLBACK (Rest_collision, force_shift_callback, 1);
 SCM
index bc81554df383909f1c704242fea0a3b19ac0dbda..181626ef3a88c9933a42f294a407614374185803 100644 (file)
@@ -8,13 +8,14 @@
 
 #include "rest.hh"
 
-#include "stencil.hh"
-#include "output-def.hh"
-#include "font-interface.hh"
+#include "directional-element-interface.hh"
 #include "dots.hh"
+#include "font-interface.hh"
+#include "international.hh"
+#include "output-def.hh"
 #include "paper-score.hh"
 #include "staff-symbol-referencer.hh"
-#include "directional-element-interface.hh"
+#include "stencil.hh"
 
 // -> offset callback
 MAKE_SCHEME_CALLBACK (Rest, y_offset_callback, 1);
@@ -56,8 +57,8 @@ Rest::y_offset_callback (SCM smob)
 /*
   make this function easily usable in C++
 */
-String
-Rest::glyph_name (Grob *me, int balltype, String style, bool try_ledgers)
+std::string
+Rest::glyph_name (Grob *me, int balltype, std::string style, bool try_ledgers)
 {
   bool is_ledgered = false;
   if (try_ledgers && (balltype == 0 || balltype == 1))
@@ -74,7 +75,7 @@ Rest::glyph_name (Grob *me, int balltype, String style, bool try_ledgers)
       is_ledgered |= (balltype == 1) && (pos <= -rad - 2 || pos > +rad);
     }
 
-  String actual_style (style.c_str ());
+  std::string actual_style (style.c_str ());
 
   if ((style == "mensural") || (style == "neomensural"))
     {
@@ -127,13 +128,13 @@ Rest::brew_internal_stencil (Grob *me, bool ledgered)
 
   int balltype = scm_to_int (balltype_scm);
 
-  String style;
+  std::string style;
   SCM style_scm = me->get_property ("style");
   if (scm_is_symbol (style_scm))
     style = ly_scm2string (scm_symbol_to_string (style_scm));
 
   Font_metric *fm = Font_interface::get_default_font (me);
-  String font_char = glyph_name (me, balltype, style, ledgered);
+  std::string font_char = glyph_name (me, balltype, style, ledgered);
   Stencil out = fm->find_by_name (font_char);
   if (out.is_empty ())
     me->warning (_f ("rest `%s' not found", font_char.c_str ()));
index 94d269df9f2a8819531ba66314555f94bc7e9444..b5823267869f2376b1b08f85005e59ef2818ed95 100644 (file)
@@ -6,19 +6,21 @@
   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "all-font-metrics.hh"
-#include "warn.hh"
-#include "main.hh"
-#include "system.hh"
 #include "score-engraver.hh"
-#include "paper-score.hh"
-#include "paper-column.hh"
-#include "output-def.hh"
+
+#include "all-font-metrics.hh"
 #include "axis-group-interface.hh"
 #include "context-def.hh"
 #include "global-context.hh"
+#include "international.hh"
+#include "main.hh"
 #include "open-type-font.hh"
+#include "output-def.hh"
 #include "paper-column-engraver.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
+#include "system.hh"
+#include "warn.hh"
 
 Score_engraver::Score_engraver ()
 {
index 505a1fee5e763e61b9de6c2ad1a4d7e652395fa2..1545debcfb449018f47ca6048f08c6321d32f1da 100644 (file)
@@ -15,15 +15,16 @@ using namespace std;
 #include "book.hh"
 #include "cpu-timer.hh"
 #include "global-context.hh"
+#include "international.hh"
 #include "lily-parser.hh"
 #include "lilypond-key.hh"
 #include "main.hh"
 #include "music.hh"
+#include "music.hh"
 #include "output-def.hh"
 #include "paper-book.hh"
 #include "paper-score.hh"
 #include "warn.hh"
-#include "music.hh"
 
 #include "ly-smobs.icc"
 
index eb1ce89537ebd3c0c5a0ebc63abac00413850686..44d9de4cacb16937633260b9edb5782a06c18478 100644 (file)
@@ -6,15 +6,17 @@
   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
+#include "engraver.hh"
+
 #include "context.hh"
 #include "directional-element-interface.hh"
-#include "engraver.hh"
-#include "slur.hh"
+#include "international.hh"
 #include "note-column.hh"
 #include "paper-column.hh"
 #include "rhythmic-head.hh"
 #include "script-interface.hh"
 #include "side-position-interface.hh"
+#include "slur.hh"
 #include "staff-symbol-referencer.hh"
 #include "stem.hh"
 #include "warn.hh"
index 6acdc3977c15279ae662b107cd8a2e1b31ddfba5..a035ca45a039c4efb075b7f62b867afcbccedb23 100644 (file)
@@ -106,7 +106,7 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
   /* FIXME: 1000 should relate to paper size.  */
   if (fabs (total_off) > 1000)
     {
-      String msg
+      std::string msg
        = String_convert::form_string ("Improbable offset for grob %s: %f%s",
                                       me->name ().c_str (), total_off,
                                       INTERNAL_UNIT);
index a9c70489dd060345fd1aa0ed7ac4c92b83b78322..6b359f38c0ff4924a79ce6c82ae2a8921e14f078 100644 (file)
 
 #include <cstdio>
 
+#include "column-x-positions.hh"
+#include "dimensions.hh"
+#include "international.hh"
 #include "libc-extension.hh"   // isinf
-#include "simple-spacer.hh"
 #include "paper-column.hh"
+#include "simple-spacer.hh"
+#include "spaceable-grob.hh"
 #include "spring.hh"
 #include "warn.hh"
-#include "column-x-positions.hh"
-#include "spaceable-grob.hh"
-#include "dimensions.hh"
 
 /*
   A simple spacing constraint solver. The approach:
index 2481ea41acec36ccbfdeda097faf133523706a63..1b8f6d153b9507209e8a29db3fbff2f623de5d05 100644 (file)
@@ -6,11 +6,13 @@
   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "slur.hh"
-#include "note-column.hh"
+#include "engraver.hh"
+
 #include "context.hh"
 #include "directional-element-interface.hh"
-#include "engraver.hh"
+#include "international.hh"
+#include "note-column.hh"
+#include "slur.hh"
 #include "spanner.hh"
 #include "tie.hh"
 #include "warn.hh"
index bda0ff9ebf4b5c75e7d290ff9fbb3b2d00d22d2c..d40104b1adb33cfcf8bf6c774ded38a4eaf1f51c 100644 (file)
@@ -108,7 +108,7 @@ Slur::print (SCM smob)
                  ->lookup_variable (ly_symbol2scm ("debug-slur-scoring")))
       && scm_is_string (quant_score))
     {
-      String str;
+      std::string str;
       SCM properties = Font_interface::text_font_alist_chain (me);
 
       Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
index 334d10d40f509b38ccda2ea0bb5f150be0cecf24..c350248065cea64211dfe5f73c5a29cd51950f0f 100644 (file)
@@ -27,8 +27,9 @@
 #endif
 using namespace std;
 
-#include "warn.hh"
 #include "file-name-map.hh"
+#include "international.hh"
+#include "warn.hh"
 
 void
 Source_file::load_stdin ()
@@ -46,7 +47,7 @@ Source_file::load_stdin ()
 }
 
 char *
-gulp_file (String filename, int *filesize)
+gulp_file (std::string filename, int *filesize)
 {
   /* "b" must ensure to open literally, avoiding text (CR/LF)
      conversions.  */
@@ -78,12 +79,12 @@ gulp_file (String filename, int *filesize)
   return str;
 }
 
-Source_file::Source_file (String filename, String data)
+Source_file::Source_file (std::string filename, std::string data)
 {
   name_ = filename;
   istream_ = 0;
-  contents_str0_ = data.get_copy_str0 ();
   length_ = data.length ();
+  contents_str0_ = string_copy (data);
   pos_str0_ = c_str ();
   init_port ();
 
@@ -92,7 +93,7 @@ Source_file::Source_file (String filename, String data)
       newline_locations_.push (contents_str0_ + i);
 }
 
-Source_file::Source_file (String filename_string)
+Source_file::Source_file (std::string filename_string)
 {
   name_ = filename_string;
   istream_ = 0;
@@ -120,7 +121,7 @@ Source_file::init_port ()
 {
   SCM str = scm_makfrom0str (contents_str0_);
   str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__);
-  scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.get_str0 ()));
+  scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.c_str ()));
 }
 
 int
@@ -146,7 +147,7 @@ Source_file::get_istream ()
   return istream_;
 }
 
-String
+std::string
 Source_file::file_line_column_string (char const *context_str0) const
 {
   if (!c_str ())
@@ -161,7 +162,7 @@ Source_file::file_line_column_string (char const *context_str0) const
     }
 }
 
-String
+std::string
 Source_file::quote_input (char const *pos_str0) const
 {
   if (!contains (pos_str0))
@@ -169,15 +170,15 @@ Source_file::quote_input (char const *pos_str0) const
 
   int l, ch, col;
   get_counts (pos_str0, &l, &ch, &col);
-  String line = line_string (pos_str0);
-  String context = line.left_string (ch)
+  std::string line = line_string (pos_str0);
+  std::string context = line.substr (0, ch)
     + to_string ('\n')
     + to_string (' ', col)
-    + line.cut_string (ch, INT_MAX);
+    + line.substr (ch);
   return context;
 }
 
-String
+std::string
 Source_file::name_string () const
 {
   return map_file_name (name_);
@@ -220,7 +221,7 @@ Source_file::line_slice (char const *pos_str0) const
   return Slice (begin_str0 - data_str0, end_str0 - data_str0);
 }
 
-String
+std::string
 Source_file::line_string (char const *pos_str0) const
 {
   if (!contains (pos_str0))
@@ -228,7 +229,7 @@ Source_file::line_string (char const *pos_str0) const
 
   Slice line = line_slice (pos_str0);
   char const *data_str0 = c_str ();
-  return String ((Byte const *)data_str0 + line[LEFT], line.length ());
+  return std::string (data_str0 + line[LEFT], line.length ());
 }
 
 void
@@ -248,10 +249,10 @@ Source_file::get_counts (char const *pos_str0,
 
   Slice line = line_slice (pos_str0);
   char const *data = c_str ();
-  Byte const *line_start = (Byte const *)data + line[LEFT];
+  char const *line_start = (char const *)data + line[LEFT];
 
-  int left = (Byte const *) pos_str0 - line_start;
-  String line_begin (line_start, left);
+  ssize left = (char const *) pos_str0 - line_start;
+  std::string line_begin (line_start, left);
   char const *line_chars = line_begin.c_str ();
 
   *column = 0;
@@ -380,10 +381,10 @@ Source_file::forward_str0 (int n)
   return old_pos;
 }
 
-String
+std::string
 Source_file::get_string (int n)
 {
-  String str = String ((Byte const *)forward_str0 (n), n);
+  std::string str = std::string ((char const *)forward_str0 (n), n);
   return str;
 }
 
index 6c5a47691cf41c1212028fb25c70de692763d808..775668e08d53dd40389526addf156cb9024b6194 100644 (file)
@@ -40,11 +40,11 @@ Sources::set_path (File_path *f)
    @return 0 if no file found
 */
 Source_file *
-Sources::get_file (String &file_string) //UGH
+Sources::get_file (std::string &file_string) //UGH
 {
   if ((file_string != "-") && path_)
     {
-      String file_string_o = path_->find (file_string);
+      std::string file_string_o = path_->find (file_string);
       if ((file_string_o == "") && (file_string != ""))
        return 0;
       file_string = file_string_o;
index d6a546e124042f379dd63d5252600d75fc71d7cd..ec4907be63f4cbc1e255056dd71bd99749b424c1 100644 (file)
@@ -6,24 +6,25 @@
   (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include <math.h>
+#include "spacing-spanner.hh"
 
+#include <math.h>
 #include <cstdio>
 using namespace std;
 
-#include "spacing-spanner.hh"
-#include "paper-column.hh"
-#include "output-def.hh"
-#include "paper-score.hh"
-#include "system.hh"
+#include "international.hh"
+#include "main.hh"
 #include "moment.hh"
 #include "note-spacing.hh"
-#include "main.hh"
-#include "warn.hh"
+#include "output-def.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
 #include "pointer-group-interface.hh"
 #include "spaceable-grob.hh"
-#include "staff-spacing.hh"
 #include "spacing-interface.hh"
+#include "staff-spacing.hh"
+#include "system.hh"
+#include "warn.hh"
 
 
 /*
index 9a3a5c1e15d6b0f1d632e5a5ed4f5d5a65a72c97..2149f2ddfc4e26043ceafbc3ef936e854a21d63f 100644 (file)
@@ -53,7 +53,7 @@ Span_bar::print (SCM smobbed_me)
   if (!scm_is_string (glyph))
     return SCM_EOL;
 
-  String glyph_string = ly_scm2string (glyph);
+  std::string glyph_string = ly_scm2string (glyph);
 
   /* compose span_bar_mol */
   Array<Interval> extents;
@@ -116,7 +116,7 @@ Span_bar::width (SCM smob)
   if (!me->is_live ())
     return ly_interval2scm (Interval ());
   
-  String gl = ly_scm2string (gn);
+  std::string gl = ly_scm2string (gn);
 
   /*
     urg.
@@ -177,7 +177,7 @@ Span_bar::calc_glyph_name (SCM smob)
       return SCM_UNSPECIFIED;
     }
 
-  String type = ly_scm2string (gl);
+  std::string type = ly_scm2string (gl);
   if (type == "|:")
     type = ".|";
   else if (type == ":|")
index 7a46b839ab7c5070ae3eb7d7838495114aebfafc..03ed5f1f4021bc5d0c24620e0380be620bfb48aa 100644 (file)
@@ -7,7 +7,9 @@
 */
 
 #include "performer.hh"
+
 #include "audio-item.hh"
+#include "international.hh"
 #include "music.hh"
 
 /*
index 77770cab3cc3c47f3f1095f2aff6c177e32a7144..4d2d53beb0fcbefcc01fba3166f587eb6cd8d925 100644 (file)
@@ -22,8 +22,8 @@ public:
   TRANSLATOR_DECLARATIONS (Staff_performer);
   ~Staff_performer ();
 
-  String new_instrument_string ();
-  String instrument_string_;
+  std::string new_instrument_string ();
+  std::string instrument_string_;
 
 protected:
   virtual void acknowledge_audio_element (Audio_element_info info);
@@ -77,7 +77,7 @@ Staff_performer::initialize ()
 void
 Staff_performer::process_music ()
 {
-  String str = new_instrument_string ();
+  std::string str = new_instrument_string ();
   if (str.length ())
     {
       instrument_name_ = new Audio_text (Audio_text::INSTRUMENT_NAME, str);
@@ -124,7 +124,7 @@ Staff_performer::finalize ()
   audio_staff_ = 0;
 }
 
-String
+std::string
 Staff_performer::new_instrument_string ()
 {
   // mustn't ask Score for instrument: it will return piano!
index a4cf1d368a4f7721dbe4b17a7344a17783c3e641..994d642c0ae0352baa371dcb0d03b240733f0cda 100644 (file)
@@ -102,8 +102,9 @@ Staff_spacing::bar_y_positions (Grob *bar_grob)
       SCM glyph = bar_grob->get_property ("glyph-name");
       Grob *staff_sym = Staff_symbol_referencer::get_staff_symbol (bar_grob);
 
-      String glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : "";
-      if (glyph_string.left_string (1) == "|" || glyph_string.left_string (1) == ".")
+      std::string glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : "";
+      if (glyph_string.substr (0, 1) == "|"
+         || glyph_string.substr (0, 1) == ".")
        {
          Grob *common = bar_grob->common_refpoint (staff_sym, Y_AXIS);
          Interval bar_size = bar_grob->extent (common, Y_AXIS);
index 41a1107d9dc31cc6335a7bd5ad8c6a1f81a37555..b14bdbae649ccf0daf573c51470a573e0240e0c8 100644 (file)
@@ -6,9 +6,12 @@
   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
+#include "engraver.hh"
+
 #include "context.hh"
 #include "directional-element-interface.hh"
-#include "engraver.hh"
+#include "duration.hh"
+#include "international.hh"
 #include "item.hh"
 #include "misc.hh"
 #include "rhythmic-head.hh"
@@ -16,7 +19,6 @@
 #include "staff-symbol-referencer.hh"
 #include "stem-tremolo.hh"
 #include "stem.hh"
-#include "duration.hh"
 
 /**
    Make stems upon receiving noteheads.
index 6829af1a358d66f6b155f0b8577151973a14a709..e572acb652f1bd6a04dd75b309cbd94850ac4959 100644 (file)
 #include <cmath>               // rint
 using namespace std;
 
-#include "lookup.hh"
+#include "beam.hh"
 #include "directional-element-interface.hh"
+#include "dot-column.hh"
+#include "font-interface.hh"
+#include "international.hh"
+#include "lookup.hh"
+#include "misc.hh"
 #include "note-head.hh"
-#include "warn.hh"
 #include "output-def.hh"
-#include "rhythmic-head.hh"
-#include "font-interface.hh"
 #include "paper-column.hh"
-#include "misc.hh"
-#include "beam.hh"
-#include "rest.hh"
 #include "pointer-group-interface.hh"
-#include "staff-symbol-referencer.hh"
+#include "rest.hh"
+#include "rhythmic-head.hh"
 #include "side-position-interface.hh"
-#include "dot-column.hh"
+#include "staff-symbol-referencer.hh"
 #include "stem-tremolo.hh"
+#include "warn.hh"
 
 void
 Stem::set_beaming (Grob *me, int beam_count, Direction d)
@@ -547,7 +548,7 @@ Stem::flag (Grob *me)
     TODO: maybe property stroke-style should take different values,
     e.g. "" (i.e. no stroke), "single" and "double" (currently, it's
     '() or "grace").  */
-  String flag_style;
+  std::string flag_style;
 
   SCM flag_style_scm = me->get_property ("flag-style");
   if (scm_is_symbol (flag_style_scm))
@@ -558,8 +559,8 @@ Stem::flag (Grob *me)
 
   bool adjust = true;
 
-  String staffline_offs;
-  if (String::compare (flag_style, "mensural") == 0)
+  std::string staffline_offs;
+  if (flag_style == "mensural")
     /* Mensural notation: For notes on staff lines, use different
        flags than for notes between staff lines.  The idea is that
        flags are always vertically aligned with the staff lines,
@@ -581,7 +582,7 @@ Stem::flag (Grob *me)
     staffline_offs = "";
 
   char dir = (get_grob_direction (me) == UP) ? 'u' : 'd';
-  String font_char = flag_style
+  std::string font_char = flag_style
     + to_string (dir) + staffline_offs + to_string (log);
   Font_metric *fm = Font_interface::get_default_font (me);
   Stencil flag = fm->find_by_name ("flags." + font_char);
@@ -591,10 +592,10 @@ Stem::flag (Grob *me)
   SCM stroke_style_scm = me->get_property ("stroke-style");
   if (scm_is_string (stroke_style_scm))
     {
-      String stroke_style = ly_scm2string (stroke_style_scm);
+      std::string stroke_style = ly_scm2string (stroke_style_scm);
       if (!stroke_style.empty ())
        {
-         String font_char = to_string (dir) + stroke_style;
+         std::string font_char = to_string (dir) + stroke_style;
          Stencil stroke = fm->find_by_name ("flags." + font_char);
          if (stroke.is_empty ())
            me->warning (_f ("flag stroke `%s' not found", font_char));
index fe7d121e382a927c7966f564f9840ca393a64d57..b1d87e79a3885d542f1cfff6f8d55d0e98370608 100644 (file)
@@ -44,18 +44,18 @@ Sustain_pedal::print (SCM smob)
   if (!scm_is_string (glyph))
     return mol.smobbed_copy ();
 
-  String text = ly_scm2string (glyph);
+  std::string text = ly_scm2string (glyph);
 
-  for (int i = 0; i < text.length (); i++)
+  for (ssize i = 0; i < text.length (); i++)
     {
-      String idx ("pedal.");
-      if (text.cut_string (i, 3) == "Ped")
+      std::string idx ("pedal.");
+      if (text.substr (i, 3) == "Ped")
        {
          idx += "Ped";
          i += 2;
        }
       else
-       idx += String (&text.to_bytes ()[i], 1);
+       idx += std::string (&text.c_str ()[i], 1);
       Stencil m = Font_interface::get_default_font (e)->find_by_name (idx);
       if (!m.is_empty ())
        mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
index 147d85c8636567805fa8198c3b6e45c93393ebdc..4da50a8292757b730cd8844fb81db5f1fe3e8d03 100644 (file)
@@ -8,22 +8,22 @@
 
 #include "system.hh"
 
-
 #include "align-interface.hh"
+#include "all-font-metrics.hh"
 #include "axis-group-interface.hh"
-#include "warn.hh"
+#include "grob-array.hh"
+#include "international.hh"
 #include "main.hh"
-#include "paper-column.hh"
 #include "output-def.hh"
+#include "paper-column.hh"
 #include "paper-score.hh"
-#include "warn.hh"
-#include "all-font-metrics.hh"
+#include "paper-system.hh"
+#include "pointer-group-interface.hh"
 #include "spacing-interface.hh"
 #include "staff-symbol-referencer.hh"
-#include "paper-system.hh"
 #include "tweak-registration.hh"
-#include "grob-array.hh"
-#include "pointer-group-interface.hh"
+#include "warn.hh"
+#include "warn.hh"
 
 System::System (System const &src, int count)
   : Spanner (src, count)
index d2581833b634cc307a29a2a19e29c883c81fdccb..6ecd872febc2963278f76b67c277b940b05cab23 100644 (file)
@@ -20,7 +20,7 @@ Interval_t<Rational>::infinity ()
 }
 
 template<>
-Std_string
+std::string
 Interval_t<Rational>::T_to_string (Rational a)
 {
   return a.to_string ();
index c21975bb8f8e0beac67c105b596675728a84dfb5..d95ed7a63aec4766214fad589689d707a8a319de 100644 (file)
@@ -32,7 +32,7 @@ Text_interface::interpret_string (SCM layout_smob,
   SCM_ASSERT_TYPE (scm_is_string (markup), markup, SCM_ARG3,
                   __FUNCTION__, "string");
 
-  String str = ly_scm2string (markup);
+  std::string str = ly_scm2string (markup);
 
   Font_metric *fm = select_encoded_font (layout, props);
   return fm->text_stencil (str).smobbed_copy ();
index 89dbfbd1cbfe34468206384b15fd1a7b603e5439..dbeafffef631a2dad88362e37d68d9150f8aa1af 100644 (file)
@@ -19,7 +19,7 @@ lookup_tex_text_dimension (Font_metric *font, SCM text)
   Box b;
 
   SCM limit = ly_lily_module_constant ("TEX_STRING_HASHLIMIT");
-  String key_str = ly_scm2string (font->font_file_name ());
+  std::string key_str = ly_scm2string (font->font_file_name ());
   int hash_code = scm_to_int (scm_hash (text, limit));
   key_str = to_string (hash_code) + key_str;
 
@@ -70,12 +70,12 @@ LY_DEFINE (ly_load_text_dimensions, "ly:load-text-dimensions",
 }
 
 void
-try_load_text_metrics (String basename)
+try_load_text_metrics (std::string basename)
 {
-  String path = global_path.find (basename + ".textmetrics");
+  std::string path = global_path.find (basename + ".textmetrics");
   if (path != "")
     {
-      String contents (gulp_file_to_string (path, true, -1));
+      std::string contents (gulp_file_to_string (path, true, -1));
       contents = "(quote (" + contents + "))";
 
       SCM lst = scm_c_eval_string (contents.c_str ());
index baee8ee50875966fbbcc6e86b7cf9e7bb6022116..d5212ded7fbd43f657f9f361253c0baf890002f5 100644 (file)
@@ -6,9 +6,11 @@
   (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
+#include "engraver.hh"
+
+#include "international.hh"
 #include "note-column.hh"
 #include "side-position-interface.hh"
-#include "engraver.hh"
 
 class Text_spanner_engraver : public Engraver
 {
index bd45cecc7e5037dfe971ed955354a74d9f3c5cc9..a14a929d3c059f397bfceb21e382a713db62f741 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "tfm-reader.hh"
 
+#include "international.hh"
 #include "string-convert.hh"
 #include "warn.hh"
 
@@ -19,7 +20,7 @@
   (1 << 20)
 static const Real fix_to_real (Fix f);
 
-Tex_font_metric_reader::Tex_font_metric_reader (String name)
+Tex_font_metric_reader::Tex_font_metric_reader (std::string name)
   : input_ (name)
 {
 
@@ -54,11 +55,11 @@ Tex_font_metric_reader::get_U32_fix_scaled ()
   return get_U32_fix () * info_.design_size;
 }
 
-String
+std::string
 Tex_font_metric_reader::get_bcpl_string ()
 {
   U8 length_u8 = input_.get_U8 ();
-  String str = input_.get_string (length_u8);
+  std::string str = input_.get_string (length_u8);
   return str;
 }
 
index 9a8d7ee08a2c6289ee4cf4d7444de46e29b63ed6..82a4fee1eea68c37c38fa83ba8b790c49bb3ba91 100644 (file)
@@ -8,12 +8,14 @@
   some code shamelessly copied from GNU fontutils-0.6/tfm/tfm_input.c
 */
 
-#include "file-name.hh"
 #include "tfm.hh"
-#include "tfm-reader.hh"
+
+#include "dimensions.hh"
+#include "file-name.hh"
+#include "international.hh"
 #include "string-convert.hh"
+#include "tfm-reader.hh"
 #include "warn.hh"
-#include "dimensions.hh"
 
 static Tex_font_char_metric dummy_static_char_metric;
 
@@ -89,7 +91,7 @@ Tex_font_metric::get_ascii_char (int a) const
 }
 
 SCM
-Tex_font_metric::make_tfm (String file_name)
+Tex_font_metric::make_tfm (std::string file_name)
 {
   Tex_font_metric *tfm = new Tex_font_metric;
   Tex_font_metric_reader reader (file_name);
@@ -116,14 +118,14 @@ Tex_font_metric::design_size () const
   return info_.design_size * point_constant;
 }
 
-String
+std::string
 Tex_font_metric::font_name () const
 {
   return font_name_;
 }
 
 int
-Tex_font_metric::name_to_index (String) const
+Tex_font_metric::name_to_index (std::string) const
 {
   assert (false);
   return 0;
index f5ee147e21caf6fb0130d4bbd1667d1bc786a929..63822226763a792f416e96e5e19c1fbd85e4b8ab 100644 (file)
@@ -6,17 +6,19 @@
   (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "tie.hh"
+#include "engraver.hh"
+
 #include "context.hh"
+#include "grob-pitch-tuple.hh"
+#include "international.hh"
+#include "item.hh"
+#include "note-head.hh"
 #include "protected-scm.hh"
 #include "spanner.hh"
+#include "staff-symbol-referencer.hh"
 #include "tie-column.hh"
-#include "engraver.hh"
-#include "item.hh"
-#include "grob-pitch-tuple.hh"
+#include "tie.hh"
 #include "warn.hh"
-#include "note-head.hh"
-#include "staff-symbol-referencer.hh"
 
 /**
    Manufacture ties.  Acknowledge noteheads, and put them into a
index 309d45f1ffee52fdb8de0137ecb71ba9769e804a..e1385ce2cc3f93bf86812b3ab772ad4d81df1a6a 100644 (file)
@@ -7,8 +7,10 @@
 */
 
 #include "time-scaled-music-iterator.hh"
+
 #include "context.hh"
 #include "input.hh"
+#include "international.hh"
 
 void
 Time_scaled_music_iterator::process (Moment m)
index c90ee4b33150abfae99a0a9ed44b725fbf10f467..df4a4114c74b67425d2a126960f0ced83f1dac1d 100644 (file)
@@ -6,10 +6,12 @@
   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "time-signature.hh"
-#include "warn.hh"
 #include "engraver-group.hh"
+
+#include "international.hh"
 #include "misc.hh"
+#include "time-signature.hh"
+#include "warn.hh"
 
 /**
    generate time_signatures.
index acc057e6713033917461e101545f745e824c3f13..66b788a181e27c0a0a539486f3b367715bac3ba6 100644 (file)
@@ -8,11 +8,12 @@
 
 #include "time-signature.hh"
 
-#include "text-interface.hh"
-#include "output-def.hh"
 #include "font-interface.hh"
-#include "warn.hh"
+#include "international.hh"
+#include "output-def.hh"
 #include "staff-symbol-referencer.hh"
+#include "text-interface.hh"
+#include "warn.hh"
 
 /*
   TODO:
@@ -53,7 +54,7 @@ Time_signature::print (SCM smob)
 Stencil
 Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
 {
-  String style = ly_scm2string (scm_symbol_to_string (scm_style));
+  std::string style = ly_scm2string (scm_symbol_to_string (scm_style));
 
   if (style == "numbered")
     return numbered_time_signature (me, n, d);
@@ -69,7 +70,7 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
        return numbered_time_signature (me, n, d);
     }
 
-  String char_name = style + to_string (n) + to_string (d);
+  std::string char_name = style + to_string (n) + to_string (d);
   me->set_property ("font-encoding", ly_symbol2scm ("fetaMusic"));
   Stencil out = Font_interface::get_default_font (me)
     ->find_by_name ("timesig." + char_name);
index 65bfa015fe5984b7057d56ab6b196c43425a55a2..1fe410f25dd7edad95484447d86602da7b323687 100644 (file)
@@ -7,6 +7,8 @@
 */
 
 #include "translator.hh"
+
+#include "international.hh"
 #include "scm-hash.hh"
 #include "warn.hh"
 
index 56d49add4697d52eac4a682d5e5d6ac7d57d6191..d55fe15729b9677b7f07d138b26c8d66fe836c25 100644 (file)
@@ -164,9 +164,9 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
   Acknowledge_information inf;
   inf.function_ = ptr;
 
-  String interface_name (func_name);
+  std::string interface_name (func_name);
 
-  interface_name = interface_name.substitute ('_', '-');
+  interface_name = replace_all (interface_name, '_', '-');
   interface_name += "-interface";
 
   inf.symbol_ = scm_gc_protect_object (ly_symbol2scm (interface_name.c_str ()));
index a2cccde61ae1610de83567f0074e52a043bf2dd3..2b72316660e212bdc9455cc1ab5a582739796b2c 100644 (file)
   automatically is the end of the trill?
 */
 
+#include "engraver.hh"
+
+#include "international.hh"
 #include "note-column.hh"
 #include "side-position-interface.hh"
-#include "engraver.hh"
 
 #include "translator.icc"
 
index 9cbfd730fc36e9bec8f6bc2f9305c92e688bf74a..a457ac4cc6257e446df4765be64c07b46d8d247e 100644 (file)
@@ -86,7 +86,7 @@ print_header (void *out, FT_Face face)
 #define CHUNKSIZE 65534
 
 static void
-print_body (void *out, String name)
+print_body (void *out, std::string name)
 {
   FILE *fd = fopen (name.c_str (), "rb");
 
@@ -152,7 +152,7 @@ print_trailer (void *out,
 }
 
 static void
-create_type42_font (void *out, String name)
+create_type42_font (void *out, std::string name)
 {
   FT_Face face = open_ft_face (name);
 
@@ -170,7 +170,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
 {
   SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
                   SCM_ARG1, __FUNCTION__, "string");
-  String file_name = ly_scm2string (ttf_file_name);
+  std::string file_name = ly_scm2string (ttf_file_name);
   if (be_verbose_global)
     progress_indication ("[" + file_name);
 
@@ -196,7 +196,7 @@ LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa",
   SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
                   SCM_ARG1, __FUNCTION__, "string");
 
-  String file_name = ly_scm2string (ttf_file_name);
+  std::string file_name = ly_scm2string (ttf_file_name);
   if (be_verbose_global)
     progress_indication ("[" + file_name);
 
index 31005fac31d6a123a5c94ec0215ac2b778213004..bb535d3442ddb1e1ebec42bd4fc4537b310fe77c 100644 (file)
@@ -7,14 +7,16 @@
 */
 
 #include "gregorian-ligature-engraver.hh"
+
+#include "font-interface.hh"
 #include "gregorian-ligature.hh"
-#include "vaticana-ligature.hh"
+#include "international.hh"
+#include "output-def.hh"
+#include "paper-column.hh"
 #include "spanner.hh"
 #include "staff-symbol-referencer.hh"
-#include "font-interface.hh"
+#include "vaticana-ligature.hh"
 #include "warn.hh"
-#include "output-def.hh"
-#include "paper-column.hh"
 
 #include "translator.icc"
 
@@ -198,7 +200,7 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
                                        "ignoring grob");
          continue;
        }
-      String glyph_name = ly_scm2string (glyph_name_scm);
+      std::string glyph_name = ly_scm2string (glyph_name_scm);
 
       int delta_pitch = 0;
       if (prev_primitive) /* urgh, need prev_primitive only here */
@@ -236,8 +238,7 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
            - Font_interface::get_default_font (primitive)->
            find_by_name ("noteheads.s" + glyph_name).extent (X_AXIS).length ();
        }
-      else if (!String::compare (glyph_name, "flexa")
-              || !String::compare (glyph_name, ""))
+      else if (glyph_name == "flexa" || glyph_name == "")
        {
          /*
           * This head represents either half of a flexa shape.
@@ -290,7 +291,7 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
              ligature_width -= join_thickness;
            }
        }
-      else if (!String::compare (glyph_name, ""))
+      else if (glyph_name == "")
        {
          /*
           * This is the 2nd (virtual) head of flexa shape.  Join it
@@ -342,7 +343,7 @@ check_for_prefix_loss (Item *primitive)
     = scm_to_int (primitive->get_property ("prefix-set"));
   if (prefix_set & ~PES_OR_FLEXA)
     {
-      String prefs = Gregorian_ligature::prefixes_to_str (primitive);
+      std::string prefs = Gregorian_ligature::prefixes_to_str (primitive);
       primitive->warning (_f ("ignored prefix (es) `%s' of this head according "
                              "to restrictions of the selected ligature style",
                              prefs.c_str ()));
@@ -361,7 +362,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
   int prev_prefix_set = 0;
   int prev_context_info = 0;
   int prev_delta_pitch = 0;
-  String prev_glyph_name = "";
+  std::string prev_glyph_name = "";
   for (int i = 0; i < primitives.size (); i++)
     {
       Item *primitive = dynamic_cast<Item *> (primitives[i].grob ());
@@ -396,7 +397,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
        * this decision must be made here in the engraver rather than in
        * the backend).
        */
-      String glyph_name;
+      std::string glyph_name;
       if (prefix_set & VIRGA)
        {
          glyph_name = "vaticana.punctum";
@@ -504,7 +505,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
        * head of a pes, and if it is a punctum.
        */
       if ((context_info & FLEXA_LEFT) && ! (context_info & PES_UPPER))
-       if (!String::compare (glyph_name, "vaticana.punctum"))
+       if (glyph_name == "vaticana.punctum")
          primitive->set_property ("add-cauda", ly_bool2scm (true));
 
       /*
@@ -543,7 +544,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
        {
          if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD))
            {
-             if (!String::compare (prev_glyph_name, "vaticana.punctum"))
+             if (prev_glyph_name == "vaticana.punctum")
                if (prev_delta_pitch > 1)
                  prev_glyph_name = "vaticana.lpes";
                else
index 1fdf2b5430a9536645ee675d3e2a32d41c33bf11..87c983dcb3cdeaf1096bd3d2ba61270110822041 100644 (file)
@@ -8,14 +8,14 @@
 
 #include "vaticana-ligature.hh"
 
-
-#include "item.hh"
+#include "bezier.hh"
 #include "font-interface.hh"
+#include "international.hh"
+#include "item.hh"
 #include "lookup.hh"
-#include "staff-symbol-referencer.hh"
 #include "note-head.hh"
 #include "output-def.hh"
-#include "bezier.hh"
+#include "staff-symbol-referencer.hh"
 #include "warn.hh"
 
 Stencil
@@ -197,7 +197,7 @@ vaticana_brew_primitive (Grob *me)
       return Stencil ();
     }
 
-  String glyph_name = ly_scm2string (glyph_name_scm);
+  std::string glyph_name = ly_scm2string (glyph_name_scm);
 
   Stencil out;
   Real thickness = robust_scm2double (me->get_property ("thickness"), 1);
@@ -223,7 +223,7 @@ vaticana_brew_primitive (Grob *me)
   bool add_cauda = to_boolean (me->get_property ("add-cauda"));
   bool add_join = to_boolean (me->get_property ("add-join"));
 
-  if (!String::compare (glyph_name, ""))
+  if (glyph_name == "")
     {
       /*
        * This is an empty head.  This typically applies for the right
@@ -237,7 +237,7 @@ vaticana_brew_primitive (Grob *me)
       out
        = Lookup::blank (Box (Interval (0, 0.5 * flexa_width), Interval (0, 0)));
     }
-  else if (!String::compare (glyph_name, "flexa"))
+  else if (glyph_name == "flexa")
     out = vaticana_brew_flexa (me, true, line_thickness);
   else
     {
index ad316bd5e268f9cb13f30785be2c5cd325cb5676..890490069c89df1af85aef63253aeeb5de9a7168 100644 (file)
@@ -98,7 +98,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i)
 {
   if (qualifies (i))
     {
-      String id = i.context ()->id_string ();
+      std::string id = i.context ()->id_string ();
 
       scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.c_str ()),
                      i.grob ()->self_scm ());
index f314d807a29fde4553667f44a0ffc18bee140c9d..595ed9b192cdc3732b4090d538de67373042e9ff 100644 (file)
@@ -119,7 +119,7 @@ Volta_bracket_interface::after_line_breaking (SCM smob)
   Grob *endbar = bars.size () ? bars.top () : 0;
   SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL;
 
-  String str;
+  std::string str;
   if (scm_is_string (glyph))
     str = ly_scm2string (glyph);
   else
index 4a6c555d9610a3407e76e03089acf5d564192ce8..1f64defa4a533b066acc1ce9ae25c021584c2367 100644 (file)
@@ -7,14 +7,16 @@
 */
 
 #include "engraver.hh"
+
+#include "bar-line.hh"
 #include "context.hh"
-#include "volta-bracket.hh"
+#include "international.hh"
 #include "note-column.hh"
-#include "bar-line.hh"
 #include "side-position-interface.hh"
-#include "warn.hh"
 #include "staff-symbol.hh"
 #include "text-interface.hh"
+#include "volta-bracket.hh"
+#include "warn.hh"
 
 #include "translator.icc"
 
index d7399493943d5be3f507515f3e07facaf9ad800e..8ff30631ea07a41e82ce0d0b38ede910cf5066a0 100644 (file)
@@ -84,7 +84,7 @@ Volta_repeat_iterator::next_element (bool side_effect)
     {
       if (alt_count_)
        {
-         String repstr = to_string (rep_count_ - alt_count_ + done_count_) + ".";
+         std::string repstr = to_string (rep_count_ - alt_count_ + done_count_) + ".";
          if (done_count_ > 1)
            {
              add_repeat_command (scm_list_n (ly_symbol2scm ("volta"), SCM_BOOL_F, SCM_UNDEFINED));