Elaztek Developer Hub
Blamite Game Engine - Strings  00326.06.27.21.0407.blamite
A library containing general purpose utilities and classes for use in multiple projects.
version.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #ifdef STRINGS_EXPORTS
6 #define STRINGS_API __declspec(dllexport)
7 #else
8 #define STRINGS_API __declspec(dllimport)
9 #endif
10 
14 #define SEMANTIC_VERSIONING_VER "2.0.0"
15 
19 enum struct BlamVersionType : int
20 {
21  PreAlpha = 0,
22  Alpha = 1,
23  Beta = 2,
24  ReleaseCandidate = 3,
25  Release = 4
26 };
27 
46 {
47 private:
48  int version_major = 0;
49  int version_minor = 0;
50  int version_patch = 0;
51 
53  int version_prerelease = 0;
54 
55  bool is_valid = false;
56 
57 public:
65  BlamVersion(int major, int minor, int patch);
66 
76  BlamVersion(int major, int minor, int patch, BlamVersionType version_type, int pre_ver);
77 
83  std::string ToString();
84 
90  bool IsValid();
91 
97  int GetMajor();
98 
104  int GetMinor();
105 
111  int GetPatch();
112 
118  std::string GetSuffix();
119 
125  BlamVersionType GetType();
126 
132  int GetPrereleaseVersion();
133 
141  bool operator==(BlamVersion other_version);
142 
150  bool operator>(BlamVersion other_version);
151 
159  bool operator<(BlamVersion other_version);
160 
168  bool IsEqualTo(BlamVersion other_version);
169 
177  bool IsGreaterThan(BlamVersion other_version);
178 
186  bool IsLessThan(BlamVersion other_version);
187 };
188 
193 {
203  STRINGS_API bool VerifyVersion(BlamVersion* version);
204 
212  STRINGS_API std::string GetVersionTypeLabel(BlamVersionType version_type);
213 }
BlamVersionType::PreAlpha
@ PreAlpha
A version that is in pre-alpha stages. Anything can change at any time.
BlamVersionType::ReleaseCandidate
@ ReleaseCandidate
A version that is ready for public release assuming no major bugs are discovered during final testing...
BlamVersionType::Release
@ Release
A version that has passed all final testing and is to be released to the public.
BlamStrings::Resources::VersionInfo::VerifyVersion
STRINGS_API bool VerifyVersion(BlamVersion *version)
Verifies the validity of a product version by ensuring it matches Semantic Versioning guidelines.
Definition: version.cpp:5
BlamStrings::Resources::VersionInfo::GetVersionTypeLabel
STRINGS_API std::string GetVersionTypeLabel(BlamVersionType version_type)
Generates a label from a given version type.
Definition: version.cpp:12
BlamVersionType::Beta
@ Beta
A version that is (mostly) feature-complete, but may still contain bugs.
BlamVersionType
BlamVersionType
Enumerator used to determine the possible types of versions.
Definition: version.h:19
BlamVersionType::Alpha
@ Alpha
A version used for early testing. Not feature complete or fully tested.
BlamVersion
Class representing a product version.
Definition: version.h:45
STRINGS_API
#define STRINGS_API
Definition: version.h:8
BlamStrings::Resources::VersionInfo
Namespace containing functions related to product versions.
Definition: version.h:192