diff options
Diffstat (limited to 'src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h')
-rw-r--r-- | src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h index f22b1216ab..d2fdf87957 100644 --- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h +++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h @@ -40,9 +40,9 @@ #include "formatters/CSmartFactory.h" #include "formatters/meta_formatter.h" -namespace NsSmartDeviceLink { -namespace NsJSONHandler { -namespace Formatters { +namespace ns_smart_device_link { +namespace ns_json_handler { +namespace formatters { /** * @brief Class is used to convert SmartObjects to JSON string and vice versa. @@ -69,7 +69,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase { * @brief Extracts a message type from the SmartObject */ static const std::string getMessageType( - const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj); + const ns_smart_device_link::ns_smart_objects::SmartObject& obj); /** * @brief Extracts a message type from the root JSON object. @@ -117,7 +117,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase { static const int32_t kMessageTypeNotFound; static const int32_t kCorrelationIdNotFound; - typedef NsSmartDeviceLink::NsJSONHandler::Formatters:: + typedef ns_smart_device_link::ns_json_handler::formatters:: meta_formatter_error_code::tMetaFormatterErrorCode tMetaFormatterErrorCode; @@ -129,7 +129,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase { * @return true if success, false otherwise */ static bool toString( - const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj, + const ns_smart_device_link::ns_smart_objects::SmartObject& obj, std::string& outStr); /** @@ -142,7 +142,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase { template <typename FunctionId, typename MessageType> static int32_t fromString( const std::string& str, - NsSmartDeviceLink::NsSmartObjects::SmartObject& out); + ns_smart_device_link::ns_smart_objects::SmartObject& out); /** * @brief Converts to string the smart object against the given schema @@ -154,17 +154,17 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase { * @return formatting error code */ static tMetaFormatterErrorCode MetaFormatToString( - const NsSmartDeviceLink::NsSmartObjects::SmartObject& object, - const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema, + const ns_smart_device_link::ns_smart_objects::SmartObject& object, + const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema, std::string& outStr); }; // ---------------------------------------------------------------------------- template <typename FunctionId, typename MessageType> -int32_t Formatters::CFormatterJsonSDLRPCv1::fromString( +int32_t formatters::CFormatterJsonSDLRPCv1::fromString( const std::string& str, - NsSmartDeviceLink::NsSmartObjects::SmartObject& out) { + ns_smart_device_link::ns_smart_objects::SmartObject& out) { int32_t result = kSuccess; try { @@ -189,7 +189,7 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString( MessageType messageType = MessageType::INVALID_ENUM; if (kSuccess == result) { - if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum( + if (!ns_smart_objects::EnumConversionHelper<MessageType>::StringToEnum( type, &messageType)) { // If MessageType is not found than FunctionId and CorrelationId can not // be found either @@ -199,14 +199,14 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString( } if (kSuccess == result) { - if (!NsSmartObjects::EnumConversionHelper<FunctionId>::StringToEnum( + if (!ns_smart_objects::EnumConversionHelper<FunctionId>::StringToEnum( root[type][S_NAME].asString(), &functionId)) { result = kFunctionIdNotFound; functionId = FunctionId::INVALID_ENUM; } } - namespace S = NsSmartDeviceLink::NsJSONHandler::strings; + namespace S = ns_smart_device_link::ns_json_handler::strings; if (!(result & kMessageTypeNotFound)) { jsonValueToObj(root[type][S_PARAMETERS], out[S::S_MSG_PARAMS]); @@ -234,6 +234,6 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString( } } } -} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters +} // namespace ns_smart_device_link::ns_json_handler::formatters #endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_ |