xbmc
Classes | Public Member Functions | Public Attributes | List of all members
JSONRPC::JSONSchemaTypeDefinition Class Reference

Class for a parameter of a json rpc method. More...

#include <JSONServiceDescription.h>

Inheritance diagram for JSONRPC::JSONSchemaTypeDefinition:
Inheritance graph
[legend]
Collaboration diagram for JSONRPC::JSONSchemaTypeDefinition:
Collaboration graph
[legend]

Classes

class  CJsonSchemaPropertiesMap
 Maps a properties name to its json schema type definition. More...
 

Public Member Functions

bool Parse (const CVariant &value, bool isParameter=false)
 
JSONRPC_STATUS Check (const CVariant &value, CVariant &outputValue, CVariant &errorData) const
 
void Print (bool isParameter, bool isGlobal, bool printDefault, bool printDescriptions, CVariant &output) const
 
void ResolveReference ()
 

Public Attributes

std::string missingReference
 
std::string name
 Name of the parameter (for by-name calls)
 
std::string ID
 Id of the type (for referenced types) Renamed from "id" because of possible issues with Objective-C.
 
JSONSchemaTypeDefinitionPtr referencedType
 Referenced object.
 
bool referencedTypeSet = false
 Whether the type has been set based on the referenced type.
 
std::vector< JSONSchemaTypeDefinitionPtr > extends
 Array of reference types which are extended by this type.
 
std::string description
 Description of the parameter.
 
JSONSchemaType type = AnyValue
 JSON schema type of the parameter's value.
 
std::vector< JSONSchemaTypeDefinitionPtr > unionTypes
 JSON schema type definitions in case of a union type.
 
bool optional = true
 Whether or not the parameter is optional.
 
CVariant defaultValue
 Default value of the parameter (only needed when it is optional)
 
double minimum
 Minimum value for Integer or Number types.
 
double maximum
 Maximum value for Integer or Number types.
 
bool exclusiveMinimum = false
 Whether to exclude the defined Minimum value from the valid range or not.
 
bool exclusiveMaximum = false
 Whether to exclude the defined Maximum value from the valid range or not.
 
unsigned int divisibleBy = 0
 Integer by which the value (of type Integer) must be divisible without rest.
 
int minLength = -1
 Minimum length for String types.
 
int maxLength = -1
 Maximum length for String types.
 
std::vector< CVariantenums
 (Optional) List of allowed values for the type
 
std::vector< JSONSchemaTypeDefinitionPtr > items
 List of possible values in an array.
 
unsigned int minItems = 0
 Minimum amount of items in the array.
 
unsigned int maxItems = 0
 Maximum amount of items in the array.
 
bool uniqueItems = false
 Whether every value in the array must be unique or not.
 
std::vector< JSONSchemaTypeDefinitionPtr > additionalItems
 List of json schema definitions for additional items in an array with tuple typing (defined schemas in "items")
 
CJsonSchemaPropertiesMap properties
 List of properties of the parameter (only needed when the parameter is an object)
 
bool hasAdditionalProperties = false
 Whether the type can have additional properties or not.
 
JSONSchemaTypeDefinitionPtr additionalProperties
 Type definition for additional properties.
 

Additional Inherited Members

- Static Protected Member Functions inherited from JSONRPC::CJSONUtils
static void HandleLimits (const CVariant &parameterObject, CVariant &result, int size, int &start, int &end)
 
static bool ParseSorting (const CVariant &parameterObject, SortBy &sortBy, SortOrder &sortOrder, SortAttribute &sortAttributes)
 
static void ParseLimits (const CVariant &parameterObject, int &limitStart, int &limitEnd)
 
static bool ParameterExists (const CVariant &parameterObject, const std::string &key, unsigned int position)
 Checks if the given object contains a parameter. More...
 
static bool IsValueMember (const CVariant &value, const std::string &key)
 Checks if the given object contains a value with the given key. More...
 
static CVariant GetParameter (const CVariant &parameterObject, const std::string &key, unsigned int position)
 Returns the json value of a parameter. More...
 
static CVariant GetParameter (const CVariant &parameterObject, const std::string &key, unsigned int position, const CVariant &fallback)
 Returns the json value of a parameter or the given default value. More...
 
static std::string GetString (const CVariant &value, const char *defaultValue)
 Returns the given json value as a string. More...
 
static TransportLayerCapability StringToTransportLayer (const std::string &transport)
 Returns a TransportLayerCapability value of the given string representation. More...
 
static JSONSchemaType StringToSchemaValueType (const std::string &valueType)
 Returns a JSONSchemaType value for the given string representation. More...
 
static std::string SchemaValueTypeToString (JSONSchemaType valueType)
 Returns a string representation for the given JSONSchemaType. More...
 
static void SchemaValueTypeToJson (JSONSchemaType valueType, CVariant &jsonObject)
 Converts the given json schema type into a json object. More...
 
static const char * ValueTypeToString (CVariant::VariantType valueType)
 
static bool IsParameterType (const CVariant &parameterObject, const char *key, unsigned int position, JSONSchemaType valueType)
 Checks if the parameter with the given name or at the given position is of a certain type. More...
 
static bool IsType (const CVariant &value, JSONSchemaType valueType)
 Checks if the given json value is of the given type. More...
 
static void SetDefaultValue (CVariant &value, JSONSchemaType valueType)
 Sets the value of the given json value to the default value of the given type. More...
 
static bool HasType (JSONSchemaType typeObject, JSONSchemaType type)
 
static bool ParameterNotNull (const CVariant &parameterObject, const std::string &key)
 
static void CopyStringArray (const CVariant &jsonStringArray, std::vector< std::string > &stringArray)
 Copies the values from the jsonStringArray to the stringArray. stringArray is cleared. More...
 
static void SetFromDBDate (const CVariant &jsonDate, CDateTime &date)
 
static void SetFromDBDateTime (const CVariant &jsonDate, CDateTime &date)
 
static bool GetXspFiltering (const std::string &type, const CVariant &filter, std::string &xsp)
 
static void MillisecondsToTimeObject (int time, CVariant &result)
 

Detailed Description

Class for a parameter of a json rpc method.

Represents a parameter of a defined json rpc method and is used to verify and extract the value of the parameter in a method call.


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