50enum class Bound : std::uint8_t {
57 Bound lower{Bound::Inclusive};
58 Bound upper{Bound::Inclusive};
61 return {Bound::Inclusive, Bound::Inclusive};
64 return {Bound::Exclusive, Bound::Exclusive};
66 [[nodiscard]]
static constexpr RangeInclusion left_open()
noexcept {
67 return {Bound::Exclusive, Bound::Inclusive};
69 [[nodiscard]]
static constexpr RangeInclusion right_open()
noexcept {
70 return {Bound::Inclusive, Bound::Exclusive};
88[[nodiscard]]
constexpr std::string_view
ltrim(std::string_view s)
noexcept {
89 while (!s.empty() && (s.front() ==
' ' || s.front() ==
'\t')) {
95[[nodiscard]]
constexpr std::string_view rtrim(std::string_view s)
noexcept {
96 while (!s.empty() && (s.back() ==
' ' || s.back() ==
'\t')) {
102[[nodiscard]]
constexpr std::string_view trim(
const std::string_view s)
noexcept {
103 return rtrim(
ltrim(s));
Concept for value types stored inside a UnitValue / MeasureValue.
Definition core.hpp:17
constexpr std::string_view ltrim(std::string_view s) noexcept
Return a span between the first matching token and the trailing decimal/sign characters.
Definition core.hpp:88
RangeCompareResult
Result of comparing two values or ranges.
Definition core.hpp:78
ParseErrorCode
Error codes returned by parse_unit_value / parse_measure_value.
Definition core.hpp:20
@ UnitMismatch
Symbol parsed but doesn't match the requested unit tag.
@ UnknownUnit
Symbol/id not present in the registry.
@ InvalidNumber
Numeric portion failed to parse.
@ MeasureMismatch
Measure id doesn't match the requested measure tag.
@ Empty
Input was empty or whitespace-only.
@ TrailingGarbage
Unexpected characters after the value.
Bound
Inclusivity of a single range bound.
Definition core.hpp:50
RangeErrorCode
Error codes for range construction.
Definition core.hpp:38
@ MaxLessThanMin
Upper bound is strictly less than lower bound.
@ EmptyOpenRange
Equal bounds with at least one exclusive side.
Detailed error report from a parse_*_value call.
Definition core.hpp:30
std::string message
Optional human-readable detail.
Definition core.hpp:34
std::string input
Copy of the original input for diagnostics.
Definition core.hpp:32
std::size_t pos
Byte position where parsing failed.
Definition core.hpp:33
Detailed error report from a UnitRangeValue::make / MeasureRangeValue::make call.
Definition core.hpp:44
Inclusivity of both range bounds together.
Definition core.hpp:56