Elaztek Developer Hub
Blamite Game Engine - Strings  00386.06.16.23.0646.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 }
BlamVersion::IsEqualTo
bool IsEqualTo(BlamVersion other_version)
Checks if this version is equal to another version.
Definition: BlamProductVersion.cpp:114
logger.h
BlamStrings::GetVersion
STRINGS_API BlamVersion GetVersion()
Retrieves the current version of Strings.
Definition: version.cpp:8
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...
uuids::operator<
bool operator<(uuid const &lhs, uuid const &rhs) noexcept
Definition: uuid.h:573
string.h
BlamVersionType::Release
@ Release
A version that has passed all final testing and is to be released to the public.
version.h
BlamVersion::GetType
BlamVersionType GetType()
Retrieves the version type.
Definition: BlamProductVersion.cpp:89
BlamVersion::BlamVersion
BlamVersion(int major, int minor, int patch)
Constructs a new product version.
Definition: BlamProductVersion.cpp:6
BlamStrings::Logger::LogEvent
STRINGS_API void LogEvent(BlamBasicLogMessage message)
Logs an event to the logger.
Definition: logger.cpp:27
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
BlamVersion::operator==
bool operator==(BlamVersion other_version)
Checks if this version is equal to another version.
Definition: BlamProductVersion.cpp:109
BlamVersion::GetMinor
int GetMinor()
Retrieves the version minor number.
Definition: BlamProductVersion.cpp:66
BlamVersionType::Beta
@ Beta
A version that is (mostly) feature-complete, but may still contain bugs.
BlamVersion::IsValid
bool IsValid()
Whether or not this version matches Semantic Versioning guidelines.
Definition: BlamProductVersion.cpp:56
BlamVersion::ToString
std::string ToString()
Converts the version to a string.
Definition: BlamProductVersion.cpp:38
BlamVersionType
BlamVersionType
Enumerator used to determine the possible types of versions.
Definition: version.h:19
strings_version
BlamVersion strings_version
Version information for the Strings library.
Definition: version.cpp:6
BlamVersionType::Alpha
@ Alpha
A version used for early testing. Not feature complete or fully tested.
BlamVersion::GetSuffix
std::string GetSuffix()
Retrieves the version pre-release suffix.
Definition: BlamProductVersion.cpp:76
BlamVersion
Class representing a product version.
Definition: version.h:45
version.h
BlamVersion::IsLessThan
bool IsLessThan(BlamVersion other_version)
Checks if this version is less than another version.
Definition: BlamProductVersion.cpp:194
BlamVersion::GetMajor
int GetMajor()
Retrieves the version major number.
Definition: BlamProductVersion.cpp:61
uuids::to_string
std::basic_string< CharT, Traits, Allocator > to_string(uuid const &id)
Definition: uuid.h:581
STRINGS_API
#define STRINGS_API
Definition: version.h:8
BlamVersion::operator<
bool operator<(BlamVersion other_version)
Checks if this version is less than another version.
Definition: BlamProductVersion.cpp:99
uuids::operator==
bool operator==(uuid const &lhs, uuid const &rhs) noexcept
Definition: uuid.h:563
BlamVersion::GetPatch
int GetPatch()
Retrieves the version patch number.
Definition: BlamProductVersion.cpp:71
BlamVersion::operator>
bool operator>(BlamVersion other_version)
Checks if this version is greater than another version.
Definition: BlamProductVersion.cpp:104
BlamLogLevel::Warning
@ Warning
Indicates a warning message. Not something critical, but something that could cause unexpected behavi...
BlamVersion::IsGreaterThan
bool IsGreaterThan(BlamVersion other_version)
Checks if this version is greater than another version.
Definition: BlamProductVersion.cpp:144
BlamStrings::Resources::VersionInfo
Namespace containing functions related to product versions.
Definition: version.h:192
BlamVersion::GetPrereleaseVersion
int GetPrereleaseVersion()
Retrieves the pre-release version number.
Definition: BlamProductVersion.cpp:94