]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lilypond-version.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / lilypond-version.cc
index 93a5ceba88128a47263880af2f635478f5ee6805..21ca2e5212cadbed5bab65db906ab2b9f284cd61 100644 (file)
@@ -8,9 +8,9 @@
 
 #include <ctype.h>
 
-#include "lilypond-input-version.hh"
+#include "lilypond-version.hh"
 #include "string-convert.hh"
-#include "array.hh"
+#include "misc.hh"
 
 Lilypond_version::Lilypond_version (int major, int minor, int patch)
 {
@@ -19,33 +19,35 @@ Lilypond_version::Lilypond_version (int major, int minor, int patch)
   patch_ = patch;
 }
 
-Lilypond_version::Lilypond_version (String str)
+Lilypond_version::Lilypond_version (string str)
 {
   major_ = 0; 
   minor_ = 0;
   patch_ = 0;
   
-  Array<String> version;
-  version = String_convert::split (str, '.');
+  vector<string> version;
+  version = string_split (str, '.');
 
   if (version.size () > 0 && isdigit (version[0][0]))
-    major_ = version[0].to_int ();
+    major_ = String_convert::dec2int (version[0]);
   if (version.size () > 1 && isdigit (version[1][0]))
-    minor_ = version[1].to_int ();
+    minor_ = String_convert::dec2int (version[1]);
   
   patch_ = 0;
   if (version.size () >= 3
       && isdigit (version[2][0]))
-    patch_ = version[2].to_int ();
+    patch_ = String_convert::dec2int (version[2]);
 
   if (version.size () >= 4)
     extra_patch_string_ = version[3];
 }
 
-String
+string
 Lilypond_version::to_string () const
 {
-  return ::to_string (major_) + "." + ::to_string (minor_) + "." + ::to_string (patch_);
+  return ::to_string (major_)
+    + "." + ::to_string (minor_)
+    + "." + ::to_string (patch_);
 }
 
 Lilypond_version::operator int () const