HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SYS_Version.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SYS_Version.h ( UT Library, C/C++)
7  */
8 
9 /*
10  * NOTE: This is automatically generated from SYS_Version.tmpl.h
11  */
12 #ifndef __SYS_Version__
13 #define __SYS_Version__
14 
15 /// @file SYS_Version.h
16 /// Defines compile time version constants for use in code.
17 /// @note Please see UT_String::compareVersionString()
18 
19 // The major.minor.build version as a string
20 #define SYS_VERSION_FULL "16.5.539"
21 
22 // The major.minor version as a string
23 #define SYS_VERSION_RELEASE "16.5"
24 
25 // The major version. .9 counts as next higher.
26 #define SYS_VERSION_MAJOR "16"
27 #define SYS_VERSION_MINOR "5"
28 #define SYS_VERSION_BUILD "539"
29 #define SYS_VERSION_PATCH "0"
30 
31 // Version numbers as integer values
32 #define SYS_VERSION_MAJOR_INT 16
33 #define SYS_VERSION_MINOR_INT 5
34 #define SYS_VERSION_BUILD_INT 539
35 #define SYS_VERSION_PATCH_INT 0
36 
37 // Version as a packed integer: ("%02x%02x%04x", major, minor, build)
38 #define SYS_VERSION_FULL_INT 0x1005021b
39 
40 #if defined(__cplusplus)
41 struct SYS_Version
42 {
43  /// Return the "major.minor.build" version
44  static inline const char *full() { return SYS_VERSION_FULL; }
45 
46  /// Return the "major.minor" version
47  static inline const char *release() { return SYS_VERSION_RELEASE; }
48 
49  /// Return the "major" version
50  static inline const char *major() { return SYS_VERSION_MAJOR; }
51 
52  /// Return the "minor" version
53  static inline const char *minor() { return SYS_VERSION_MINOR; }
54 
55  /// Return the "build" version
56  static inline const char *build() { return SYS_VERSION_BUILD; }
57 
58  /// Return the "patch" version
59  static inline const char *patch() { return SYS_VERSION_PATCH; }
60 
61  /// Return the full version as a numerical set of values.
62  static inline void getFull(int &major, int &minor, int &build,
63  int *patch = 0)
64  {
65  major = SYS_VERSION_MAJOR_INT;
66  minor = SYS_VERSION_MINOR_INT;
67  build = SYS_VERSION_BUILD_INT;
68  if (patch)
69  *patch = SYS_VERSION_PATCH_INT;
70  }
71 
72  /// Return the release version as a numerical set of values.
73  static inline void getRelease(int &major, int &minor)
74  {
75  major = SYS_VERSION_MAJOR_INT;
76  minor = SYS_VERSION_MINOR_INT;
77  }
78 
79  static inline int compare(int major1, int minor1, int build1,
80  int major2, int minor2, int build2)
81  {
82  if(major1 != major2) return major1 - major2;
83  if(minor1 != minor2) return minor1 - minor2;
84  if(build1 != build2) return build1 - build2;
85  return 0;
86  }
87 
88  static inline int compare(int major1, int minor1, int build1, int patch1,
89  int major2, int minor2, int build2, int patch2)
90  {
91  if(major1 != major2) return major1 - major2;
92  if(minor1 != minor2) return minor1 - minor2;
93  if(build1 != build2) return build1 - build2;
94  if(patch1 != patch2) return patch1 - patch2;
95  return 0;
96  }
97 };
98 #endif
99 
100 #endif
101 
#define SYS_VERSION_MINOR_INT
Definition: SYS_Version.h:33
#define SYS_VERSION_BUILD
Definition: SYS_Version.h:28
#define SYS_VERSION_MAJOR_INT
Definition: SYS_Version.h:32
#define SYS_VERSION_RELEASE
Definition: SYS_Version.h:23
#define SYS_VERSION_BUILD_INT
Definition: SYS_Version.h:34
#define SYS_VERSION_MINOR
Definition: SYS_Version.h:27
#define SYS_VERSION_FULL
Definition: SYS_Version.h:20
#define SYS_VERSION_PATCH
Definition: SYS_Version.h:29
#define SYS_VERSION_MAJOR
Definition: SYS_Version.h:26
#define SYS_VERSION_PATCH_INT
Definition: SYS_Version.h:35