2 lilypond-version.cc -- implement Lilypond_version
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "lilypond-input-version.hh"
10 #include "string-convert.hh"
13 Lilypond_version::Lilypond_version (int major, int minor, int patch)
20 Lilypond_version::Lilypond_version (String str)
22 Array<String> version;
23 version = String_convert::split (str, '.');
25 major_ = version[0].to_int ();
26 minor_ = version[1].to_int ();
28 if (version.size () >= 3)
29 patch_ = version[2].to_int ();
31 if (version.size () >= 4)
32 extra_patch_string_ = version[3];
36 Lilypond_version::to_string () const
38 return ::to_string (major_) + "." + ::to_string (minor_) + "." + ::to_string (patch_);
41 Lilypond_version::operator int () const
44 return 100000 * major_ + 1000 * minor_ + patch_;