libnick 2025.9.1
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
version.h
Go to the documentation of this file.
1
22
23#ifndef VERSION_H
24#define VERSION_H
25
26#include <iostream>
27#include <string>
28#include "versiontype.h"
29
30namespace Nickvision::Update
31{
36 class Version
37 {
38 public:
42 Version() noexcept;
49 Version(int major, int minor, int build) noexcept;
58 Version(int major, int minor, int build, const std::string& dev);
64 Version(const std::string& version);
69 int getMajor() const noexcept;
74 int getMinor() const noexcept;
79 int getBuild() const noexcept;
84 const std::string& getDev() const noexcept;
89 VersionType getVersionType() const noexcept;
94 const std::string& str() const noexcept;
99 bool empty() const noexcept;
105 bool operator<(const Version& compare) const noexcept;
111 bool operator<=(const Version& compare) const noexcept;
117 bool operator>(const Version& compare) const noexcept;
123 bool operator>=(const Version& compare) const noexcept;
129 bool operator==(const Version& compare) const noexcept;
135 bool operator!=(const Version& compare) const noexcept;
136
137 private:
138 int m_major;
139 int m_minor;
140 int m_build;
141 std::string m_dev;
142 std::string m_str;
143 };
144}
145
146#endif // VERSION_H
Version() noexcept
Constructs a Version.
int getMinor() const noexcept
Gets the minor number of the version.
const std::string & str() const noexcept
Gets a string representation of the Version.
const std::string & getDev() const noexcept
Gets the dev string of the version.
int getBuild() const noexcept
Gets the build number of the version.
int getMajor() const noexcept
Gets the major number of the version.
VersionType getVersionType() const noexcept
Gets the type of the version.
bool empty() const noexcept
Gets whether or not the Version object is empty.
Definition updater.h:33
VersionType
Types of a version.
Definition versiontype.h:32