libnick 2024.12.0
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
version.h
Go to the documentation of this file.
1
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:
49 Version(int major, int minor, int build);
58 Version(int major, int minor, int build, const std::string& dev);
64 Version(const std::string& version);
69 int getMajor() const;
74 int getMinor() const;
79 int getBuild() const;
84 const std::string& getDev() const;
94 const std::string& str() const;
99 bool empty() const;
105 bool operator<(const Version& compare) const;
111 bool operator<=(const Version& compare) const;
117 bool operator>(const Version& compare) const;
123 bool operator>=(const Version& compare) const;
129 bool operator==(const Version& compare) const;
135 bool operator!=(const Version& compare) const;
139 friend std::ostream& operator<<(std::ostream& os, const Version& version);
140
141 private:
142 int m_major;
143 int m_minor;
144 int m_build;
145 std::string m_dev;
146 std::string m_str;
147 };
148}
149
150#endif // VERSION_H
A model for a version number.
Definition version.h:37
Version(const std::string &version)
Constructs a Version.
bool operator<=(const Version &compare) const
Compares Version objects via <= operator.
Version()
Constructs a Version.
const std::string & str() const
Gets a string representation of the Version.
bool empty() const
Gets whether or not the Version object is empty.
int getBuild() const
Gets the build number of the version.
VersionType getVersionType() const
Gets the type of the version.
Version(int major, int minor, int build)
Constructs a Version.
Version(int major, int minor, int build, const std::string &dev)
Constructs a Version.
int getMajor() const
Gets the major number of the version.
int getMinor() const
Gets the minor number of the version.
bool operator==(const Version &compare) const
Compares Version objects via == operator.
bool operator>=(const Version &compare) const
Compares Version objects via >= operator.
const std::string & getDev() const
Gets the dev string of the version.
friend std::ostream & operator<<(std::ostream &os, const Version &version)
Outputs the Version object.
bool operator>(const Version &compare) const
Compares Version objects via > operator.
bool operator!=(const Version &compare) const
Compares Version objects via != operator.
bool operator<(const Version &compare) const
Compares Version objects via < operator.
Definition updater.h:31
VersionType
Types of a version.
Definition versiontype.h:32