Open Lighting Architecture  0.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | List of all members
ola::web::ArrayValidator Class Reference

Detailed Description

The validator for JsonArray.

Inheritance diagram for ola::web::ArrayValidator:
Inheritance graph
[legend]
Collaboration diagram for ola::web::ArrayValidator:
Collaboration graph
[legend]

Classes

class  AdditionalItems
 
class  Items
 
struct  Options
 

Public Member Functions

 ArrayValidator (Items *items, AdditionalItems *additional_items, const Options &options)
 Validate all elements of the array against the given schema. More...
 
void Visit (const JsonArray &array)
 
- Public Member Functions inherited from ola::web::BaseValidator
virtual bool IsValid () const
 Check if the value was valid according to this validator.
 
virtual void Visit (const JsonString &)
 
virtual void Visit (const JsonBool &)
 
virtual void Visit (const JsonNull &)
 
virtual void Visit (const JsonRawValue &)
 
virtual void Visit (const JsonObject &)
 
virtual void Visit (const JsonUInt &)
 
virtual void Visit (const JsonUInt64 &)
 
virtual void Visit (const JsonInt &)
 
virtual void Visit (const JsonInt64 &)
 
virtual void Visit (const JsonDouble &)
 
virtual JsonObjectGetSchema () const
 Returns the Schema as a JsonObject. More...
 
void SetSchema (const std::string &schema)
 Set the schema.
 
void SetId (const std::string &id)
 Set the id.
 
void SetTitle (const std::string &title)
 Set the title.
 
void SetDescription (const std::string &title)
 Set the description.
 
void SetDefaultValue (const JsonValue *value)
 Set the default value for this validator. More...
 
const JsonValueGetDefaultValue () const
 Return the default value. More...
 
void AddEnumValue (const JsonValue *value)
 Add a enum value to the list of allowed values. More...
 

Additional Inherited Members

- Public Types inherited from ola::web::ValidatorInterface
typedef std::vector
< ValidatorInterface * > 
ValidatorList
 a list of Validators.
 
- Protected Member Functions inherited from ola::web::BaseValidator
 BaseValidator (JsonType type)
 
bool CheckEnums (const JsonValue &value)
 
- Protected Attributes inherited from ola::web::BaseValidator
bool m_is_valid
 
JsonType m_type
 
std::string m_schema
 
std::string m_id
 
std::string m_title
 
std::string m_description
 
std::auto_ptr< const JsonValuem_default_value
 
std::vector< const JsonValue * > m_enums
 

Constructor & Destructor Documentation

ola::web::ArrayValidator::ArrayValidator ( Items items,
AdditionalItems additional_items,
const Options options 
)

Validate all elements of the array against the given schema.

Parameters
itemsThe items in the array, ownership is transferred.
additional_itemsAny additional (optional) items. ownership is transferred.
optionsExtra constraints on the Array.

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