tversionnumber.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2020 by Kevin Andre
email : hyperquantum@gmail.com
copyright : (C) 2023 by Urs Fleisch
email : ufleisch@users.sourceforge.net
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_VERSIONNUMBER_H
#define TAGLIB_VERSIONNUMBER_H
#include "taglib_export.h"
namespace TagLib {
class String;
class TAGLIB_EXPORT VersionNumber {
public:
constexpr VersionNumber(unsigned int major, unsigned int minor,
unsigned int patch = 0)
: m_combined(((major & 0xff) << 16) | ((minor & 0xff) << 8)
| (patch & 0xff)) {
}
constexpr unsigned int combinedVersion() const {
return m_combined;
}
constexpr unsigned int majorVersion() const {
return (m_combined & 0xff0000) >> 16;
}
constexpr unsigned int minorVersion() const {
return (m_combined & 0xff00) >> 8;
}
constexpr unsigned int patchVersion() const {
return m_combined & 0xff;
}
constexpr bool operator==(const VersionNumber &rhs) const {
return m_combined == rhs.m_combined;
}
constexpr bool operator!=(const VersionNumber &rhs) const {
return m_combined != rhs.m_combined;
}
constexpr bool operator<(const VersionNumber &rhs) const {
return m_combined < rhs.m_combined;
}
constexpr bool operator>(const VersionNumber &rhs) const {
return m_combined > rhs.m_combined;
}
constexpr bool operator<=(const VersionNumber &rhs) const {
return m_combined <= rhs.m_combined;
}
constexpr bool operator>=(const VersionNumber &rhs) const {
return m_combined >= rhs.m_combined;
}
String toString() const;
private:
unsigned int m_combined;
};
TAGLIB_EXPORT VersionNumber runtimeVersion();
} // namespace TagLib
#endif
TagLib::String
A wide string class suitable for unicode.
Definition tstring.h:83
TagLib::VersionNumber::majorVersion
constexpr unsigned int majorVersion() const
Definition tversionnumber.h:63
TagLib::VersionNumber::runtimeVersion
TAGLIB_EXPORT VersionNumber runtimeVersion()
TagLib::VersionNumber::operator>
constexpr bool operator>(const VersionNumber &rhs) const
Definition tversionnumber.h:105
TagLib::VersionNumber::combinedVersion
constexpr unsigned int combinedVersion() const
Definition tversionnumber.h:56
TagLib::VersionNumber::operator==
constexpr bool operator==(const VersionNumber &rhs) const
Definition tversionnumber.h:84
TagLib::VersionNumber::operator<
constexpr bool operator<(const VersionNumber &rhs) const
Definition tversionnumber.h:98
TagLib::VersionNumber::toString
String toString() const
TagLib::VersionNumber::VersionNumber
constexpr VersionNumber(unsigned int major, unsigned int minor, unsigned int patch=0)
Definition tversionnumber.h:45
TagLib::VersionNumber::operator!=
constexpr bool operator!=(const VersionNumber &rhs) const
Definition tversionnumber.h:91
TagLib::VersionNumber::operator<=
constexpr bool operator<=(const VersionNumber &rhs) const
Definition tversionnumber.h:112
TagLib::VersionNumber::minorVersion
constexpr unsigned int minorVersion() const
Definition tversionnumber.h:70
TagLib::VersionNumber::patchVersion
constexpr unsigned int patchVersion() const
Definition tversionnumber.h:77
TagLib::VersionNumber::operator>=
constexpr bool operator>=(const VersionNumber &rhs) const
Definition tversionnumber.h:119
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40