Parsnip
parsing library
Loading...
Searching...
No Matches
Public Member Functions
Parsnip::UncheckedSchema Class Reference

Schema component requiring data be a particular type. More...

#include <parsnip_schema.h>

Inheritance diagram for Parsnip::UncheckedSchema:
Parsnip::SchemaBase

Public Member Functions

 UncheckedSchema (const UncheckedSchema &)=default
 
 UncheckedSchema (UncheckedSchema &&)=default
 
UncheckedSchemaoperator= (const UncheckedSchema &)=default
 
UncheckedSchemaoperator= (UncheckedSchema &&)=default
 
virtual UncheckedSchemacreateCopy () const override
 Create an identical, deep copy of the schema.
 
virtual void validate (const Parsnip::Data &) const override
 Construct a schema element that does no checking.
 
virtual std::ostream & dump (std::ostream &target, int indent, bool suppress_ident=false) const override
 Render the schema in human-friendly text.
 
- Public Member Functions inherited from Parsnip::SchemaBase
virtual bool operator== (const SchemaBase &other) const
 Check if two schemas perform the same validation.
 
bool operator!= (const SchemaBase &other) const
 
virtual void mergeSchemas (const SchemaBase &from)
 Merge elements into the current schema.
 

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 (const SchemaBase &)=default
 
 SchemaBase (SchemaBase &&)=default
 
SchemaBaseoperator= (const SchemaBase &)=default
 
SchemaBaseoperator= (SchemaBase &&)=default
 
 SchemaBase (const Parsnip::Data &schema_spec)
 Construct a schema from a JSON specification.
 
void checkType (Data::Type expected, const Parsnip::Data &entry) const
 Check that Data item is an allowed type.
 
bool isValidlyNull (const Parsnip::Data &entry) const
 Determine if the data is Null and if that is allowed.
 
bool isType (Data::Type expected, const Parsnip::Data &entry) const
 Check if a data object is a particular type.
 
- Protected Attributes inherited from Parsnip::SchemaBase
bool nullable = false
 If true, element may be null.
 

Detailed Description

Schema component requiring data be a particular type.

Member Function Documentation

◆ createCopy()

UncheckedSchema * Parsnip::UncheckedSchema::createCopy ( ) const
overridevirtual

Create an identical, deep copy of the schema.

Caller is responsible for deleting it.

Implements Parsnip::SchemaBase.

◆ dump()

std::ostream & Parsnip::UncheckedSchema::dump ( std::ostream &  target,
int  indent,
bool  suppress_indent = false 
) const
overridevirtual

Render the schema in human-friendly text.

Parameters
targetWhere to write the schema.
indentAmount of indent to use.
suppress_indentFlag indicating indent was already performed.

Implements Parsnip::SchemaBase.

◆ validate()

void Parsnip::UncheckedSchema::validate ( const Parsnip::Data entry) const
overridevirtual

Construct a schema element that does no checking.

Implements Parsnip::SchemaBase.


The documentation for this class was generated from the following files: