Add new verifier to handle identifiers and update codegen to be able to use them (closes #2522)

This commit is contained in:
Alexander Bock
2023-03-11 13:18:12 +01:00
parent 21cb90b7f8
commit 23ee2ee5da
15 changed files with 132 additions and 21 deletions

View File

@@ -168,6 +168,21 @@ private:
bool _mustBeNotEmpty = false;
};
/**
* A Verifier that checks whether a given string is a valid identifier, meaning that is
* does not contain any whitespaces or dots
*/
struct IdentifierVerifier : public StringVerifier {
IdentifierVerifier();
TestResult operator()(const ghoul::Dictionary& dict,
const std::string& key) const override;
std::string documentation() const override;
std::string type() const override;
};
/**
* A Verifier that checks whether a given key inside a ghoul::Dictionary is a string and
* refers to an existing file on disk.