Skip to main content

CoreValidationSingle

Validates some data against a set of predefined rules.

Variables

Array[Dictionary] rules = []

Don't modify

Do not modify this.

All rules to evaluate in evaluate().

Array[String] failures = []

Don't modify

Do not modify this.

Contains error messages for failed rules.

Functions

bool evaluate()

Evaluates all set rules and returns true if all rules passed, or false if at least one failed.

CoreValidationSingle matches_type(Array types)

Validates if data matches some data type.
Applies to all data types (obviously).

CoreValidationSingle matches_class(StringName class, bool exact)

Validates if data matches some class.
Applies to Object.

CoreValidationSingle in_range_int(int from, int to)

Validates if data contains the specified integer range.
Applies to int.

CoreValidationSingle in_range_float(float from, float to)

Validates if data contains the specified float range.
Applies to float.

CoreValidationSingle has_minimum_int(int minimum)

Ensures that data is equal to or exceeds the specified integer.
Applies to int.

CoreValidationSingle has_maximum_int(int maximum)

Ensures that data is under the specified integer.
Applies to int.

CoreValidationSingle has_minimum_float(float minimum)

Ensures that data is equal to or exceeds the specified float.
Applies to float.

CoreValidationSingle has_maximum_float(float maximum)

Ensures that data is under the specified float.
Applies to float.

CoreValidationSingle has_values(Array values)

Checks whenether at least one value matches data. Applies to all data types.

CoreValidationSingle contains(Array values, int minimum_matches = 1)

Ensures that [param data] contains at least <minimum_matches> (or all if set to -1) values.
Applies to String & StringName.

CoreValidationSingle matches_regex(String regex_string)

Matches a regular expression against data.
Applies to String & StringName.

CoreValidationSingle is_not_empty()

Ensures that data is not empty.
Applies to String & StringName (!= ""), int (!= 0), float (!= 0.0), Array (!= []) and Dictionary (!= {}).

CoreValidationSingle is_not_null()

Ensures that data is not null.

CoreValidationSingle is_normalized()

Ensures that data is normalized.
Applies to Vector2, Vector3, Vector4, Plane and Quaternion.

CoreValidationSingle is_orthonormalized()

Ensures that data is orthonormalized.
Applies to Transform2D, Transform3D and Basis.