|
pianod2
multisource multiuser scriptable networked music player
|
A meta-schema that determines if any, all, or exactly one or none of its subschemas are valid. More...
#include <parsnip_schema.h>


Public Types | |
| enum class | Action { All , Any , ExactlyOne , Not } |
Public Member Functions | |
| ConjunctionSchema (const ConjunctionSchema &)=default | |
| ConjunctionSchema (ConjunctionSchema &&)=default | |
| ConjunctionSchema & | operator= (const ConjunctionSchema &)=default |
| ConjunctionSchema & | operator= (ConjunctionSchema &&)=default |
| ConjunctionSchema (const Parsnip::Data &schema_spec) | |
| virtual ConjunctionSchema * | createCopy () const override |
| Create an identical, deep copy of the schema. More... | |
| virtual void | validate (const Parsnip::Data &entry) const override |
| Verify that Data matches the schema. More... | |
| virtual bool | operator== (const SchemaBase &other) const override |
| Check if two schemas perform the same validation. More... | |
| virtual std::ostream & | dump (std::ostream &target, int indent, bool suppress_ident=false) const override |
| Render the schema in human-friendly text. More... | |
Public Member Functions inherited from Parsnip::SchemaBase | |
| virtual | ~SchemaBase ()=default |
| bool | operator!= (const SchemaBase &other) const |
| virtual void | mergeSchemas (const SchemaBase &from) |
| Merge elements into the current schema. More... | |
Static Public Member Functions | |
| static bool | is_conjunction (const Parsnip::Data &schema_spec) |
| Checks a schema specification for a conjunction. More... | |
Private Types | |
| using | ChildrenList = std::vector< SchemaBaseRef > |
Private Member Functions | |
| Parsnip::Data | merge_dictionaries (const Parsnip::Data &baseline, const Parsnip::Data &overrides) |
Static Private Member Functions | |
| static std::string | get_action_name (const Parsnip::Data &schema_spec) |
| Retrieve the conjunction action name from a dictionary. More... | |
Private Attributes | |
| std::string | action_name |
| Action | action = Action::Any |
| ChildrenList | children |
Static Private Attributes | |
| static const std::unordered_map< std::string, Action > | key_names |
| Name-to-enumeration mappings for the various conjunctions. More... | |
Additional Inherited Members | |
Protected Types inherited from Parsnip::SchemaBase | |
| using | StringType = Data::StringType |
| using | SchemaRegex = std::basic_regex< StringType::value_type > |
Protected Member Functions inherited from Parsnip::SchemaBase | |
| SchemaBase ()=default | |
| SchemaBase (const SchemaBase &)=default | |
| SchemaBase (SchemaBase &&)=default | |
| SchemaBase & | operator= (const SchemaBase &)=default |
| SchemaBase & | operator= (SchemaBase &&)=default |
| SchemaBase (const Parsnip::Data &schema_spec) | |
| Construct a schema from a JSON specification. More... | |
| void | checkType (Data::Type expected, const Parsnip::Data &entry) const |
| Check that Data item is an allowed type. More... | |
| bool | isValidlyNull (const Parsnip::Data &entry) const |
| Determine if the data is Null and if that is allowed. More... | |
| bool | isType (Data::Type expected, const Parsnip::Data &entry) const |
| Check if a data object is a particular type. More... | |
Protected Attributes inherited from Parsnip::SchemaBase | |
| bool | nullable = false |
If true, element may be null. More... | |
A meta-schema that determines if any, all, or exactly one or none of its subschemas are valid.
Also provides "not".
|
private |
|
strong |
|
default |

|
default |
| Parsnip::ConjunctionSchema::ConjunctionSchema | ( | const Parsnip::Data & | schema_spec | ) |

|
overridevirtual |
Create an identical, deep copy of the schema.
Caller is responsible for deleting it.
Implements Parsnip::SchemaBase.

|
overridevirtual |
Render the schema in human-friendly text.
| target | Where to write the schema. |
| indent | Amount of indent to use. |
| suppress_indent | Flag indicating indent was already performed. |
Implements Parsnip::SchemaBase.

|
staticprivate |
Retrieve the conjunction action name from a dictionary.
| schema_spec | The schema specification. |
| SchemaConflict | if the schema specifies multiple conjoining actions. |

|
static |
Checks a schema specification for a conjunction.


|
private |


|
default |
|
default |
|
overridevirtual |
Check if two schemas perform the same validation.
Compare two schemas to see if they determine validity in the same manner.
| other | The schema to compare to. |
Reimplemented from Parsnip::SchemaBase.

|
overridevirtual |
Verify that Data matches the schema.
| entry | The data to validate. |
| Various | exceptions. |
Implements Parsnip::SchemaBase.
|
private |
|
private |
|
private |
|
staticprivate |
Name-to-enumeration mappings for the various conjunctions.