UTVersionInfo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _UT_VERSION_INFO_H_
00026 #define _UT_VERSION_INFO_H_
00027
00028
00029
00030
00031
00032 #include "UT.h"
00033
00034
00035
00036
00037 #pragma pack(1)
00038
00039
00040 struct InternalVersionInfo_t
00041
00042 {
00043 uint8 major;
00044 uint8 minor;
00045 uint8 subminor;
00046 uint8 subsubminor;
00047 uint8 alpha;
00048 uint8 beta;
00049 uint8 rc;
00050 uint8 has_build_number;
00051 uint16 build_number;
00052 };
00053
00054 #pragma pack()
00055
00056
00057 extern void get_version_string( const InternalVersionInfo_t* version, out String_t* version_string );
00058
00059
00060
00061
00062
00063 class UT_EXPORT VersionInfo_t
00064
00135 {
00136
00137 public:
00138
00139 inline VersionInfo_t();
00141
00142 void Init(stringliteral* library_name = NULL);
00155
00156 inline uint8 MajorVersion() const;
00159
00160 inline uint8 MinorVersion() const;
00163
00164 inline uint8 SubminorVersion() const;
00167
00168 inline uint8 SubSubminorVersion() const;
00171
00172 inline bool IsAlphaVersion() const;
00175
00176 inline bool IsBetaVersion() const;
00179
00180 inline bool IsReleaseCandidate() const;
00183
00184 inline bool HasBuildNumber() const;
00187
00188 inline uint16 BuildNumber() const;
00190
00191 void GetVersionString(out String_t* version_string) const;
00193
00194
00195 private:
00196
00197 bool m_initialized;
00198 InternalVersionInfo_t m_info;
00199 };
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211 inline
00212 VersionInfo_t::VersionInfo_t()
00213 {
00214 m_initialized = false;
00215 }
00216
00217
00218 inline uint8
00219 VersionInfo_t::MajorVersion() const
00220 {
00221 assert(m_initialized);
00222 return m_info.major;
00223 }
00224
00225
00226 inline uint8
00227 VersionInfo_t::MinorVersion() const
00228 {
00229 assert(m_initialized);
00230 return m_info.minor;
00231 }
00232
00233
00234 inline uint8
00235 VersionInfo_t::SubminorVersion() const
00236 {
00237 assert(m_initialized);
00238 return m_info.subminor;
00239 }
00240
00241
00242 inline uint8
00243 VersionInfo_t::SubSubminorVersion() const
00244 {
00245 assert(m_initialized);
00246 return m_info.subsubminor;
00247 }
00248
00249
00250 inline bool
00251 VersionInfo_t::IsAlphaVersion() const
00252 {
00253 assert(m_initialized);
00254 return m_info.alpha ? true : false;
00255 }
00256
00257
00258 inline bool
00259 VersionInfo_t::IsBetaVersion() const
00260 {
00261 assert(m_initialized);
00262 return m_info.beta ? true : false;
00263 }
00264
00265
00266 inline bool
00267 VersionInfo_t::IsReleaseCandidate() const
00268 {
00269 assert(m_initialized);
00270 return m_info.rc ? true : false;
00271 }
00272
00273
00274 inline bool
00275 VersionInfo_t::HasBuildNumber() const
00276 {
00277 assert(m_initialized);
00278 return m_info.has_build_number ? true : false;
00279 }
00280
00281
00282 inline uint16
00283 VersionInfo_t::BuildNumber() const
00284 {
00285 assert(m_initialized && m_info.has_build_number);
00286 return m_info.build_number;
00287 }
00288
00289
00290 #endif // _UT_VERSION_INFO_H_