ctkVersion.h

Go to the documentation of this file.
00001 /*=============================================================================
00002 
00003   Library: CTK
00004 
00005   Copyright (c) 2010 German Cancer Research Center,
00006     Division of Medical and Biological Informatics
00007 
00008   Licensed under the Apache License, Version 2.0 (the "License");
00009   you may not use this file except in compliance with the License.
00010   You may obtain a copy of the License at
00011 
00012     http://www.apache.org/licenses/LICENSE-2.0
00013 
00014   Unless required by applicable law or agreed to in writing, software
00015   distributed under the License is distributed on an "AS IS" BASIS,
00016   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017   See the License for the specific language governing permissions and
00018   limitations under the License.
00019 
00020 =============================================================================*/
00021 
00022 #ifndef CTKVERSION_H
00023 #define CTKVERSION_H
00024 
00025 #include <QString>
00026 #include <QRegExp>
00027 
00028 #include "CTKPluginFrameworkExport.h"
00029 
00030 
00050   class CTK_PLUGINFW_EXPORT ctkVersion {
00051 
00052   private:
00053 
00054     friend class ctkPluginPrivate;
00055     friend class ctkVersionRange;
00056 
00057     unsigned int majorVersion;
00058     unsigned int minorVersion;
00059     unsigned int microVersion;
00060     QString      qualifier;
00061 
00062     static const QString SEPARATOR; //  = "."
00063     static const QRegExp RegExp;
00064 
00065 
00071     void validate();
00072 
00073     ctkVersion& operator=(const ctkVersion& v);
00074 
00075     ctkVersion();
00076 
00077   public:
00078 
00082     static const ctkVersion& emptyVersion();
00083 
00095     ctkVersion(unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion);
00096 
00105     ctkVersion(unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion, const QString& qualifier);
00106 
00127     ctkVersion(const QString& version);
00128 
00134     ctkVersion(const ctkVersion& version);
00135 
00136 
00150     static ctkVersion parseVersion(const QString& version);
00151 
00157     unsigned int getMajor() const;
00158 
00164     unsigned int getMinor() const;
00165 
00171     unsigned int getMicro() const;
00172 
00178     QString getQualifier() const;
00179 
00190     QString toString() const;
00191 
00205     bool operator==(const ctkVersion& object) const;
00206 
00230     int compare(const ctkVersion& object) const;
00231 
00232   };
00233 
00234 
00235 CTK_PLUGINFW_EXPORT QDebug operator<<(QDebug dbg, const ctkVersion& v);
00236 
00237 #endif // CTKVERSION_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1