diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /src/version.h | |
parent | Initial commit. (diff) | |
download | inkscape-upstream.tar.xz inkscape-upstream.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/version.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..ecf10b1 --- /dev/null +++ b/src/version.h @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Authors: + * MenTaLguY <mental@rydia.net> + * Jon A. Cruz <jon@joncruz.org> + * + * Copyright (C) 2003 MenTaLguY + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#ifndef SEEN_INKSCAPE_VERSION_H +#define SEEN_INKSCAPE_VERSION_H + +#define SVG_VERSION "1.1" + +#include <string> + +namespace Inkscape { + +class Version { +public: + + Version() : _major(0), _minor(0) {} + + // Note: somebody pollutes our namespace with major() and minor() + Version(unsigned mj, unsigned mn) : _major(mj), _minor(mn) {} + + bool operator>(Version const &other) const { + return _major > other._major || + ( _major == other._major && _minor > other._minor ); + } + + bool operator==(Version const &other) const { + return _major == other._major && _minor == other._minor; + } + + bool operator!=(Version const &other) const { + return _major != other._major || _minor != other._minor; + } + + bool operator<(Version const &other) const { + return _major < other._major || + ( _major == other._major && _minor < other._minor ); + } + + unsigned int _major; + unsigned int _minor; + std::string _tail; // Development version +}; + +} + +bool sp_version_from_string(const char *string, Inkscape::Version *version); + +char *sp_version_to_string(Inkscape::Version version); + +bool sp_version_inside_range(Inkscape::Version version, + unsigned major_min, unsigned minor_min, + unsigned major_max, unsigned minor_max); + +#endif // SEEN_INKSCAPE_VERSION_H +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)) + indent-tabs-mode:nil + fill-column:75 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |