Expose type validator from Dictionary and allow testing without error

- Now you can get the ContainerTypeValidate from a Dictionary (both for
  keys and for values).
- ContainerTypeValidate exposes a validator function that does not show
  any error in case of failure. This allows testing values before trying
  to use them in Dictionary.
This commit is contained in:
George Marques
2025-07-01 15:04:31 -03:00
parent e0603aeda3
commit 28d3214acd
3 changed files with 121 additions and 69 deletions

View File

@@ -40,6 +40,7 @@
class Variant;
struct ContainerType;
struct ContainerTypeValidate;
struct DictionaryPrivate;
struct StringLikeVariantComparator;
struct VariantHasher;
@@ -121,6 +122,8 @@ public:
StringName get_typed_value_class_name() const;
Variant get_typed_key_script() const;
Variant get_typed_value_script() const;
const ContainerTypeValidate &get_key_validator() const;
const ContainerTypeValidate &get_value_validator() const;
void make_read_only();
bool is_read_only() const;