Allow Documentations to be exhaustive to not allow extra dictionaries

This commit is contained in:
Alexander Bock
2016-09-16 16:53:50 +02:00
parent 24e5146a8e
commit 2fa6471e98
5 changed files with 103 additions and 7 deletions

View File

@@ -39,6 +39,7 @@ namespace documentation {
struct Verifier;
using Optional = ghoul::Boolean;
using Exhaustive = ghoul::Boolean;
struct TestResult {
bool success;
@@ -64,11 +65,13 @@ struct DocumentationEntry {
using DocumentationEntries = std::vector<documentation::DocumentationEntry>;
struct Documentation {
Documentation(std::string name = "", DocumentationEntries entries = {});
Documentation(std::string name = "", DocumentationEntries entries = {},
Exhaustive exhaustive = Exhaustive::No);
Documentation(DocumentationEntries entries);
std::string name;
DocumentationEntries entries;
Exhaustive exhaustive;
};

View File

@@ -71,13 +71,14 @@ struct StringVerifier : public TemplateVerifier<std::string> {
};
struct TableVerifier : public TemplateVerifier<ghoul::Dictionary> {
TableVerifier(std::vector<DocumentationEntry> d = {});
TableVerifier(std::vector<DocumentationEntry> d = {}, Exhaustive exhaustive = Exhaustive::No);
TestResult operator()(const ghoul::Dictionary& dict, const std::string& key) const override;
std::string type() const override;
std::vector<DocumentationEntry> doc;
Exhaustive exhaustive;
};
struct VectorVerifier {};