Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
JSONRPC::JsonRpcMethod Class Reference

Structure for a published json rpc method. More...

#include <JSONServiceDescription.h>

Inheritance diagram for JSONRPC::JsonRpcMethod:
JSONRPC::CJSONUtils

Public Member Functions

 JsonRpcMethod ()
 
bool Parse (const CVariant &value)
 
JSONRPC_STATUS Check (const CVariant &requestParameters, ITransportLayer *transport, IClient *client, bool notification, MethodCall &methodCall, CVariant &outputParameters) const
 

Public Attributes

std::string missingReference
 
std::string name
 Name of the represented method.
 
MethodCall method
 Pointer tot he implementation of the represented method.
 
TransportLayerCapability transportneed = Response
 Definition of the type of request/response.
 
OperationPermission permission = ReadData
 Definition of the permissions needed to execute the method.
 
std::string description
 Description of the method.
 
std::vector< JSONSchemaTypeDefinitionPtrparameters
 List of accepted parameters.
 
JSONSchemaTypeDefinitionPtr returns
 Definition of the return value.
 

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.
 
static bool IsValueMember (const CVariant &value, const std::string &key)
 Checks if the given object contains a value with the given key.
 
static CVariant GetParameter (const CVariant &parameterObject, const std::string &key, unsigned int position)
 Returns the json value of a parameter.
 
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.
 
static std::string GetString (const CVariant &value, const char *defaultValue)
 Returns the given json value as a string.
 
static TransportLayerCapability StringToTransportLayer (const std::string &transport)
 Returns a TransportLayerCapability value of the given string representation.
 
static JSONSchemaType StringToSchemaValueType (const std::string &valueType)
 Returns a JSONSchemaType value for the given string representation.
 
static std::string SchemaValueTypeToString (JSONSchemaType valueType)
 Returns a string representation for the given JSONSchemaType.
 
static void SchemaValueTypeToJson (JSONSchemaType valueType, CVariant &jsonObject)
 Converts the given json schema type into a json object.
 
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.
 
static bool IsType (const CVariant &value, JSONSchemaType valueType)
 Checks if the given json value is of the given type.
 
static void SetDefaultValue (CVariant &value, JSONSchemaType valueType)
 Sets the value of the given json value to the default value of the given type.
 
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.
 
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

Structure for a published json rpc method.

Represents a published json rpc method and is used to verify an incoming json rpc request against a defined method.

Constructor & Destructor Documentation

◆ JsonRpcMethod()

JsonRpcMethod::JsonRpcMethod ( )

Member Function Documentation

◆ Check()

JSONRPC_STATUS JsonRpcMethod::Check ( const CVariant & requestParameters,
ITransportLayer * transport,
IClient * client,
bool notification,
MethodCall & methodCall,
CVariant & outputParameters ) const

◆ Parse()

bool JsonRpcMethod::Parse ( const CVariant & value)

Member Data Documentation

◆ description

std::string JSONRPC::JsonRpcMethod::description

Description of the method.

◆ method

MethodCall JSONRPC::JsonRpcMethod::method

Pointer tot he implementation of the represented method.

◆ missingReference

std::string JSONRPC::JsonRpcMethod::missingReference

◆ name

std::string JSONRPC::JsonRpcMethod::name

Name of the represented method.

◆ parameters

std::vector<JSONSchemaTypeDefinitionPtr> JSONRPC::JsonRpcMethod::parameters

List of accepted parameters.

◆ permission

OperationPermission JSONRPC::JsonRpcMethod::permission = ReadData

Definition of the permissions needed to execute the method.

◆ returns

JSONSchemaTypeDefinitionPtr JSONRPC::JsonRpcMethod::returns

Definition of the return value.

◆ transportneed

TransportLayerCapability JSONRPC::JsonRpcMethod::transportneed = Response

Definition of the type of request/response.


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