#include <parsnip_schema.h>
◆ SchemaRegex
◆ StringType
◆ SchemaBase() [1/4]
| Parsnip::SchemaBase::SchemaBase |
( |
| ) |
|
|
protecteddefault |
◆ SchemaBase() [2/4]
| Parsnip::SchemaBase::SchemaBase |
( |
const SchemaBase & |
| ) |
|
|
protecteddefault |
◆ SchemaBase() [3/4]
◆ SchemaBase() [4/4]
| Parsnip::SchemaBase::SchemaBase |
( |
const Parsnip::Data & |
schema_spec | ) |
|
|
protected |
Construct a schema from a JSON specification.
- Parameters
-
| schema_spec | The schema specification. |
◆ ~SchemaBase()
| virtual Parsnip::SchemaBase::~SchemaBase |
( |
| ) |
|
|
virtualdefault |
◆ checkType()
Check that Data item is an allowed type.
If nullable, it must be the expected type or null. If not nullable it must be the expected type.
- Parameters
-
| expected | The expected datatype. |
| entry | The Data item to check. |
◆ createCopy()
| virtual SchemaBase* Parsnip::SchemaBase::createCopy |
( |
| ) |
const |
|
pure virtual |
Create an identical, deep copy of the schema.
Caller is responsible for deleting it.
Implemented in Parsnip::ConjunctionSchema, Parsnip::DictionarySchema, Parsnip::ListSchema, Parsnip::OptionSchema, Parsnip::IntegerSchema, Parsnip::RangeSchema< NumericType >, Parsnip::RangeSchema< long >, Parsnip::KeywordSchema, Parsnip::RegExSchema, Parsnip::StringSchema, Parsnip::TypeSchema, and Parsnip::UncheckedSchema.
◆ dump()
| virtual std::ostream& Parsnip::SchemaBase::dump |
( |
std::ostream & |
target, |
|
|
int |
indent, |
|
|
bool |
suppress_indent = false |
|
) |
| const |
|
pure virtual |
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. |
Implemented in Parsnip::ConjunctionSchema, Parsnip::DictionarySchema, Parsnip::ListSchema, Parsnip::OptionSchema, Parsnip::RangeSchema< NumericType >, Parsnip::RangeSchema< long >, Parsnip::KeywordSchema, Parsnip::RegExSchema, Parsnip::StringSchema, Parsnip::TypeSchema, and Parsnip::UncheckedSchema.
◆ isType()
Check if a data object is a particular type.
- Parameters
-
| expected | The type to compare to. |
| entry | The data item to check. |
- Returns
- True if entry's datatype is expected, false otherwise.
◆ isValidlyNull()
| bool Parsnip::SchemaBase::isValidlyNull |
( |
const Parsnip::Data & |
entry | ) |
const |
|
inlineprotected |
Determine if the data is Null and if that is allowed.
- Parameters
-
| entry | The data to validate. |
- Returns
- True if the data is null, and the schema allows it.
◆ mergeSchemas()
| void Parsnip::SchemaBase::mergeSchemas |
( |
const SchemaBase & |
from | ) |
|
|
virtual |
◆ operator!=()
| bool Parsnip::SchemaBase::operator!= |
( |
const SchemaBase & |
other | ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
| bool Parsnip::SchemaBase::operator== |
( |
const SchemaBase & |
other | ) |
const |
|
virtual |
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 in Parsnip::ConjunctionSchema, Parsnip::DictionarySchema, Parsnip::ListSchema, Parsnip::OptionSchema, Parsnip::IntegerSchema, Parsnip::RangeSchema< NumericType >, Parsnip::RangeSchema< long >, Parsnip::KeywordSchema, Parsnip::RegExSchema, Parsnip::StringSchema, and Parsnip::TypeSchema.
◆ validate()
| virtual void Parsnip::SchemaBase::validate |
( |
const Parsnip::Data & |
entry | ) |
const |
|
pure virtual |
Verify that Data matches the schema.
- Parameters
-
| entry | The data to validate. |
- Exceptions
-
Implemented in Parsnip::ConjunctionSchema, Parsnip::DictionarySchema, Parsnip::ListSchema, Parsnip::OptionSchema, Parsnip::IntegerSchema, Parsnip::RangeSchema< NumericType >, Parsnip::RangeSchema< long >, Parsnip::KeywordSchema, Parsnip::RegExSchema, Parsnip::StringSchema, Parsnip::TypeSchema, and Parsnip::UncheckedSchema.
◆ ListSchema
◆ nullable
| bool Parsnip::SchemaBase::nullable = false |
|
protected |
If true, element may be null.
The documentation for this class was generated from the following files: