(process_acknowledged_grobs):
[lilypond.git] / lily / lilypond-version.cc
blobca293c9a784276c6cafb0ae08aa93ac5876ceaa7
1 /*
2 lilypond-version.cc -- implement Lilypond_version
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2003 Jan Nieuwenhuizen <janneke@gnu.org>
8 */
10 #include "lilypond-input-version.hh"
11 #include "string-convert.hh"
12 #include "array.hh"
14 Lilypond_version::Lilypond_version (int major, int minor, int patch)
16 major_ = major;
17 minor_ = minor;
18 patch_ = patch;
21 Lilypond_version::Lilypond_version (String str)
23 Array<String> version;
24 version = String_convert::split (str, '.');
26 major_ = version[0].to_int ();
27 minor_ = version[1].to_int ();
28 patch_ = 0;
29 if (version.size () >= 3)
30 patch_ = version[2].to_int ();
32 if (version.size () >= 4)
33 extra_patch_string_ = version[3];
36 String
37 Lilypond_version::to_string () const
39 return ::to_string (major_) + "." + ::to_string (minor_) + "." + ::to_string (patch_);
42 Lilypond_version::operator int () const
44 // ugh
45 return 100000 * major_ + 1000 * minor_ + patch_;