diff options
Diffstat (limited to 'src/components/policy/policy_external/src/policy_table/enums.cc')
-rw-r--r-- | src/components/policy/policy_external/src/policy_table/enums.cc | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc index 27db505e3f..bb25623b35 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -1,4 +1,5 @@ #include "policy/policy_table/enums.h" +#include <cstring> namespace rpc { namespace policy_table_interface_base { @@ -137,6 +138,8 @@ bool IsValidEnum(Parameter val) { return true; case P_FUELRANGE: return true; + case P_CLOUD_APP_VEHICLE_ID: + return true; case P_ODOMETER: return true; case P_TIREPRESSURE: @@ -232,6 +235,8 @@ const char* EnumToJsonString(Parameter val) { return "instantFuelConsumption"; case P_FUELRANGE: return "fuelRange"; + case P_CLOUD_APP_VEHICLE_ID: + return "cloudAppVehicleID"; case P_ODOMETER: return "odometer"; case P_TIREPRESSURE: @@ -336,6 +341,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) { } else if ("fuelRange" == literal) { *result = P_FUELRANGE; return true; + } else if ("cloudAppVehicleID" == literal) { + *result = P_CLOUD_APP_VEHICLE_ID; + return true; } else if ("odometer" == literal) { *result = P_ODOMETER; return true; @@ -621,6 +629,8 @@ bool IsValidEnum(RequestType val) { return true; case RT_OEM_SPECIFIC: return true; + case RT_ICON_URL: + return true; case RT_EMPTY: return true; default: @@ -672,6 +682,8 @@ const char* EnumToJsonString(RequestType val) { return "FOTA"; case RT_OEM_SPECIFIC: return "OEM_SPECIFIC"; + case RT_ICON_URL: + return "ICON_URL"; case RT_EMPTY: return "EMPTY"; default: @@ -764,6 +776,10 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { *result = RT_OEM_SPECIFIC; return true; } + if ("ICON_URL" == literal) { + *result = RT_ICON_URL; + return true; + } if ("EMPTY" == literal) { *result = RT_EMPTY; return true; @@ -840,6 +856,38 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) { } } +bool IsValidEnum(HybridAppPreference val) { + return strlen(EnumToJsonString(val)) > 0; +} + +const char* EnumToJsonString(HybridAppPreference val) { + switch (val) { + case HAP_MOBILE: + return "MOBILE"; + case HAP_CLOUD: + return "CLOUD"; + case HAP_BOTH: + return "BOTH"; + default: + return ""; + } +} + +bool EnumFromJsonString(const std::string& literal, + HybridAppPreference* result) { + if ("MOBILE" == literal) { + *result = HAP_MOBILE; + return true; + } else if ("CLOUD" == literal) { + *result = HAP_CLOUD; + return true; + } else if ("BOTH" == literal) { + *result = HAP_BOTH; + return true; + } + return false; +} + bool EnumFromJsonString(const std::string& literal, FunctionID* result) { if ("RegisterAppInterface" == literal) { *result = RegisterAppInterfaceID; @@ -1081,6 +1129,36 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { return true; } + if ("SetCloudAppProperties" == literal) { + *result = SetCloudAppPropertiesID; + return true; + } + + if ("GetCloudAppProperties" == literal) { + *result = GetCloudAppPropertiesID; + return true; + } + + if ("PublishAppService" == literal) { + *result = PublishAppServiceID; + return true; + } + + if ("GetFile" == literal) { + *result = GetFileID; + return true; + } + + if ("GetAppServiceData" == literal) { + *result = GetAppServiceDataID; + return true; + } + + if ("PerformAppServiceInteraction" == literal) { + *result = PerformAppServiceInteractionID; + return true; + } + if ("OnHMIStatus" == literal) { *result = OnHMIStatusID; return true; @@ -1171,6 +1249,16 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { return true; } + if ("OnAppServiceData" == literal) { + *result = OnAppServiceDataID; + return true; + } + + if ("OnSystemCapabilityUpdated" == literal) { + *result = OnSystemCapabilityUpdatedID; + return true; + } + if ("EncodedSyncPData" == literal) { *result = EncodedSyncPDataID; return true; |