VCV Rack API v2
|
Structured version string, for comparison. More...
#include <string.hpp>
Public Member Functions | |
Version () | |
Version (const std::string &s) | |
Version (const char *s) | |
operator std::string () const | |
bool | operator< (const Version &other) |
Returns whether this version is earlier than other . | |
std::string | getMajor () const |
std::string | getMinor () const |
std::string | getRevision () const |
Public Attributes | |
std::vector< std::string > | parts |
Structured version string, for comparison.
Strings are split into parts by "." and compared lexicographically. Parts are compared as the following.
If both parts can be parsed as integers (such as "10" and "2"), their integer value is compared (so "10" is greater). If one part cannot be parsed as an integer (such as "2" and "beta"), the integer part is greater ("2"). If neither part can be parsed as an integer (such as "alpha" and "beta"), the parts are compared as strings in typical lexicographical order.
For example, the following versions are sorted earliest to latest.
1.a.0 1.b.0 1.0.0 1.0.1 1.2.0 1.10.0 2.0.0
|
inline |
rack::string::Version::Version | ( | const std::string & | s | ) |
|
inline |
rack::string::Version::operator std::string | ( | ) | const |
bool rack::string::Version::operator< | ( | const Version & | other | ) |
Returns whether this version is earlier than other
.
|
inline |
|
inline |
|
inline |
std::vector<std::string> rack::string::Version::parts |