|
pianod2
multisource multiuser scriptable networked music player
|
Schema component for numeric data, either Integer or Real. More...
#include <parsnip_schema.h>


Public Types | |
| using | value_type = NumericType |
Public Member Functions | |
| RangeSchema (const NumericType min=std::numeric_limits< NumericType >::lowest(), const NumericType max=std::numeric_limits< NumericType >::max()) | |
| Construct a numeric schema from a schema definition. More... | |
| RangeSchema ()=default | |
| RangeSchema (const RangeSchema &)=default | |
| RangeSchema (RangeSchema &&)=default | |
| RangeSchema & | operator= (const RangeSchema &)=default |
| RangeSchema & | operator= (RangeSchema &&)=default |
| RangeSchema (const Parsnip::Data &schema_spec) | |
| Construct a numeric schema from a schema definition. More... | |
| virtual RangeSchema * | createCopy () const override |
| Create an identical, deep copy of the schema. More... | |
| virtual void | validate (const Parsnip::Data &entry) const override |
| Validate item range: ensure the datatype falls within the allowed range. More... | |
| virtual bool | operator== (const SchemaBase &other) const override |
| Check if two schemas perform the same validation. More... | |
| virtual void | mergeSchemas (const SchemaBase &from) override |
| Merge elements into the current schema. 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 |
Private Attributes | |
| bool | minimumIsInclusive = true |
| NumericType | minimum |
| bool | maximumIsInclusive = true |
| NumericType | maximum |
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... | |
Schema component for numeric data, either Integer or Real.
| using Parsnip::RangeSchema< NumericType >::value_type = NumericType |
| Parsnip::RangeSchema< NumericType >::RangeSchema | ( | const NumericType | min = std::numeric_limits<NumericType>::lowest(), |
| const NumericType | max = std::numeric_limits<NumericType>::max() |
||
| ) |
Construct a numeric schema from a schema definition.
| NumericType | Either double for number or long for integer. |
| min | The minimum acceptable value. |
| max | The maximum allowed value. |
|
default |
|
default |
|
default |
| Parsnip::RangeSchema< NumericType >::RangeSchema | ( | const Parsnip::Data & | schema_spec | ) |
Construct a numeric schema from a schema definition.
| NumericType | Either double for number or long for integer. |
| schema_spec | The schema specification. |

|
overridevirtual |
Create an identical, deep copy of the schema.
Caller is responsible for deleting it.
Implements Parsnip::SchemaBase.
Reimplemented in Parsnip::IntegerSchema.
|
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.
|
overridevirtual |
Merge elements into the current schema.
Merge elements managed by this class.
| from | A schema for a valid command command line. |
| Various | exceptions. |
Reimplemented from Parsnip::SchemaBase.

|
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.
Reimplemented in Parsnip::IntegerSchema.

|
overridevirtual |
Validate item range: ensure the datatype falls within the allowed range.
Implements Parsnip::SchemaBase.
Reimplemented in Parsnip::IntegerSchema.

|
private |
|
private |
|
private |
|
private |