Skip to content

Commit 28f89c3

Browse files
committed
Add version string and GetVersion function
1 parent c995271 commit 28f89c3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

opengc.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ using GCVector = std::vector<T>;
2222
template <typename K, typename V>
2323
using GCMap = std::unordered_map<K, V>;
2424

25+
/* the current version. why? idk */
26+
constexpr const char* OPENGC_VERSION = "0.0.5";
27+
2528
#ifndef OPENGC_NO_LOGS
2629
#include <iostream>
2730

@@ -114,6 +117,12 @@ class GC final
114117
/* since server region member is private */
115118
Regions GetRegion() const { return mServerRegion; }
116119

120+
/* ..and the version */
121+
inline GCString GetVersion() const
122+
{
123+
return OPENGC_VERSION;
124+
}
125+
117126
private:
118127
GCMap<GCString, ServerInfo> mServers;
119128
Regions mServerRegion;
@@ -147,6 +156,10 @@ bool GC::Initialize(
147156

148157
GCString fullText = "GC initialized for region: " + std::to_string(static_cast<int>(region));
149158
LOG(fullText);
159+
160+
/* ..and the version! */
161+
LOG("OpenGC version: " + GetVersion());
162+
150163
return true;
151164
}; // bool GC::Initialize
152165

0 commit comments

Comments
 (0)