diff options
Diffstat (limited to 'src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h')
-rw-r--r-- | src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h index 8260a35959..e248954552 100644 --- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h +++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h @@ -38,9 +38,9 @@ #include "CFormatterJsonBase.h" #include "formatters/CSmartFactory.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. @@ -64,7 +64,7 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase { CFormatterJsonSDLRPCv2(const CFormatterJsonSDLRPCv2&); public: - typedef NsSmartDeviceLink::NsJSONHandler::Formatters:: + typedef ns_smart_device_link::ns_json_handler::formatters:: meta_formatter_error_code::tMetaFormatterErrorCode tMetaFormatterErrorCode; @@ -76,7 +76,7 @@ class CFormatterJsonSDLRPCv2 : 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); /** @@ -91,10 +91,11 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase { * @return true if success, otherwise - false */ template <typename FunctionId, typename MessageType> - static bool fromString(const std::string& str, - NsSmartDeviceLink::NsSmartObjects::SmartObject& out, - FunctionId functionId, - MessageType messageType); + static bool fromString( + const std::string& str, + ns_smart_device_link::ns_smart_objects::SmartObject& out, + FunctionId functionId, + MessageType messageType); /** * @brief Creates a SmartObject from a JSON string. @@ -113,11 +114,12 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase { * @return true if success, otherwise - false */ template <typename FunctionId, typename MessageType> - static bool fromString(const std::string& str, - NsSmartDeviceLink::NsSmartObjects::SmartObject& out, - FunctionId functionId, - MessageType messageType, - int32_t correlationId); + static bool fromString( + const std::string& str, + ns_smart_device_link::ns_smart_objects::SmartObject& out, + FunctionId functionId, + MessageType messageType, + int32_t correlationId); /** * @brief Converts to string the smart object against the given schema @@ -129,15 +131,15 @@ class CFormatterJsonSDLRPCv2 : 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> inline bool CFormatterJsonSDLRPCv2::fromString( const std::string& str, - NsSmartDeviceLink::NsSmartObjects::SmartObject& out, + ns_smart_device_link::ns_smart_objects::SmartObject& out, FunctionId functionId, MessageType messageType) { bool result = true; @@ -146,7 +148,7 @@ inline bool CFormatterJsonSDLRPCv2::fromString( Json::Value root; Json::Reader reader; - namespace strings = NsSmartDeviceLink::NsJSONHandler::strings; + namespace strings = ns_smart_device_link::ns_json_handler::strings; bool result = reader.parse(str, root); if (true == result) { @@ -167,12 +169,12 @@ inline bool CFormatterJsonSDLRPCv2::fromString( template <typename FunctionId, typename MessageType> inline bool CFormatterJsonSDLRPCv2::fromString( const std::string& str, - NsSmartDeviceLink::NsSmartObjects::SmartObject& out, + ns_smart_device_link::ns_smart_objects::SmartObject& out, FunctionId functionId, MessageType messageType, int32_t correlationId) { bool result = fromString(str, out, functionId, messageType); - namespace strings = NsSmartDeviceLink::NsJSONHandler::strings; + namespace strings = ns_smart_device_link::ns_json_handler::strings; if (true == result) { out[strings::S_PARAMS][strings::S_CORRELATION_ID] = correlationId; @@ -182,6 +184,6 @@ inline bool CFormatterJsonSDLRPCv2::fromString( } } } -} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters +} // namespace ns_smart_device_link::ns_json_handler::formatters #endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_ |