Unravel Engine C++ Reference
Loading...
Searching...
No Matches
version::engine_version Struct Reference

#include <version.h>

Public Member Functions

auto to_string () const -> std::string
 

Public Attributes

int major = 0
 
int minor = 0
 
int patch = 0
 
int commit_count = 0
 Commits since the tagged release (e.g. the 66 in 1.0.0-66-g...).
 
std::string sha
 Git SHA suffix (including any leading 'g'), or empty if absent.
 
std::string original
 

Friends

auto operator== (const engine_version &a, const engine_version &b) -> bool
 
auto operator<=> (const engine_version &a, const engine_version &b) -> std::strong_ordering
 

Detailed Description

Structured representation of the engine version string scheme used across the project: "major.minor.patch[-commit_count[-sha]]" (e.g. "1.0.0-66-gc83fa23"). Parsing tolerates an optional leading "v"/"V".

Equality and ordering compare only (major, minor, patch, commit_count). The SHA is metadata and is intentionally not part of the ordering.

Definition at line 17 of file version.h.

Member Function Documentation

◆ to_string()

auto version::engine_version::to_string ( ) const -> std::string

Returns the canonical "M.m.p[-commit[-sha]]" string. This is what should be written to disk, and roundtrips through parse.

Definition at line 82 of file version.cpp.

Friends And Related Symbol Documentation

◆ operator<=>

auto operator<=> ( const engine_version & a,
const engine_version & b ) -> std::strong_ordering
friend

Definition at line 112 of file version.cpp.

◆ operator==

auto operator== ( const engine_version & a,
const engine_version & b ) -> bool
friend

Definition at line 107 of file version.cpp.

Member Data Documentation

◆ commit_count

int version::engine_version::commit_count = 0

Commits since the tagged release (e.g. the 66 in 1.0.0-66-g...).

Definition at line 23 of file version.h.

◆ major

int version::engine_version::major = 0

Definition at line 19 of file version.h.

◆ minor

int version::engine_version::minor = 0

Definition at line 20 of file version.h.

◆ original

std::string version::engine_version::original

The original string this was parsed from. For logging/UI only; never used for comparisons.

Definition at line 28 of file version.h.

◆ patch

int version::engine_version::patch = 0

Definition at line 21 of file version.h.

◆ sha

std::string version::engine_version::sha

Git SHA suffix (including any leading 'g'), or empty if absent.

Definition at line 25 of file version.h.


The documentation for this struct was generated from the following files: