Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ychernysheva committed Aug 18, 2020
1 parent 460daf4 commit 3ae23f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,46 +180,9 @@ class MessageHelper {
*/
static const VehicleData& vehicle_data();

/**
* @deprecated Unused due to creation template EnumToString function
* @brief Converts HMI Result enum value to string
* @param hmi_result HMI Result enum value
* @return stringified value for enum if succedeed, otherwise - empty string
*/
DEPRECATED static std::string HMIResultToString(
hmi_apis::Common_Result::eType hmi_result);

/**
* @deprecated Unused due to creation template StringToEnum function
* @brief Converts string to HMI Result enum value
* @param hmi_result stringified value
* @return HMI Result enum value if succedeed, otherwise - INVALID_ENUM
* value
*/
DEPRECATED static hmi_apis::Common_Result::eType HMIResultFromString(
const std::string& hmi_result);

/**
* @deprecated Unused due to creation template EnumToString function
* @brief Converts mobile Result enum value to string
* @param mobile_result mobile Result enum value
* @return stringified value for enum if succedeed, otherwise - empty string
*/
DEPRECATED static std::string MobileResultToString(
mobile_apis::Result::eType mobile_result);

static std::string GetDeviceMacAddressForHandle(
const transport_manager::DeviceHandle device_handle,
const ApplicationManager& app_mngr);
/**
* @deprecated Unused due to creation template StringToEnum function
* @brief Converts string to mobile Result enum value
* @param mobile_result stringified value
* @return mobile Result enum value if succedeed, otherwise - INVALID_ENUM
* value
*/
DEPRECATED static mobile_api::Result::eType MobileResultFromString(
const std::string& mobile_result);

/**
* @brief Converts HMI Result enum value to mobile Result enum value
Expand All @@ -238,25 +201,6 @@ class MessageHelper {
static hmi_apis::Common_Result::eType MobileToHMIResult(
const mobile_api::Result::eType mobile_result);

/**
* @deprecated Unused due to creation template StringToEnum function
* @brief Convert string to HMI level, if possible
* @param hmi_level Stringified HMI level
* @return Appropriate enum from HMI level, or INVALID_ENUM, if conversiion
* is not possible
*/
DEPRECATED static mobile_api::HMILevel::eType StringToHMILevel(
const std::string& hmi_level);

/**
* @deprecated Unused due to creation template EnumToString function
* @brief Used to obtain string representation of app's
* HMI Level.
* @param hmi_level Desired HMI Level
*/
DEPRECATED static std::string StringifiedHMILevel(
const mobile_apis::HMILevel::eType hmi_level);

/**
* @brief Used to obtain function name by its id
* @param function_id Function ID
Expand Down Expand Up @@ -839,33 +783,6 @@ class MessageHelper {

static const uint32_t GetPriorityCode(const std::string& priority);

/**
* @deprecated Unused due to creation template EnumToString function
* @brief Convert common language to string representation
* @param language Common language
* @return Common language string representation
*/
DEPRECATED static std::string CommonLanguageToString(
hmi_apis::Common_Language::eType language);

/**
* @deprecated Unused due to creation template EnumToString function
* @brief Converts mobile language to string representation
* @param language Mobile UI language
* @return Mobile language string representation
*/
DEPRECATED static std::string MobileLanguageToString(
mobile_apis::Language::eType language);

/**
* @deprecated Unused due to creation template StringToEnum function
* @brief Converts string to mobile language enum value
* @param language language as string
* @return Mobile language enum value
*/
DEPRECATED static mobile_apis::Language::eType MobileLanguageFromString(
const std::string& language);

/**
* @brief Converts mobile language enum to HMI language enum
* @param language Mobile language enum
Expand Down Expand Up @@ -917,18 +834,6 @@ class MessageHelper {
const std::string& icon_path,
ApplicationManager& application_manager);

DEPRECATED static hmi_apis::Common_Language::eType CommonLanguageFromString(
const std::string& language);

/**
* @deprecated Unused due to creation template StringToEnum function
* @brief CommonLightNameFromString convert string to LightName enum value
* @param lightName string to convert
* @return value LightName enum value
*/
DEPRECATED static hmi_apis::Common_LightName::eType CommonLightNameFromString(
const std::string& lightName);

static smart_objects::SmartObjectSPtr
GetOnAppInterfaceUnregisteredNotificationToMobile(
int32_t connection_key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,28 +301,6 @@ const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
return static_cast<uint32_t>(hmi_apis::Common_AppPriority::INVALID_ENUM);
}

hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
const std::string& language) {
using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Language::eType value;
if (EnumConversionHelper<hmi_apis::Common_Language::eType>::StringToEnum(
language, &value)) {
return value;
}
return hmi_apis::Common_Language::INVALID_ENUM;
}

hmi_apis::Common_LightName::eType MessageHelper::CommonLightNameFromString(
const std::string& lightName) {
using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_LightName::eType value;
if (EnumConversionHelper<hmi_apis::Common_LightName::eType>::StringToEnum(
lightName, &value)) {
return value;
}
return hmi_apis::Common_LightName::INVALID_ENUM;
}

std::string MessageHelper::GetDeviceMacAddressForHandle(
const transport_manager::DeviceHandle device_handle,
const ApplicationManager& app_mngr) {
Expand All @@ -333,26 +311,6 @@ std::string MessageHelper::GetDeviceMacAddressForHandle(
return device_mac_address;
}

std::string MessageHelper::CommonLanguageToString(
hmi_apis::Common_Language::eType language) {
using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<hmi_apis::Common_Language::eType>::EnumToCString(
language, &str)) {
return str ? str : "";
}
return std::string();
}

std::string MessageHelper::MobileLanguageToString(
mobile_apis::Language::eType language) {
using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
EnumConversionHelper<mobile_apis::Language::eType>::EnumToCString(language,
&str);
return str ? str : std::string();
}

smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
using namespace smart_objects;
Expand Down Expand Up @@ -748,66 +706,22 @@ const VehicleData& MessageHelper::vehicle_data() {
return vehicle_data_;
}

std::string MessageHelper::HMIResultToString(
hmi_apis::Common_Result::eType hmi_result) {
using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::EnumToCString(
hmi_result, &str)) {
return str;
}
return std::string();
}

hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
const std::string& hmi_result) {
using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Result::eType value;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::StringToEnum(
hmi_result, &value)) {
return value;
}
return hmi_apis::Common_Result::INVALID_ENUM;
}

std::string MessageHelper::MobileResultToString(
mobile_apis::Result::eType mobile_result) {
using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::Result::eType>::EnumToCString(
mobile_result, &str)) {
return str;
}
return std::string();
}

mobile_apis::Result::eType MessageHelper::MobileResultFromString(
const std::string& mobile_result) {
using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::Result::eType value;
if (EnumConversionHelper<mobile_apis::Result::eType>::StringToEnum(
mobile_result, &value)) {
return value;
}
return mobile_apis::Result::INVALID_ENUM;
}

mobile_apis::Result::eType MessageHelper::HMIToMobileResult(
const hmi_apis::Common_Result::eType hmi_result) {
const std::string result = HMIResultToString(hmi_result);
const std::string result = EnumToString(hmi_result);
if (result.empty()) {
return mobile_api::Result::INVALID_ENUM;
}
return MobileResultFromString(result);
return StringToEnum<mobile_apis::Result::eType>(result);
}

hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult(
const mobile_apis::Result::eType mobile_result) {
const std::string result = MobileResultToString(mobile_result);
const std::string result = EnumToString(mobile_result);
if (result.empty()) {
return hmi_apis::Common_Result::INVALID_ENUM;
}
return HMIResultFromString(result);
return StringToEnum<hmi_apis::Common_Result::eType>(result);
}

void MessageHelper::SendHMIStatusNotification(
Expand Down Expand Up @@ -905,28 +819,6 @@ void MessageHelper::SendActivateAppToHMI(
application_manager.GetRPCService().ManageHMICommand(message);
}

mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
const std::string& hmi_level) {
using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::HMILevel::eType value;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::StringToEnum(
hmi_level, &value)) {
return value;
}
return mobile_apis::HMILevel::INVALID_ENUM;
}

std::string MessageHelper::StringifiedHMILevel(
const mobile_apis::HMILevel::eType hmi_level) {
using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::EnumToCString(
hmi_level, &str)) {
return str;
}
return std::string();
}

std::string MessageHelper::StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id) {
LOG4CXX_AUTO_TRACE(logger_);
Expand Down

0 comments on commit 3ae23f2

Please sign in to comment.