Schema component requiring data be a particular type.
More...
#include <parsnip_schema.h>
Schema component requiring data be a particular type.
◆ TypeSchema()
Construct a type schema.
- Parameters
-
require | The required type. |
schema_spec | The schema specification. |
◆ createCopy()
TypeSchema * Parsnip::TypeSchema::createCopy |
( |
| ) |
const |
|
overridevirtual |
Create an identical, deep copy of the schema.
Caller is responsible for deleting it.
Implements Parsnip::SchemaBase.
◆ dump()
std::ostream & Parsnip::TypeSchema::dump |
( |
std::ostream & |
target, |
|
|
int |
indent, |
|
|
bool |
suppress_indent = false |
|
) |
| const |
|
overridevirtual |
Render the schema in human-friendly text.
- Parameters
-
target | Where to write the schema. |
indent | Amount of indent to use. |
suppress_indent | Flag indicating indent was already performed. |
Implements Parsnip::SchemaBase.
◆ mergeSchemas()
void Parsnip::TypeSchema::mergeSchemas |
( |
const SchemaBase & |
from | ) |
|
|
overridevirtual |
Merge elements into the current schema.
Merge elements managed by this class.
- Elements seen every time are mandatory.
- Elements seen only sometime are optional.
- Elements always seen together are codependent.
- Elements must always expect similar types, except they may vary as element and list-of-same-element.
- Parameters
-
from | A schema for a valid command command line. |
- Exceptions
-
Reimplemented from Parsnip::SchemaBase.
◆ operator==()
bool Parsnip::TypeSchema::operator== |
( |
const SchemaBase & |
other | ) |
const |
|
overridevirtual |
Check if two schemas perform the same validation.
Compare two schemas to see if they determine validity in the same manner.
- Parameters
-
other | The schema to compare to. |
- Returns
- True if the schemas match, false otherwise.
Reimplemented from Parsnip::SchemaBase.
◆ validate()
void Parsnip::TypeSchema::validate |
( |
const Parsnip::Data & |
entry | ) |
const |
|
overridevirtual |
Verify that Data matches the schema.
- Parameters
-
entry | The data to validate. |
- Exceptions
-
Implements Parsnip::SchemaBase.
The documentation for this class was generated from the following files: