Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
host_version.hpp
Go to the documentation of this file.
1#pragma once
2
10
12
13#include <optional>
14#include <string_view>
15
16namespace pulp::format {
17
24 int major = 0;
25 int minor = 0;
26 int patch = 0;
27
28 constexpr HostVersion() = default;
29 constexpr HostVersion(int maj, int min = 0, int pat = 0)
30 : major(maj), minor(min), patch(pat) {}
31
33 constexpr bool is_at_least(int maj, int min = 0, int pat = 0) const {
34 if (major != maj) return major > maj;
35 if (minor != min) return minor > min;
36 return patch >= pat;
37 }
38
40 constexpr bool is_before(int maj, int min = 0, int pat = 0) const {
41 return !is_at_least(maj, min, pat);
42 }
43
45 constexpr bool is_unknown() const {
46 return major == 0 && minor == 0 && patch == 0;
47 }
48};
49
53std::optional<HostVersion> parse_host_version(std::string_view version_string);
54
63
68bool host_type_uses_version(HostType type) noexcept;
69
76
78
79} // namespace pulp::format
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition aax_editor.hpp:31
HostInfo detect_host_info()
bool host_type_uses_version(HostType type) noexcept
Whether any host quirk for type is version-gated.
std::optional< HostVersion > parse_host_version(std::string_view version_string)
Best-effort parse of a version string like "10.0.50", "12.0", or "Pro Tools 2024.6".
HostVersion detect_host_version(HostType type)
Detect the running host's major/minor version, best-effort.
HostType
Definition host_type.hpp:11
@ Unknown
Definition host_type.hpp:12
Combined accessor: detect both type and version in one call.
Definition host_version.hpp:72
HostType type
Definition host_version.hpp:73
HostVersion version
Definition host_version.hpp:74
Semver-ish host version.
Definition host_version.hpp:23
int patch
Definition host_version.hpp:26
constexpr bool is_unknown() const
Returns true if all components are zero (unknown / undetected).
Definition host_version.hpp:45
constexpr HostVersion()=default
constexpr bool is_at_least(int maj, int min=0, int pat=0) const
True when this version is >= the comparison target.
Definition host_version.hpp:33
constexpr HostVersion(int maj, int min=0, int pat=0)
Definition host_version.hpp:29
constexpr bool is_before(int maj, int min=0, int pat=0) const
True when this version is strictly less than the comparison target.
Definition host_version.hpp:40
int major
Definition host_version.hpp:24
int minor
Definition host_version.hpp:25