Keith Gardner schreef op 13-5-2014 22:31:
imo, the cases which are fully under the user's control (internal
version checking) should be handled solely numerically (even without
considering any pre-releases), which basically means a minimalistic
semver(-like) implementation which can be fully inline (or even just a
collection of macros). in this segment, it is entirely unreasonable to
try to support existing users with bizarre versioning schemes, because
they most likely already have their own solutions. and new users
can be
told to use the straight-forward system.
With that perspective, we can accomplish that now by just dropping the
suffix, which was what my initial proposal for QVersion was. The
request to include suffix information came from the reviewers and this
mailing list.
I think that makes sense, but it would be nice if it would be easy for
the user of the class to extend the version checking himself for
non-numerical sections of the version string. That could be done in
several ways I think, for instance with an API like this:
QVersion
{
...
protected:
virtual bool isNonNumericalSectionLessThan(int section, QStringRef
sectionString) const;
...
}
The default implementation would simply return false and thus not try to
do any sorting.
That or another method to accomplish the same makes it easy to use the
class for basic version numbers, while still be flexible enough for
users to handle their own systems for pre and postfixes, right?
André
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development