diff options
Diffstat (limited to 'SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication')
39 files changed, 0 insertions, 3743 deletions
diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateApp.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateApp.cpp deleted file mode 100644 index 4335f508b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateApp.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/ActivateApp.h" -#include "../src/../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::SmartDeviceLinkCore - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -ActivateApp& ActivateApp::operator =(const ActivateApp& c) -{ - appName=c.appName; - appId=c.appId; - return *this; -} - - -ActivateApp::~ActivateApp(void) -{ -} - - -ActivateApp::ActivateApp(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ACTIVATEAPP) -{ -} - - -ActivateApp::ActivateApp(const ActivateApp& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ACTIVATEAPP,c.getId()) -{ - *this=c; -} - - -const std::string& ActivateApp::get_appName(void) -{ - return appName; -} - -bool ActivateApp::set_appName(const std::string& appName_) -{ - appName=appName_; - return true; -} - -int ActivateApp::get_appId(void) -{ - return appId; -} - -bool ActivateApp::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool ActivateApp::checkIntegrity(void) -{ - return ActivateAppMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppMarshaller.cpp deleted file mode 100644 index 7dea99072..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppMarshaller.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/ActivateApp.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool ActivateAppMarshaller::checkIntegrity(ActivateApp& s) -{ - return checkIntegrityConst(s); -} - - -bool ActivateAppMarshaller::fromString(const std::string& s,ActivateApp& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string ActivateAppMarshaller::toString(const ActivateApp& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ActivateAppMarshaller::checkIntegrityConst(const ActivateApp& s) -{ - if(s.appName.length()>100) return false; - - return true; -} - - -Json::Value ActivateAppMarshaller::toJSON(const ActivateApp& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.ActivateApp"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["appName"]=Json::Value(e.appName);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool ActivateAppMarshaller::fromJSON(const Json::Value& json,ActivateApp& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.ActivateApp")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - if(!js.isMember("appName") || !js["appName"].isString()) return false; - c.appName=js["appName"].asString(); - if(c.appName.length()>100) return false; - - if(!js.isMember("appId") || !js["appId"].isInt()) return false; - c.appId=js["appId"].asInt(); - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppMarshaller.h deleted file mode 100644 index 0cc715cfc..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ACTIVATEAPPMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ACTIVATEAPPMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/ActivateApp.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct ActivateAppMarshaller - { - static bool checkIntegrity(ActivateApp& e); - static bool checkIntegrityConst(const ActivateApp& e); - - static bool fromString(const std::string& s,ActivateApp& e); - static const std::string toString(const ActivateApp& e); - - static bool fromJSON(const Json::Value& s,ActivateApp& e); - static Json::Value toJSON(const ActivateApp& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponse.cpp deleted file mode 100644 index d499fbc78..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponse.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/ActivateAppResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunicationication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -ActivateAppResponse& ActivateAppResponse::operator =(const ActivateAppResponse& c) -{ - return *this; -} - - -ActivateAppResponse::~ActivateAppResponse(void) -{ -} - - -ActivateAppResponse::ActivateAppResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ACTIVATEAPPRESPONSE) -{ -} - - -ActivateAppResponse::ActivateAppResponse(const ActivateAppResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ACTIVATEAPPRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool ActivateAppResponse::checkIntegrity(void) -{ - return ActivateAppResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponseMarshaller.cpp deleted file mode 100644 index 047b05ce0..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponseMarshaller.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/ActivateAppResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/ActivateAppResponseMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool ActivateAppResponseMarshaller::checkIntegrity(ActivateAppResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool ActivateAppResponseMarshaller::fromString(const std::string& s,ActivateAppResponse& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string ActivateAppResponseMarshaller::toString(const ActivateAppResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ActivateAppResponseMarshaller::checkIntegrityConst(const ActivateAppResponse& s) -{ - return true; -} - - -Json::Value ActivateAppResponseMarshaller::toJSON(const ActivateAppResponse& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["id"]=Json::Value(e.getId()); - json["result"]=Json::Value(Json::objectValue); - NsSmartDeviceLinkRPCV2::Result r(static_cast<NsSmartDeviceLinkRPCV2::Result::ResultInternal>(e.getResult())); - json["result"]["resultCode"]=NsSmartDeviceLinkRPCV2::ResultMarshaller::toJSON(r); - json["result"]["method"]=Json::Value("BasicCommunication.ActivateAppResponse"); - - return json; -} - - -bool ActivateAppResponseMarshaller::fromJSON(const Json::Value& json,ActivateAppResponse& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - if(!json.isMember("result")) return false; - - Json::Value js=json["result"]; - if(!js.isObject()) return false; - - NsSmartDeviceLinkRPCV2::Result r; - if(!js.isMember("resultCode") || !js["resultCode"].isString()) return false; - if(!js.isMember("method") || !js["method"].isString()) return false; - if(js["method"].asString().compare("BasicCommunication.ActivateAppResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponseMarshaller.h deleted file mode 100644 index 7d7ab0615..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/ActivateAppResponseMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ACTIVATEAPPRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ACTIVATEAPPRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/ActivateAppResponse.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct ActivateAppResponseMarshaller - { - static bool checkIntegrity(ActivateAppResponse& e); - static bool checkIntegrityConst(const ActivateAppResponse& e); - - static bool fromString(const std::string& s,ActivateAppResponse& e); - static const std::string toString(const ActivateAppResponse& e); - - static bool fromJSON(const Json::Value& s,ActivateAppResponse& e); - static Json::Value toJSON(const ActivateAppResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppList.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppList.cpp deleted file mode 100644 index c14852243..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppList.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetAppList.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -GetAppList& GetAppList::operator =(const GetAppList& c) -{ - return *this; -} - - -GetAppList::~GetAppList(void) -{ -} - - -GetAppList::GetAppList(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETAPPLIST) -{ -} - - -GetAppList::GetAppList(const GetAppList& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETAPPLIST,c.getId()) -{ - *this=c; -} - - -bool GetAppList::checkIntegrity(void) -{ - return GetAppListMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListMarshaller.cpp deleted file mode 100644 index d2f2cd302..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListMarshaller.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetAppList.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/GetAppListMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool GetAppListMarshaller::checkIntegrity(GetAppList& s) -{ - return checkIntegrityConst(s); -} - - -bool GetAppListMarshaller::fromString(const std::string& s,GetAppList& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string GetAppListMarshaller::toString(const GetAppList& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetAppListMarshaller::checkIntegrityConst(const GetAppList& s) -{ - return true; -} - - -Json::Value GetAppListMarshaller::toJSON(const GetAppList& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.GetAppList"); - - json["id"]=Json::Value(e.getId()); - return json; -} - - -bool GetAppListMarshaller::fromJSON(const Json::Value& json,GetAppList& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.GetAppList")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListMarshaller.h deleted file mode 100644 index 5fe06a127..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETAPPLISTMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETAPPLISTMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetAppList.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct GetAppListMarshaller - { - static bool checkIntegrity(GetAppList& e); - static bool checkIntegrityConst(const GetAppList& e); - - static bool fromString(const std::string& s,GetAppList& e); - static const std::string toString(const GetAppList& e); - - static bool fromJSON(const Json::Value& s,GetAppList& e); - static Json::Value toJSON(const GetAppList& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponse.cpp deleted file mode 100644 index 4e778f4e4..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponse.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetAppListResponse.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -GetAppListResponse& GetAppListResponse::operator =(const GetAppListResponse& c) -{ - appList=c.appList; - return *this; -} - - -GetAppListResponse::~GetAppListResponse(void) -{ -} - - -GetAppListResponse::GetAppListResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETAPPLISTRESPONSE) -{ -} - - -GetAppListResponse::GetAppListResponse(const GetAppListResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETAPPLISTRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -const std::vector< NsSmartDeviceLinkRPCV2::HMIApplication>& GetAppListResponse::get_appList(void) -{ - return appList; -} - -bool GetAppListResponse::set_appList(const std::vector< NsSmartDeviceLinkRPCV2::HMIApplication>& appList_) -{ - appList=appList_; - return true; -} - -bool GetAppListResponse::checkIntegrity(void) -{ - return GetAppListResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponseMarshaller.cpp deleted file mode 100644 index 66c05d426..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponseMarshaller.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetAppListResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/HMIApplicationMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/GetAppListResponseMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool GetAppListResponseMarshaller::checkIntegrity(GetAppListResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool GetAppListResponseMarshaller::fromString(const std::string& s,GetAppListResponse& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string GetAppListResponseMarshaller::toString(const GetAppListResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetAppListResponseMarshaller::checkIntegrityConst(const GetAppListResponse& s) -{ - { - unsigned int i=s.appList.size(); - if(i<0) return false; - } - - return true; -} - - -Json::Value GetAppListResponseMarshaller::toJSON(const GetAppListResponse& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["id"]=Json::Value(e.getId()); - json["result"]=Json::Value(Json::objectValue); - NsSmartDeviceLinkRPCV2::Result r(static_cast<NsSmartDeviceLinkRPCV2::Result::ResultInternal>(e.getResult())); - json["result"]["resultCode"]=NsSmartDeviceLinkRPCV2::ResultMarshaller::toJSON(r); - json["result"]["method"]=Json::Value("BasicCommunication.GetAppListResponse"); - - { - unsigned int i=e.appList.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::HMIApplicationMarshaller::toJSON(e.appList[i]); - - json["result"]["appList"]=j; - } - return json; -} - - -bool GetAppListResponseMarshaller::fromJSON(const Json::Value& json,GetAppListResponse& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - if(!json.isMember("result")) return false; - - Json::Value js=json["result"]; - if(!js.isObject()) return false; - - NsSmartDeviceLinkRPCV2::Result r; - if(!js.isMember("resultCode") || !js["resultCode"].isString()) return false; - if(!js.isMember("method") || !js["method"].isString()) return false; - if(js["method"].asString().compare("BasicCommunication.GetAppListResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(!js.isMember("appList") || !js["appList"].isArray()) return false; - { - unsigned int i=js["appList"].size(); - if(i<0) return false; - c.appList.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::HMIApplication t; - if(!NsSmartDeviceLinkRPCV2::HMIApplicationMarshaller::fromJSON(js["appList"][i],t)) - return false; - c.appList[i]=t; - } - } - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponseMarshaller.h deleted file mode 100644 index e037e81bf..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetAppListResponseMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETAPPLISTRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETAPPLISTRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetAppListResponse.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct GetAppListResponseMarshaller - { - static bool checkIntegrity(GetAppListResponse& e); - static bool checkIntegrityConst(const GetAppListResponse& e); - - static bool fromString(const std::string& s,GetAppListResponse& e); - static const std::string toString(const GetAppListResponse& e); - - static bool fromJSON(const Json::Value& s,GetAppListResponse& e); - static Json::Value toJSON(const GetAppListResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceList.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceList.cpp deleted file mode 100644 index 38a3eb208..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceList.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetDeviceList.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -GetDeviceList& GetDeviceList::operator =(const GetDeviceList& c) -{ - return *this; -} - - -GetDeviceList::~GetDeviceList(void) -{ -} - - -GetDeviceList::GetDeviceList(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETDEVICELIST) -{ -} - - -GetDeviceList::GetDeviceList(const GetDeviceList& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETDEVICELIST,c.getId()) -{ - *this=c; -} - - -bool GetDeviceList::checkIntegrity(void) -{ - return GetDeviceListMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListMarshaller.cpp deleted file mode 100644 index ad213e0e1..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListMarshaller.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetDeviceList.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/GetDeviceListMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool GetDeviceListMarshaller::checkIntegrity(GetDeviceList& s) -{ - return checkIntegrityConst(s); -} - - -bool GetDeviceListMarshaller::fromString(const std::string& s,GetDeviceList& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string GetDeviceListMarshaller::toString(const GetDeviceList& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetDeviceListMarshaller::checkIntegrityConst(const GetDeviceList& s) -{ - return true; -} - - -Json::Value GetDeviceListMarshaller::toJSON(const GetDeviceList& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.GetDeviceList"); - - json["id"]=Json::Value(e.getId()); - return json; -} - - -bool GetDeviceListMarshaller::fromJSON(const Json::Value& json,GetDeviceList& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.GetDeviceList")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListMarshaller.h deleted file mode 100644 index e189a62f9..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETDEVICELISTMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETDEVICELISTMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetDeviceList.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct GetDeviceListMarshaller - { - static bool checkIntegrity(GetDeviceList& e); - static bool checkIntegrityConst(const GetDeviceList& e); - - static bool fromString(const std::string& s,GetDeviceList& e); - static const std::string toString(const GetDeviceList& e); - - static bool fromJSON(const Json::Value& s,GetDeviceList& e); - static Json::Value toJSON(const GetDeviceList& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponse.cpp deleted file mode 100644 index 5b55b63c1..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponse.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetDeviceListResponse.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -GetDeviceListResponse& GetDeviceListResponse::operator =(const GetDeviceListResponse& c) -{ - if(deviceList) delete deviceList; - deviceList= c.deviceList ? new std::vector<std::string>(c.deviceList[0]) : 0; - return *this; -} - - -GetDeviceListResponse::~GetDeviceListResponse(void) -{ - if(deviceList) delete deviceList; -} - - -GetDeviceListResponse::GetDeviceListResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETDEVICELISTRESPONSE), - deviceList(0) -{ -} - - -GetDeviceListResponse::GetDeviceListResponse(const GetDeviceListResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__GETDEVICELISTRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -const std::vector< std::string>* GetDeviceListResponse::get_deviceList(void) -{ - return deviceList; -} - -bool GetDeviceListResponse::set_deviceList(const std::vector< std::string>& deviceList_) -{ - if(deviceList) delete deviceList; - deviceList=new std::vector< std::string>(deviceList_); - return true; -} - -void GetDeviceListResponse::reset_deviceList(void) -{ - if(deviceList) delete deviceList; - deviceList=0; -} - -bool GetDeviceListResponse::checkIntegrity(void) -{ - return GetDeviceListResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponseMarshaller.cpp deleted file mode 100644 index 8a98df3a0..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponseMarshaller.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetDeviceListResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/GetDeviceListResponseMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool GetDeviceListResponseMarshaller::checkIntegrity(GetDeviceListResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool GetDeviceListResponseMarshaller::fromString(const std::string& s,GetDeviceListResponse& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string GetDeviceListResponseMarshaller::toString(const GetDeviceListResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetDeviceListResponseMarshaller::checkIntegrityConst(const GetDeviceListResponse& s) -{ - if(s.deviceList) - { - unsigned int i=s.deviceList[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value GetDeviceListResponseMarshaller::toJSON(const GetDeviceListResponse& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["id"]=Json::Value(e.getId()); - json["result"]=Json::Value(Json::objectValue); - NsSmartDeviceLinkRPCV2::Result r(static_cast<NsSmartDeviceLinkRPCV2::Result::ResultInternal>(e.getResult())); - json["result"]["resultCode"]=NsSmartDeviceLinkRPCV2::ResultMarshaller::toJSON(r); - json["result"]["method"]=Json::Value("BasicCommunication.GetDeviceListResponse"); - - if(e.deviceList) - { - unsigned int i=e.deviceList[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=Json::Value(e.deviceList[0][i]); - - json["result"]["deviceList"]=j; - } - return json; -} - - -bool GetDeviceListResponseMarshaller::fromJSON(const Json::Value& json,GetDeviceListResponse& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - if(!json.isMember("result")) return false; - - Json::Value js=json["result"]; - if(!js.isObject()) return false; - - NsSmartDeviceLinkRPCV2::Result r; - if(!js.isMember("resultCode") || !js["resultCode"].isString()) return false; - if(!js.isMember("method") || !js["method"].isString()) return false; - if(js["method"].asString().compare("BasicCommunication.GetDeviceListResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(c.deviceList) delete c.deviceList; - c.deviceList=0; - if(js.isMember("deviceList")) - { - if(!js["deviceList"].isArray()) return false; - unsigned int i=js["deviceList"].size(); - if(i<1) return false; - if(i>100) return false; - - c.deviceList=new std::vector<std::string>(); - c.deviceList->resize(js["deviceList"].size()); - - while(i--) - { - if(!js["deviceList"][i].isString()) - return false; - - c.deviceList[0][i]=js["deviceList"][i].asString(); - } - } - - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponseMarshaller.h deleted file mode 100644 index 1528dd1a4..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/GetDeviceListResponseMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETDEVICELISTRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_GETDEVICELISTRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/GetDeviceListResponse.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct GetDeviceListResponseMarshaller - { - static bool checkIntegrity(GetDeviceListResponse& e); - static bool checkIntegrityConst(const GetDeviceListResponse& e); - - static bool fromString(const std::string& s,GetDeviceListResponse& e); - static const std::string toString(const GetDeviceListResponse& e); - - static bool fromJSON(const Json::Value& s,GetDeviceListResponse& e); - static Json::Value toJSON(const GetDeviceListResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivated.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivated.cpp deleted file mode 100644 index d1233987d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivated.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppDeactivated.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -OnAppDeactivated& OnAppDeactivated::operator =(const OnAppDeactivated& c) -{ - appName=c.appName; - reason=c.reason; - appId=c.appId; - return *this; -} - - -OnAppDeactivated::~OnAppDeactivated(void) -{ -} - - -OnAppDeactivated::OnAppDeactivated(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPDEACTIVATED) -{ -} - - -OnAppDeactivated::OnAppDeactivated(const OnAppDeactivated& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPDEACTIVATED,c.getId()) -{ - *this=c; -} - - -const std::string& OnAppDeactivated::get_appName(void) -{ - return appName; -} - -bool OnAppDeactivated::set_appName(const std::string& appName_) -{ - appName=appName_; - return true; -} - -const NsSmartDeviceLinkRPCV2::DeactivateReason& OnAppDeactivated::get_reason(void) -{ - return reason; -} - -bool OnAppDeactivated::set_reason(const NsSmartDeviceLinkRPCV2::DeactivateReason& reason_) -{ - reason=reason_; - return true; -} - -int OnAppDeactivated::get_appId(void) -{ - return appId; -} - -bool OnAppDeactivated::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool OnAppDeactivated::checkIntegrity(void) -{ - return OnAppDeactivatedMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedMarshaller.cpp deleted file mode 100644 index 89a0d8423..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedMarshaller.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppDeactivated.h" -#include "../src/SDLRPCObjectsImpl/V2/DeactivateReasonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/OnAppDeactivatedMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool OnAppDeactivatedMarshaller::checkIntegrity(OnAppDeactivated& s) -{ - return checkIntegrityConst(s); -} - - -bool OnAppDeactivatedMarshaller::fromString(const std::string& s,OnAppDeactivated& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string OnAppDeactivatedMarshaller::toString(const OnAppDeactivated& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnAppDeactivatedMarshaller::checkIntegrityConst(const OnAppDeactivated& s) -{ - if(s.appName.length()>100) return false; - - if(!NsSmartDeviceLinkRPCV2::DeactivateReasonMarshaller::checkIntegrityConst(s.reason)) return false; - - return true; -} - - -Json::Value OnAppDeactivatedMarshaller::toJSON(const OnAppDeactivated& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.OnAppDeactivated"); - - json["params"]=Json::Value(Json::objectValue); - json["params"]["appName"]=Json::Value(e.appName);; - json["params"]["reason"]=NsSmartDeviceLinkRPCV2::DeactivateReasonMarshaller::toJSON(e.reason);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool OnAppDeactivatedMarshaller::fromJSON(const Json::Value& json,OnAppDeactivated& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.OnAppDeactivated")) return false; - - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - if(!js.isMember("appName") || !js["appName"].isString()) return false; - c.appName=js["appName"].asString(); - if(c.appName.length()>100) return false; - if(!js.isMember("reason") || !NsSmartDeviceLinkRPCV2::DeactivateReasonMarshaller::fromJSON(js["reason"],c.reason)) return false; - - if(!js.isMember("appId") || !js["appId"].isInt()) return false; - c.appId=js["appId"].asInt(); - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedMarshaller.h deleted file mode 100644 index bcd82d730..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPDEACTIVATEDMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPDEACTIVATEDMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppDeactivated.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct OnAppDeactivatedMarshaller - { - static bool checkIntegrity(OnAppDeactivated& e); - static bool checkIntegrityConst(const OnAppDeactivated& e); - - static bool fromString(const std::string& s,OnAppDeactivated& e); - static const std::string toString(const OnAppDeactivated& e); - - static bool fromJSON(const Json::Value& s,OnAppDeactivated& e); - static Json::Value toJSON(const OnAppDeactivated& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponse.cpp deleted file mode 100644 index 67d305c85..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponse.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -OnAppDeactivatedResponse& OnAppDeactivatedResponse::operator =(const OnAppDeactivatedResponse& c) -{ - return *this; -} - - -OnAppDeactivatedResponse::~OnAppDeactivatedResponse(void) -{ -} - - -OnAppDeactivatedResponse::OnAppDeactivatedResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPDEACTIVATEDRESPONSE) -{ -} - - -OnAppDeactivatedResponse::OnAppDeactivatedResponse(const OnAppDeactivatedResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPDEACTIVATEDRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool OnAppDeactivatedResponse::checkIntegrity(void) -{ - return OnAppDeactivatedResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponseMarshaller.cpp deleted file mode 100644 index d35e19839..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponseMarshaller.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponseMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool OnAppDeactivatedResponseMarshaller::checkIntegrity(OnAppDeactivatedResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool OnAppDeactivatedResponseMarshaller::fromString(const std::string& s,OnAppDeactivatedResponse& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string OnAppDeactivatedResponseMarshaller::toString(const OnAppDeactivatedResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnAppDeactivatedResponseMarshaller::checkIntegrityConst(const OnAppDeactivatedResponse& s) -{ - return true; -} - - -Json::Value OnAppDeactivatedResponseMarshaller::toJSON(const OnAppDeactivatedResponse& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["id"]=Json::Value(e.getId()); - json["result"]=Json::Value(Json::objectValue); - NsSmartDeviceLinkRPCV2::Result r(static_cast<NsSmartDeviceLinkRPCV2::Result::ResultInternal>(e.getResult())); - json["result"]["resultCode"]=NsSmartDeviceLinkRPCV2::ResultMarshaller::toJSON(r); - json["result"]["method"]=Json::Value("BasicCommunication.OnAppDeactivatedResponse"); - - return json; -} - - -bool OnAppDeactivatedResponseMarshaller::fromJSON(const Json::Value& json,OnAppDeactivatedResponse& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - if(!json.isMember("result")) return false; - - Json::Value js=json["result"]; - if(!js.isObject()) return false; - - NsSmartDeviceLinkRPCV2::Result r; - if(!js.isMember("resultCode") || !js["resultCode"].isString()) return false; - if(!js.isMember("method") || !js["method"].isString()) return false; - if(js["method"].asString().compare("BasicCommunication.OnAppDeactivatedResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponseMarshaller.h deleted file mode 100644 index 28c4da454..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponseMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPDEACTIVATEDRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPDEACTIVATEDRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppDeactivatedResponse.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct OnAppDeactivatedResponseMarshaller - { - static bool checkIntegrity(OnAppDeactivatedResponse& e); - static bool checkIntegrityConst(const OnAppDeactivatedResponse& e); - - static bool fromString(const std::string& s,OnAppDeactivatedResponse& e); - static const std::string toString(const OnAppDeactivatedResponse& e); - - static bool fromJSON(const Json::Value& s,OnAppDeactivatedResponse& e); - static Json::Value toJSON(const OnAppDeactivatedResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegistered.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegistered.cpp deleted file mode 100644 index 9c78cbd3d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegistered.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppRegistered.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -OnAppRegistered& OnAppRegistered::operator =(const OnAppRegistered& c) -{ - application=c.application; - return *this; -} - - -OnAppRegistered::~OnAppRegistered(void) -{ -} - - -OnAppRegistered::OnAppRegistered(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPREGISTERED) -{ -} - - -OnAppRegistered::OnAppRegistered(const OnAppRegistered& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPREGISTERED) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::HMIApplication& OnAppRegistered::get_application(void) -{ - return application; -} - -bool OnAppRegistered::set_application(const NsSmartDeviceLinkRPCV2::HMIApplication& application_) -{ - application=application_; - return true; -} - -bool OnAppRegistered::checkIntegrity(void) -{ - return OnAppRegisteredMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegisteredMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegisteredMarshaller.cpp deleted file mode 100644 index 7036d1568..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegisteredMarshaller.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppRegistered.h" -#include "../src/SDLRPCObjectsImpl/V2/HMIApplicationMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/OnAppRegisteredMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool OnAppRegisteredMarshaller::checkIntegrity(OnAppRegistered& s) -{ - return checkIntegrityConst(s); -} - - -bool OnAppRegisteredMarshaller::fromString(const std::string& s,OnAppRegistered& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string OnAppRegisteredMarshaller::toString(const OnAppRegistered& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnAppRegisteredMarshaller::checkIntegrityConst(const OnAppRegistered& s) -{ - if(!NsSmartDeviceLinkRPCV2::HMIApplicationMarshaller::checkIntegrityConst(s.application)) return false; - - return true; -} - - -Json::Value OnAppRegisteredMarshaller::toJSON(const OnAppRegistered& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.OnAppRegistered"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["application"]=NsSmartDeviceLinkRPCV2::HMIApplicationMarshaller::toJSON(e.application);; - return json; -} - - -bool OnAppRegisteredMarshaller::fromJSON(const Json::Value& json,OnAppRegistered& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.OnAppRegistered")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("application") || !NsSmartDeviceLinkRPCV2::HMIApplicationMarshaller::fromJSON(js["application"],c.application)) return false; - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegisteredMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegisteredMarshaller.h deleted file mode 100644 index 6c919bffd..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppRegisteredMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPREGISTEREDMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPREGISTEREDMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppRegistered.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct OnAppRegisteredMarshaller - { - static bool checkIntegrity(OnAppRegistered& e); - static bool checkIntegrityConst(const OnAppRegistered& e); - - static bool fromString(const std::string& s,OnAppRegistered& e); - static const std::string toString(const OnAppRegistered& e); - - static bool fromJSON(const Json::Value& s,OnAppRegistered& e); - static Json::Value toJSON(const OnAppRegistered& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregistered.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregistered.cpp deleted file mode 100644 index f7e7e4a5a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregistered.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppUnregistered.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -OnAppUnregistered& OnAppUnregistered::operator =(const OnAppUnregistered& c) -{ - appName=c.appName; - if(reason) delete reason; - reason= c.reason ? new NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReason(c.reason[0]) : 0; - appId=c.appId; - return *this; -} - - -OnAppUnregistered::~OnAppUnregistered(void) -{ - if(reason) delete reason; -} - - -OnAppUnregistered::OnAppUnregistered(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPUNREGISTERED), - reason(0) -{ -} - - -OnAppUnregistered::OnAppUnregistered(const OnAppUnregistered& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONAPPUNREGISTERED) -{ - *this=c; -} - - -const std::string& OnAppUnregistered::get_appName(void) -{ - return appName; -} - -bool OnAppUnregistered::set_appName(const std::string& appName_) -{ - appName=appName_; - return true; -} - -const NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReason* OnAppUnregistered::get_reason(void) -{ - return reason; -} - -bool OnAppUnregistered::set_reason(const NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReason& reason_) -{ - if(reason) delete reason; - reason=new NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReason(reason_); - return true; -} - -void OnAppUnregistered::reset_reason(void) -{ - if(reason) delete reason; - reason=0; -} - -int OnAppUnregistered::get_appId(void) -{ - return appId; -} - -bool OnAppUnregistered::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool OnAppUnregistered::checkIntegrity(void) -{ - return OnAppUnregisteredMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregisteredMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregisteredMarshaller.cpp deleted file mode 100644 index 0ecb87e64..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregisteredMarshaller.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppUnregistered.h" -#include "../src/SDLRPCObjectsImpl/V2/AppInterfaceUnregisteredReasonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/OnAppUnregisteredMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool OnAppUnregisteredMarshaller::checkIntegrity(OnAppUnregistered& s) -{ - return checkIntegrityConst(s); -} - - -bool OnAppUnregisteredMarshaller::fromString(const std::string& s,OnAppUnregistered& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string OnAppUnregisteredMarshaller::toString(const OnAppUnregistered& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnAppUnregisteredMarshaller::checkIntegrityConst(const OnAppUnregistered& s) -{ - if(s.appName.length()>100) return false; - - if(s.reason && (!NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReasonMarshaller::checkIntegrityConst(s.reason[0]))) return false; - - return true; -} - - -Json::Value OnAppUnregisteredMarshaller::toJSON(const OnAppUnregistered& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.OnAppUnregistered"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["appName"]=Json::Value(e.appName);; - if(e.reason) - json["params"]["reason"]=NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReasonMarshaller::toJSON(e.reason[0]);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool OnAppUnregisteredMarshaller::fromJSON(const Json::Value& json,OnAppUnregistered& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.OnAppUnregistered")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("appName") || !js["appName"].isString()) return false; - c.appName=js["appName"].asString(); - if(c.appName.length()>100) return false; - - if(c.reason) delete c.reason; - c.reason=0; - if(js.isMember("reason")) - { - c.reason=new NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReason(); - if(!NsSmartDeviceLinkRPCV2::AppInterfaceUnregisteredReasonMarshaller::fromJSON(js["reason"],c.reason[0])) return false; - } - - if(!js.isMember("appId") || !js["appId"].isInt()) return false; - c.appId=js["appId"].asInt(); - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregisteredMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregisteredMarshaller.h deleted file mode 100644 index 91b171826..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnAppUnregisteredMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPUNREGISTEREDMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONAPPUNREGISTEREDMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnAppUnregistered.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct OnAppUnregisteredMarshaller - { - static bool checkIntegrity(OnAppUnregistered& e); - static bool checkIntegrityConst(const OnAppUnregistered& e); - - static bool fromString(const std::string& s,OnAppUnregistered& e); - static const std::string toString(const OnAppUnregistered& e); - - static bool fromJSON(const Json::Value& s,OnAppUnregistered& e); - static Json::Value toJSON(const OnAppUnregistered& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdated.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdated.cpp deleted file mode 100644 index 2691690f1..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdated.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnDeviceListUpdated.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -OnDeviceListUpdated& OnDeviceListUpdated::operator =(const OnDeviceListUpdated& c) -{ - if(deviceList) delete deviceList; - deviceList= c.deviceList ? new std::vector<std::string>(c.deviceList[0]) : 0; - return *this; -} - - -OnDeviceListUpdated::~OnDeviceListUpdated(void) -{ - if(deviceList) delete deviceList; -} - - -OnDeviceListUpdated::OnDeviceListUpdated(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONDEVICELISTUPDATED), - deviceList(0) -{ -} - - -OnDeviceListUpdated::OnDeviceListUpdated(const OnDeviceListUpdated& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__ONDEVICELISTUPDATED) -{ - *this=c; -} - - -const std::vector< std::string>* OnDeviceListUpdated::get_deviceList(void) -{ - return deviceList; -} - -bool OnDeviceListUpdated::set_deviceList(const std::vector< std::string>& deviceList_) -{ - if(deviceList) delete deviceList; - deviceList=new std::vector< std::string>(deviceList_); - return true; -} - -void OnDeviceListUpdated::reset_deviceList(void) -{ - if(deviceList) delete deviceList; - deviceList=0; -} - -bool OnDeviceListUpdated::checkIntegrity(void) -{ - return OnDeviceListUpdatedMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdatedMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdatedMarshaller.cpp deleted file mode 100644 index 90c0182bb..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdatedMarshaller.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnDeviceListUpdated.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/OnDeviceListUpdatedMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool OnDeviceListUpdatedMarshaller::checkIntegrity(OnDeviceListUpdated& s) -{ - return checkIntegrityConst(s); -} - - -bool OnDeviceListUpdatedMarshaller::fromString(const std::string& s,OnDeviceListUpdated& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string OnDeviceListUpdatedMarshaller::toString(const OnDeviceListUpdated& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnDeviceListUpdatedMarshaller::checkIntegrityConst(const OnDeviceListUpdated& s) -{ - if(s.deviceList) - { - unsigned int i=s.deviceList[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value OnDeviceListUpdatedMarshaller::toJSON(const OnDeviceListUpdated& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.OnDeviceListUpdated"); - json["params"]=Json::Value(Json::objectValue); - - if(e.deviceList) - { - unsigned int i=e.deviceList[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=Json::Value(e.deviceList[0][i]); - - json["params"]["deviceList"]=j; - } - return json; -} - - -bool OnDeviceListUpdatedMarshaller::fromJSON(const Json::Value& json,OnDeviceListUpdated& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.OnDeviceListUpdated")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(c.deviceList) delete c.deviceList; - c.deviceList=0; - if(js.isMember("deviceList")) - { - if(!js["deviceList"].isArray()) return false; - unsigned int i=js["deviceList"].size(); - if(i<1) return false; - if(i>100) return false; - - c.deviceList=new std::vector<std::string>(); - c.deviceList->resize(js["deviceList"].size()); - - while(i--) - { - if(!js["deviceList"][i].isString()) - return false; - - c.deviceList[0][i]=js["deviceList"][i].asString(); - } - } - - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdatedMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdatedMarshaller.h deleted file mode 100644 index ad26e005e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/OnDeviceListUpdatedMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONDEVICELISTUPDATEDMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_ONDEVICELISTUPDATEDMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/OnDeviceListUpdated.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct OnDeviceListUpdatedMarshaller - { - static bool checkIntegrity(OnDeviceListUpdated& e); - static bool checkIntegrityConst(const OnDeviceListUpdated& e); - - static bool fromString(const std::string& s,OnDeviceListUpdated& e); - static const std::string toString(const OnDeviceListUpdated& e); - - static bool fromJSON(const Json::Value& s,OnDeviceListUpdated& e); - static Json::Value toJSON(const OnDeviceListUpdated& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendData.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendData.cpp deleted file mode 100644 index 6584873bc..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendData.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/SendData.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -SendData& SendData::operator =(const SendData& c) -{ - data=c.data; - if(url) delete url; - url= c.url ? new std::string(c.url[0]) : 0; - if(timeout) delete timeout; - timeout= c.timeout ? new int(c.timeout[0]) : 0; - return *this; -} - - -SendData::~SendData(void) -{ - if(url) delete url; - if(timeout) delete timeout; -} - - -SendData::SendData(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__SENDDATA), - url(0), - timeout(0) -{ -} - - -SendData::SendData(const SendData& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__SENDDATA,c.getId()) -{ - *this=c; -} - - -const std::vector< std::string>& SendData::get_data(void) -{ - return data; -} - -bool SendData::set_data(const std::vector< std::string>& data_) -{ - data=data_; - return true; -} - -const std::string* SendData::get_url(void) -{ - return url; -} - -bool SendData::set_url(const std::string& url_) -{ - if(url) delete url; - url=new std::string(url_); - return true; -} - -void SendData::reset_url(void) -{ - if(url) delete url; - url=0; -} - -const int* SendData::get_timeout(void) -{ - return timeout; -} - -bool SendData::set_timeout(const int& timeout_) -{ - if(timeout) delete timeout; - timeout=new int(timeout_); - return true; -} - -void SendData::reset_timeout(void) -{ - if(timeout) delete timeout; - timeout=0; -} - -bool SendData::checkIntegrity(void) -{ - return SendDataMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataMarshaller.cpp deleted file mode 100644 index 8f737acae..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataMarshaller.cpp +++ /dev/null @@ -1,181 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/SendData.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/SendDataMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool SendDataMarshaller::checkIntegrity(SendData& s) -{ - return checkIntegrityConst(s); -} - - -bool SendDataMarshaller::fromString(const std::string& s,SendData& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string SendDataMarshaller::toString(const SendData& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SendDataMarshaller::checkIntegrityConst(const SendData& s) -{ - { - unsigned int i=s.data.size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.url && (s.url[0].length()>1000)) return false; - - if(s.timeout && (s.timeout[0]<-2000000000 || s.timeout[0]>2000000000)) return false; - - return true; -} - - -Json::Value SendDataMarshaller::toJSON(const SendData& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("BasicCommunication.SendData"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - { - unsigned int i=e.data.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=Json::Value(e.data[i]); - - json["params"]["data"]=j; - } - if(e.url) - json["params"]["url"]=Json::Value(e.url[0]);; - if(e.timeout) - json["params"]["timeout"]=Json::Value(e.timeout[0]);; - return json; -} - - -bool SendDataMarshaller::fromJSON(const Json::Value& json,SendData& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("method") || !json["method"].isString() || json["method"].asString().compare("BasicCommunication.SendData")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - if(!js.isMember("data") || !js["data"].isArray()) - return false; - { - c.data.clear(); - unsigned int i=js["data"].size(); - if(i<1) return false; - if(i>100) return false; - c.data.resize(i); - while(i--) - { - if(!js["data"][i].isString()) - return false; - c.data[i]=js["data"][i].asString(); - - } - } - - - if(c.url) delete c.url; - c.url=0; - if(js.isMember("url")) - { - if(!js["url"].isString()) return false; - c.url=new std::string(); - c.url[0]=js["url"].asString(); - if(c.url[0].length()>1000) return false; - - } - - if(c.timeout) delete c.timeout; - c.timeout=0; - if(js.isMember("timeout")) - { - if(!js["timeout"].isInt()) return false; - c.timeout=new int(); - c.timeout[0]=js["timeout"].asInt(); - if(c.timeout[0]<-2000000000 || c.timeout[0]>2000000000) return false; - - } - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataMarshaller.h deleted file mode 100644 index f20fbeb5a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_SENDDATAMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_SENDDATAMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/SendData.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct SendDataMarshaller - { - static bool checkIntegrity(SendData& e); - static bool checkIntegrityConst(const SendData& e); - - static bool fromString(const std::string& s,SendData& e); - static const std::string toString(const SendData& e); - - static bool fromJSON(const Json::Value& s,SendData& e); - static Json::Value toJSON(const SendData& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponse.cpp deleted file mode 100644 index db77e7e39..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponse.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/SendDataResponse.h" -#include "../include/JSONHandler/RPC2Objects//Marshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - - -SendDataResponse& SendDataResponse::operator =(const SendDataResponse& c) -{ - return *this; -} - - -SendDataResponse::~SendDataResponse(void) -{ -} - - -SendDataResponse::SendDataResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__SENDDATARESPONSE) -{ -} - - -SendDataResponse::SendDataResponse(const SendDataResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_BASICCOMMUNICATION__SENDDATARESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool SendDataResponse::checkIntegrity(void) -{ - return SendDataResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponseMarshaller.cpp deleted file mode 100644 index 8a494799a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponseMarshaller.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include "../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/SendDataResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/RPC2ObjectsImpl//NsRPC2Communication/BasicCommunication/SendDataResponseMarshaller.h" - -/* - interface NsRPC2Communication::BasicCommunication - version 1.2 - generated at Thu Jan 24 06:41:15 2013 - source stamp Wed Jan 23 13:56:28 2013 - author RC -*/ - -using namespace NsRPC2Communication::BasicCommunication; - -bool SendDataResponseMarshaller::checkIntegrity(SendDataResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool SendDataResponseMarshaller::fromString(const std::string& s,SendDataResponse& e) -{ - try - { - Json::Reader reader; - Json::Value json; - if(!reader.parse(s,json,false)) return false; - if(!fromJSON(json,e)) return false; - } - catch(...) - { - return false; - } - return true; -} - - -const std::string SendDataResponseMarshaller::toString(const SendDataResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SendDataResponseMarshaller::checkIntegrityConst(const SendDataResponse& s) -{ - return true; -} - - -Json::Value SendDataResponseMarshaller::toJSON(const SendDataResponse& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["id"]=Json::Value(e.getId()); - json["result"]=Json::Value(Json::objectValue); - NsSmartDeviceLinkRPCV2::Result r(static_cast<NsSmartDeviceLinkRPCV2::Result::ResultInternal>(e.getResult())); - json["result"]["resultCode"]=NsSmartDeviceLinkRPCV2::ResultMarshaller::toJSON(r); - json["result"]["method"]=Json::Value("BasicCommunication.SendDataResponse"); - - return json; -} - - -bool SendDataResponseMarshaller::fromJSON(const Json::Value& json,SendDataResponse& c) -{ - try - { - if(!json.isObject()) return false; - if(!json.isMember("jsonrpc") || !json["jsonrpc"].isString() || json["jsonrpc"].asString().compare("2.0")) return false; - if(!json.isMember("id") || !json["id"].isInt()) return false; - c.setId(json["id"].asInt()); - - if(!json.isMember("result")) return false; - - Json::Value js=json["result"]; - if(!js.isObject()) return false; - - NsSmartDeviceLinkRPCV2::Result r; - if(!js.isMember("resultCode") || !js["resultCode"].isString()) return false; - if(!js.isMember("method") || !js["method"].isString()) return false; - if(js["method"].asString().compare("BasicCommunication.SendDataResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponseMarshaller.h deleted file mode 100644 index 94974d99c..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/BasicCommunication/SendDataResponseMarshaller.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#ifndef NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_SENDDATARESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_SMARTDEVICELINKCORE_SENDDATARESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/BasicCommunication/SendDataResponse.h" - -namespace NsRPC2Communication -{ - namespace BasicCommunication - { - - struct SendDataResponseMarshaller - { - static bool checkIntegrity(SendDataResponse& e); - static bool checkIntegrityConst(const SendDataResponse& e); - - static bool fromString(const std::string& s,SendDataResponse& e); - static const std::string toString(const SendDataResponse& e); - - static bool fromJSON(const Json::Value& s,SendDataResponse& e); - static Json::Value toJSON(const SendDataResponse& e); - }; - } -} - -#endif |