-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathversions.hpp
67 lines (60 loc) · 1.62 KB
/
versions.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <iostream>
#include <dpp/fmt/format.h>
/**
* @brief Sir Obsidian's new namespace! :O
*
*/
namespace OB {
class Version
{
private:
int v1, v2, v3;
std::string subv = "";
std::string commit;
std::string versionname;
public:
/**
* @brief Setting version for class.
* @param x Set x.0.0
* @param y Set 0.y.0
* @param z Set 0.0.z
* @param sub Set 0.0.0subv
*/
void setVersion(int x, int y, int z, std::string sub) {
Version::v1 = x;
Version::v2 = y;
Version::v3 = z;
Version::subv = sub;
}
/**
* @brief Setting Github Commit.
* @param commit Commit to set.
*/
void setCommit(std::string commit) {
Version::commit = commit;
}
/**
* @brief Setting version for class.
* @param name Version name.
*/
void setName(std::string name) {
Version::versionname = name;
}
/**
* @brief Generate text from Version.
*
*/
std::string getText() {
std::string x = fmt::format("Version: `{}.{}.{}{} - {}`\nCommit: `{}`\n", Version::v1, Version::v2, Version::v3, Version::subv, Version::versionname, Version::commit);
return x;
}
};
Version getV () {
Version v;
v.setVersion(1, 0, 2, "a-pre");
v.setName("The Major Update Pre-release");
v.setCommit("Unknown"); // This is updated AFTER pushed into Github.
return v;
}
}