mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
0227c03366
logs::listener resurrected rpcs3 version: constexpr
73 lines
977 B
C++
73 lines
977 B
C++
#pragma once
|
|
|
|
#include "types.h"
|
|
#include <string>
|
|
|
|
namespace utils
|
|
{
|
|
enum class version_type : uint
|
|
{
|
|
pre_alpha,
|
|
alpha,
|
|
beta,
|
|
release_candidate,
|
|
release
|
|
};
|
|
|
|
std::string to_string(version_type type);
|
|
|
|
class version
|
|
{
|
|
uint m_hi;
|
|
uint m_mid;
|
|
uint m_lo;
|
|
version_type m_type = version_type::release;
|
|
uint m_type_index = 1;
|
|
const char* m_postfix;
|
|
|
|
public:
|
|
constexpr version(uint hi, uint mid, uint lo, version_type type, uint type_index, const char* postfix)
|
|
: m_hi(hi)
|
|
, m_mid(mid)
|
|
, m_lo(lo)
|
|
, m_type(type)
|
|
, m_type_index(type_index)
|
|
, m_postfix(postfix)
|
|
{
|
|
}
|
|
|
|
uint hi() const
|
|
{
|
|
return m_hi;
|
|
}
|
|
|
|
uint mid() const
|
|
{
|
|
return m_mid;
|
|
}
|
|
|
|
uint lo() const
|
|
{
|
|
return m_lo;
|
|
}
|
|
|
|
version_type type() const
|
|
{
|
|
return m_type;
|
|
}
|
|
|
|
std::string postfix() const
|
|
{
|
|
return m_postfix;
|
|
}
|
|
|
|
uint type_index() const
|
|
{
|
|
return m_type_index;
|
|
}
|
|
|
|
uint to_hex() const;
|
|
std::string to_string() const;
|
|
};
|
|
}
|