Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Helper class containing utility methods to handle json rpc method calls. More...
#include <JSONUtils.h>
Static Public Member Functions | |
static void | MillisecondsToTimeObject (int time, CVariant &result) |
Static Protected Member Functions | |
static void | HandleLimits (const CVariant ¶meterObject, CVariant &result, int size, int &start, int &end) |
static bool | ParseSorting (const CVariant ¶meterObject, SortBy &sortBy, SortOrder &sortOrder, SortAttribute &sortAttributes) |
static void | ParseLimits (const CVariant ¶meterObject, int &limitStart, int &limitEnd) |
static bool | ParameterExists (const CVariant ¶meterObject, 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 ¶meterObject, const std::string &key, unsigned int position) |
Returns the json value of a parameter. | |
static CVariant | GetParameter (const CVariant ¶meterObject, 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 ¶meterObject, 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 ¶meterObject, 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) |
Helper class containing utility methods to handle json rpc method calls.
|
inlinestaticprotected |
Copies the values from the jsonStringArray to the stringArray. stringArray is cleared.
jsonStringArray | JSON object representing a string array |
stringArray | String array where the values are copied into (cleared) |
|
inlinestaticprotected |
Returns the json value of a parameter.
parameterObject | Object containing all provided parameters |
key | Possible name of the parameter |
position | Possible position of the parameter |
Returns the value of the parameter with the given key (if the given object is not an array) or of the parameter at the given position (if the given object is an array).
|
inlinestaticprotected |
Returns the json value of a parameter or the given default value.
parameterObject | Object containing all provided parameters |
key | Possible name of the parameter |
position | Possible position of the parameter |
fallback | Default value of the parameter |
Returns the value of the parameter with the given key (if the given object is not an array) or of the parameter at the given position (if the given object is an array). If the parameter does not exist the given default value is returned.
|
inlinestaticprotected |
Returns the given json value as a string.
value | Json value to convert to a string |
defaultValue | Default string value |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
Checks if the parameter with the given name or at the given position is of a certain type.
parameterObject | Object containing all provided parameters |
key | Possible name of the parameter |
position | Possible position of the parameter |
valueType | Expected type of the parameter |
|
inlinestaticprotected |
Checks if the given json value is of the given type.
value | Json value to check |
valueType | Expected type of the json value |
|
inlinestaticprotected |
Checks if the given object contains a value with the given key.
value | Value to check for the member |
key | Key of the member to check for |
|
inlinestatic |
|
inlinestaticprotected |
Checks if the given object contains a parameter.
parameterObject | Object to check for a parameter |
key | Possible name of the parameter |
position | Possible position of the parameter |
Checks the given object for a parameter with the given key (if the given object is not an array) or for a parameter at the given position (if the given object is an array).
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
Converts the given json schema type into a json object.
valueTye | json schema type(s) |
jsonObject | json object into which the json schema type(s) are stored |
|
inlinestaticprotected |
Returns a string representation for the given JSONSchemaType.
valueType | Specific JSONSchemaType |
|
inlinestaticprotected |
Sets the value of the given json value to the default value of the given type.
value | Json value to be set |
valueType | Type of the default value |
|
staticprotected |
|
staticprotected |
|
inlinestaticprotected |
Returns a JSONSchemaType value for the given string representation.
valueType | String representation of the JSONSchemaType |
|
inlinestaticprotected |
Returns a TransportLayerCapability value of the given string representation.
transport | String representation of the TransportLayerCapability |
|
inlinestaticprotected |