PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: Version.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLCORE_VERSION_H__ 00024 #define __PLCORE_VERSION_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLCore/String/String.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLCore { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Version class 00046 */ 00047 class Version { 00048 00049 00050 //[-------------------------------------------------------] 00051 //[ Public functions ] 00052 //[-------------------------------------------------------] 00053 public: 00054 /** 00055 * @brief 00056 * Constructor 00057 */ 00058 PLCORE_API Version(); 00059 00060 /** 00061 * @brief 00062 * Constructor 00063 * 00064 * @param[in] sName 00065 * Project name 00066 * @param[in] sCodename 00067 * Code name for this release 00068 * @param[in] nMajor 00069 * Major version number 00070 * @param[in] nMinor 00071 * Minor version number 00072 * @param[in] nPatch 00073 * Patch number 00074 * @param[in] sRelease 00075 * Release name (e.g. "r1" for release #1, "rc1" for release candidate #1, "nightly-date" for a nightly build etc.) 00076 */ 00077 PLCORE_API Version(const String &sName, const String &sCodename, uint16 nMajor, uint16 nMinor, uint16 nPatch, const String &sRelease); 00078 00079 /** 00080 * @brief 00081 * Destructor 00082 */ 00083 inline ~Version(); 00084 00085 /** 00086 * @brief 00087 * Get project name 00088 * 00089 * @return 00090 * Name of the project 00091 */ 00092 inline String GetName() const; 00093 00094 /** 00095 * @brief 00096 * Set project name 00097 * 00098 * @param[in] sName 00099 * Name of the project 00100 */ 00101 inline void SetName(const String &sName); 00102 00103 /** 00104 * @brief 00105 * Get codename 00106 * 00107 * @return 00108 * Codename of the release 00109 */ 00110 inline String GetCodename() const; 00111 00112 /** 00113 * @brief 00114 * Set codename 00115 * 00116 * @param[in] sCodename 00117 * Codename of the release 00118 */ 00119 inline void SetCodename(const String &sCodename); 00120 00121 /** 00122 * @brief 00123 * Get major version number 00124 * 00125 * @return 00126 * Major version 00127 */ 00128 inline uint16 GetMajor() const; 00129 00130 /** 00131 * @brief 00132 * Set major version number 00133 * 00134 * @param[in] nMajor 00135 * Major version 00136 */ 00137 inline void SetMajor(uint16 nMajor); 00138 00139 /** 00140 * @brief 00141 * Get minor version number 00142 * 00143 * @return 00144 * Minor version 00145 */ 00146 inline uint16 GetMinor() const; 00147 00148 /** 00149 * @brief 00150 * Set minor version number 00151 * 00152 * @param[in] nMinor 00153 * Minor version 00154 */ 00155 inline void SetMinor(uint16 nMinor); 00156 00157 /** 00158 * @brief 00159 * Get patch number 00160 * 00161 * @return 00162 * Patch number 00163 */ 00164 inline uint16 GetPatch() const; 00165 00166 /** 00167 * @brief 00168 * Set patch number 00169 * 00170 * @param[in] nPatch 00171 * Patch number 00172 */ 00173 inline void SetPatch(uint16 nPatch); 00174 00175 /** 00176 * @brief 00177 * Get release name 00178 * 00179 * @return 00180 * Release name 00181 */ 00182 inline String GetRelease() const; 00183 00184 /** 00185 * @brief 00186 * Set release name 00187 * 00188 * @param[in] sRelease 00189 * Release name 00190 */ 00191 inline void SetRelease(const String &sRelease); 00192 00193 /** 00194 * @brief 00195 * Returns a string representation of the version 00196 * 00197 * @return 00198 * String representation (for example: FooBar 1.0.1-rc5 - Bulky Bug) 00199 */ 00200 PLCORE_API String ToString() const; 00201 00202 //[-------------------------------------------------------] 00203 //[ Comparison ] 00204 //[-------------------------------------------------------] 00205 PLCORE_API bool operator ==(const Version &cVersion) const; 00206 PLCORE_API bool operator !=(const Version &cVersion) const; 00207 PLCORE_API bool operator <(const Version &cVersion) const; 00208 PLCORE_API bool operator >(const Version &cVersion) const; 00209 PLCORE_API bool operator <=(const Version &cVersion) const; 00210 PLCORE_API bool operator >=(const Version &cVersion) const; 00211 00212 00213 //[-------------------------------------------------------] 00214 //[ Private data ] 00215 //[-------------------------------------------------------] 00216 private: 00217 String m_sName; /**< Project name */ 00218 String m_sCodename; /**< Code name for this release */ 00219 uint16 m_nMajor; /**< Major version number */ 00220 uint16 m_nMinor; /**< Minor version number */ 00221 uint16 m_nPatch; /**< Patch number */ 00222 String m_sRelease; /**< Release name (e.g. "r1") */ 00223 00224 00225 }; 00226 00227 00228 //[-------------------------------------------------------] 00229 //[ Namespace ] 00230 //[-------------------------------------------------------] 00231 } // PLCore 00232 00233 00234 //[-------------------------------------------------------] 00235 //[ Implementation ] 00236 //[-------------------------------------------------------] 00237 #include "PLCore/Tools/Version.inl" 00238 00239 00240 #endif // __PLCORE_VERSION_H__
|