Aller au contenu

Enumeration HrzProtocol.AttributeTransform

Defined in hrz/protocol/attributes/transform.proto.

Transformation to apply to attribute values upon loading them.


ATTRIBUTE_TRANSFORM_NONE (0)

No transformation applied.


ATTRIBUTE_TRANSFORM_TO_COLOR (1)

Strings are parsed as colors. For example, “#rrggbb”, “#rgba”, “red”, … Other values are left unchanged.


ATTRIBUTE_TRANSFORM_TO_INT (2)

Strings are parsed as integers, or 0 on failure. Numeric values are implicitly cast to integers.


ATTRIBUTE_TRANSFORM_TO_UINT (3)

Strings are parsed as unsigned integers, or 0 on failure. Numeric values are implicitly cast to unsigned integers.


ATTRIBUTE_TRANSFORM_TO_NUMBER (4)

Strings are parsed as numbers, or NaN on failure. Numeric values are implicitly cast to numbers.


ATTRIBUTE_TRANSFORM_TO_STRING (5)

Numeric attributes are stringified. Null gives an empty string. Booleans give “true” or “false”.


ATTRIBUTE_TRANSFORM_TO_BOOLEAN (6)

All values are transformed to booleans. 0 integers and numbers are false. NaN numbers are false. “true” and “false” (case-insensitive) are true and false respectively. All other strings are parsed as numbers, which returns true if non-zero and non-NaN. Null is false.