diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-21 00:31:06 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-21 00:31:06 +0100 |
commit | 4ff279b998ce55bc1132e699976c51e7246ff3cc (patch) | |
tree | bd18d32a16f992f9df272680808cf04cb4f3416c /src/core/model | |
parent | 92f61b82ca24b1cdd7c8079d6a251ff8cd107d15 (diff) |
introduced ad-hoc validation method of Types against Variants.
Diffstat (limited to 'src/core/model')
-rw-r--r-- | src/core/model/Typesystem.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/model/Typesystem.hpp b/src/core/model/Typesystem.hpp index 44cf126..f4182fc 100644 --- a/src/core/model/Typesystem.hpp +++ b/src/core/model/Typesystem.hpp @@ -111,12 +111,26 @@ public: * @param data is a variant containing the data that should be checked and * -- if possible and necessary -- converted to a variant adhering to the * internal representation used by the Type class. - * @param logger is the Logger instance into which errors should be written. + * @param logger is the Logger instance into which errors should be + * written. * @return true if the conversion was successful, false otherwise. */ bool build(Variant &data, Logger &logger) const; /** + * Returns true if and only if the given Variant adheres to this Type. In + * essence this just calls the build method on a copy of the input Variant. + * + * @param data is a Variant containing data that shall be validated. + * @param logger is a logger instance to which errors will be written. + * + * @return true if and only if the given Variant adheres to this Type. + */ + bool isValid(Variant data, Logger &logger) const{ + return build(data, logger); + } + + /** * Returns the underlying Typesystem instance. * * @return a Rooted reference pointing at the underlying typesystem |