ucm: add integer comparison condition (Syntax 9)

Adds support for integer comparison operations in If.Condition blocks.
Supports operators: ==, !=, <, >, <=, >= for comparing integer values.
Both values are substituted and converted from strings to 64-bit integers.
Hexadecimal (C like) strings are also accepted (like 0x1234).

Example usage:
  If.check_channels {
    Condition {
      Type Integer
      Operation ">"
      Value1 "${var:channels}"
      Value2 "2"
    }
    True { ... }
  }

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2026-02-06 12:57:02 +01:00
parent e02e9dc6cf
commit 2943b1e412
2 changed files with 103 additions and 0 deletions

View file

@ -878,6 +878,32 @@ If.fmic {
}
~~~
#### Integer comparison (Type Integer)
Field | Description
---------------------|-----------------------
Operation | comparison operator (==, !=, <, >, <=, >=)
Value1 | first integer value (string converted to long long)
Value2 | second integer value (string converted to long long)
Note: Integer condition is supported in *Syntax* version *9*+.
Example:
~~~{.html}
If.check_channels {
Condition {
Type Integer
Operation ">"
Value1 "${var:channels}"
Value2 "2"
}
True {
...
}
}
~~~
### Variants
To avoid duplication of the many configuration files for the cases with