diff options
Diffstat (limited to 'SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI')
177 files changed, 0 insertions, 18439 deletions
diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommand.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommand.cpp deleted file mode 100644 index 26b38541c..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommand.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/UI/AddCommand.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -AddCommand& AddCommand::operator =(const AddCommand& c) -{ - cmdId=c.cmdId; - menuParams=c.menuParams; - if(cmdIcon) delete cmdIcon; - cmdIcon= c.cmdIcon ? new NsSmartDeviceLinkRPCV2::Image(c.cmdIcon[0]) : 0; - appId=c.appId; - return *this; -} - - -AddCommand::~AddCommand(void) -{ - if(cmdIcon) delete cmdIcon; -} - - -AddCommand::AddCommand(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDCOMMAND), - cmdIcon(0) -{ -} - - -AddCommand::AddCommand(const AddCommand& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDCOMMAND,c.getId()) -{ - *this=c; -} - - -unsigned int AddCommand::get_cmdId(void) -{ - return cmdId; -} - -bool AddCommand::set_cmdId(unsigned int cmdId_) -{ - cmdId=cmdId_; - return true; -} - -const NsSmartDeviceLinkRPCV2::MenuParams& AddCommand::get_menuParams(void) -{ - return menuParams; -} - -bool AddCommand::set_menuParams(const NsSmartDeviceLinkRPCV2::MenuParams& menuParams_) -{ - menuParams=menuParams_; - return true; -} - -const NsSmartDeviceLinkRPCV2::Image* AddCommand::get_cmdIcon(void) -{ - return cmdIcon; -} - -bool AddCommand::set_cmdIcon(const NsSmartDeviceLinkRPCV2::Image& cmdIcon_) -{ - if(cmdIcon) delete cmdIcon; - cmdIcon=new NsSmartDeviceLinkRPCV2::Image(cmdIcon_); - return true; -} - -void AddCommand::reset_cmdIcon(void) -{ - if(cmdIcon) delete cmdIcon; - cmdIcon=0; -} - -int AddCommand::get_appId(void) -{ - return appId; -} - -bool AddCommand::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool AddCommand::checkIntegrity(void) -{ - return AddCommandMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandMarshaller.cpp deleted file mode 100644 index 3f91cbf9c..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandMarshaller.cpp +++ /dev/null @@ -1,148 +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/UI/AddCommand.h" -#include "../src/SDLRPCObjectsImpl/V2/MenuParamsMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ImageMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AddCommandMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AddCommandMarshaller::checkIntegrity(AddCommand& s) -{ - return checkIntegrityConst(s); -} - - -bool AddCommandMarshaller::fromString(const std::string& s,AddCommand& 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 AddCommandMarshaller::toString(const AddCommand& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AddCommandMarshaller::checkIntegrityConst(const AddCommand& s) -{ - if(s.cmdId>2000000000) return false; - - if(!NsSmartDeviceLinkRPCV2::MenuParamsMarshaller::checkIntegrityConst(s.menuParams)) return false; - - if(s.cmdIcon && (!NsSmartDeviceLinkRPCV2::ImageMarshaller::checkIntegrityConst(s.cmdIcon[0]))) return false; - - return true; -} - - -Json::Value AddCommandMarshaller::toJSON(const AddCommand& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.AddCommand"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["cmdId"]=Json::Value(e.cmdId);; - json["params"]["menuParams"]=NsSmartDeviceLinkRPCV2::MenuParamsMarshaller::toJSON(e.menuParams);; - if(e.cmdIcon) - json["params"]["cmdIcon"]=NsSmartDeviceLinkRPCV2::ImageMarshaller::toJSON(e.cmdIcon[0]);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool AddCommandMarshaller::fromJSON(const Json::Value& json,AddCommand& 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("UI.AddCommand")) 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("cmdId") || !js["cmdId"].isInt()) return false; - c.cmdId=js["cmdId"].asInt(); - if(c.cmdId>2000000000) return false; - - if(!js.isMember("menuParams") || !NsSmartDeviceLinkRPCV2::MenuParamsMarshaller::fromJSON(js["menuParams"],c.menuParams)) return false; - - if(c.cmdIcon) delete c.cmdIcon; - c.cmdIcon=0; - if(js.isMember("cmdIcon")) - { - c.cmdIcon=new NsSmartDeviceLinkRPCV2::Image(); - if(!NsSmartDeviceLinkRPCV2::ImageMarshaller::fromJSON(js["cmdIcon"],c.cmdIcon[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/UI/AddCommandMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandMarshaller.h deleted file mode 100644 index 1548cc356..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandMarshaller.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_UI_ADDCOMMANDMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ADDCOMMANDMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AddCommand.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AddCommandMarshaller - { - static bool checkIntegrity(AddCommand& e); - static bool checkIntegrityConst(const AddCommand& e); - - static bool fromString(const std::string& s,AddCommand& e); - static const std::string toString(const AddCommand& e); - - static bool fromJSON(const Json::Value& s,AddCommand& e); - static Json::Value toJSON(const AddCommand& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponse.cpp deleted file mode 100644 index cf40a9e31..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponse.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/UI/AddCommandResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -AddCommandResponse& AddCommandResponse::operator =(const AddCommandResponse& c) -{ - return *this; -} - - -AddCommandResponse::~AddCommandResponse(void) -{ -} - - -AddCommandResponse::AddCommandResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDCOMMANDRESPONSE) -{ -} - - -AddCommandResponse::AddCommandResponse(const AddCommandResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDCOMMANDRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool AddCommandResponse::checkIntegrity(void) -{ - return AddCommandResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponseMarshaller.cpp deleted file mode 100644 index d23e3c1b0..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponseMarshaller.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/UI/AddCommandResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AddCommandResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AddCommandResponseMarshaller::checkIntegrity(AddCommandResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool AddCommandResponseMarshaller::fromString(const std::string& s,AddCommandResponse& 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 AddCommandResponseMarshaller::toString(const AddCommandResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AddCommandResponseMarshaller::checkIntegrityConst(const AddCommandResponse& s) -{ - return true; -} - - -Json::Value AddCommandResponseMarshaller::toJSON(const AddCommandResponse& 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("UI.AddCommandResponse"); - - return json; -} - - -bool AddCommandResponseMarshaller::fromJSON(const Json::Value& json,AddCommandResponse& 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("UI.AddCommandResponse")) 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/UI/AddCommandResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponseMarshaller.h deleted file mode 100644 index 5d4845e41..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddCommandResponseMarshaller.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_UI_ADDCOMMANDRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ADDCOMMANDRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AddCommandResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AddCommandResponseMarshaller - { - static bool checkIntegrity(AddCommandResponse& e); - static bool checkIntegrityConst(const AddCommandResponse& e); - - static bool fromString(const std::string& s,AddCommandResponse& e); - static const std::string toString(const AddCommandResponse& e); - - static bool fromJSON(const Json::Value& s,AddCommandResponse& e); - static Json::Value toJSON(const AddCommandResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenu.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenu.cpp deleted file mode 100644 index 77a87d230..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenu.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/UI/AddSubMenu.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -AddSubMenu& AddSubMenu::operator =(const AddSubMenu& c) -{ - menuId=c.menuId; - if(position) delete position; - position= c.position ? new unsigned int(c.position[0]) : 0; - menuName=c.menuName; - appId=c.appId; - return *this; -} - - -AddSubMenu::~AddSubMenu(void) -{ - if(position) delete position; -} - - -AddSubMenu::AddSubMenu(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDSUBMENU), - position(0) -{ -} - - -AddSubMenu::AddSubMenu(const AddSubMenu& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDSUBMENU,c.getId()) -{ - *this=c; -} - - -unsigned int AddSubMenu::get_menuId(void) -{ - return menuId; -} - -bool AddSubMenu::set_menuId(unsigned int menuId_) -{ - menuId=menuId_; - return true; -} - -const unsigned int* AddSubMenu::get_position(void) -{ - return position; -} - -bool AddSubMenu::set_position(const unsigned int& position_) -{ - if(position) delete position; - position=new unsigned int(position_); - return true; -} - -void AddSubMenu::reset_position(void) -{ - if(position) delete position; - position=0; -} - -const std::string& AddSubMenu::get_menuName(void) -{ - return menuName; -} - -bool AddSubMenu::set_menuName(const std::string& menuName_) -{ - menuName=menuName_; - return true; -} - -int AddSubMenu::get_appId(void) -{ - return appId; -} - -bool AddSubMenu::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool AddSubMenu::checkIntegrity(void) -{ - return AddSubMenuMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuMarshaller.cpp deleted file mode 100644 index 0a17ac478..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuMarshaller.cpp +++ /dev/null @@ -1,151 +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/UI/AddSubMenu.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AddSubMenuMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AddSubMenuMarshaller::checkIntegrity(AddSubMenu& s) -{ - return checkIntegrityConst(s); -} - - -bool AddSubMenuMarshaller::fromString(const std::string& s,AddSubMenu& 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 AddSubMenuMarshaller::toString(const AddSubMenu& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AddSubMenuMarshaller::checkIntegrityConst(const AddSubMenu& s) -{ - if(s.menuId>2000000000) return false; - - if(s.position && (s.position[0]>1000)) return false; - - if(s.menuName.length()>500) return false; - - return true; -} - - -Json::Value AddSubMenuMarshaller::toJSON(const AddSubMenu& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.AddSubMenu"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["menuId"]=Json::Value(e.menuId);; - if(e.position) - json["params"]["position"]=Json::Value(e.position[0]);; - json["params"]["menuName"]=Json::Value(e.menuName);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool AddSubMenuMarshaller::fromJSON(const Json::Value& json,AddSubMenu& 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("UI.AddSubMenu")) 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("menuId") || !js["menuId"].isInt()) return false; - c.menuId=js["menuId"].asInt(); - if(c.menuId>2000000000) return false; - - if(c.position) delete c.position; - c.position=0; - if(js.isMember("position")) - { - if(!js["position"].isInt()) return false; - c.position=new unsigned int(); - c.position[0]=js["position"].asInt(); - if(c.position[0]>1000) return false; - - } - - if(!js.isMember("menuName") || !js["menuName"].isString()) return false; - c.menuName=js["menuName"].asString(); - if(c.menuName.length()>500) 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/UI/AddSubMenuMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuMarshaller.h deleted file mode 100644 index bb48df5d0..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuMarshaller.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_UI_ADDSUBMENUMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ADDSUBMENUMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AddSubMenu.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AddSubMenuMarshaller - { - static bool checkIntegrity(AddSubMenu& e); - static bool checkIntegrityConst(const AddSubMenu& e); - - static bool fromString(const std::string& s,AddSubMenu& e); - static const std::string toString(const AddSubMenu& e); - - static bool fromJSON(const Json::Value& s,AddSubMenu& e); - static Json::Value toJSON(const AddSubMenu& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponse.cpp deleted file mode 100644 index 213f08085..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponse.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/UI/AddSubMenuResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -AddSubMenuResponse& AddSubMenuResponse::operator =(const AddSubMenuResponse& c) -{ - return *this; -} - - -AddSubMenuResponse::~AddSubMenuResponse(void) -{ -} - - -AddSubMenuResponse::AddSubMenuResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDSUBMENURESPONSE) -{ -} - - -AddSubMenuResponse::AddSubMenuResponse(const AddSubMenuResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ADDSUBMENURESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool AddSubMenuResponse::checkIntegrity(void) -{ - return AddSubMenuResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponseMarshaller.cpp deleted file mode 100644 index 4a6f7c872..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponseMarshaller.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/UI/AddSubMenuResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AddSubMenuResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AddSubMenuResponseMarshaller::checkIntegrity(AddSubMenuResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool AddSubMenuResponseMarshaller::fromString(const std::string& s,AddSubMenuResponse& 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 AddSubMenuResponseMarshaller::toString(const AddSubMenuResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AddSubMenuResponseMarshaller::checkIntegrityConst(const AddSubMenuResponse& s) -{ - return true; -} - - -Json::Value AddSubMenuResponseMarshaller::toJSON(const AddSubMenuResponse& 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("UI.AddSubMenuResponse"); - - return json; -} - - -bool AddSubMenuResponseMarshaller::fromJSON(const Json::Value& json,AddSubMenuResponse& 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("UI.AddSubMenuResponse")) 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/UI/AddSubMenuResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponseMarshaller.h deleted file mode 100644 index 40f5d2e1b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AddSubMenuResponseMarshaller.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_UI_ADDSUBMENURESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ADDSUBMENURESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AddSubMenuResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AddSubMenuResponseMarshaller - { - static bool checkIntegrity(AddSubMenuResponse& e); - static bool checkIntegrityConst(const AddSubMenuResponse& e); - - static bool fromString(const std::string& s,AddSubMenuResponse& e); - static const std::string toString(const AddSubMenuResponse& e); - - static bool fromJSON(const Json::Value& s,AddSubMenuResponse& e); - static Json::Value toJSON(const AddSubMenuResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Alert.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Alert.cpp deleted file mode 100644 index 000ff4dec..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Alert.cpp +++ /dev/null @@ -1,239 +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/UI/Alert.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -Alert& Alert::operator =(const Alert& c) -{ - if(AlertText1) delete AlertText1; - AlertText1= c.AlertText1 ? new std::string(c.AlertText1[0]) : 0; - if(AlertText2) delete AlertText2; - AlertText2= c.AlertText2 ? new std::string(c.AlertText2[0]) : 0; - if(AlertText3) delete AlertText3; - AlertText3= c.AlertText3 ? new std::string(c.AlertText3[0]) : 0; - if(ttsChunks) delete ttsChunks; - ttsChunks= c.ttsChunks ? new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(c.ttsChunks[0]) : 0; - if(duration) delete duration; - duration= c.duration ? new unsigned int(c.duration[0]) : 0; - if(playTone) delete playTone; - playTone= c.playTone ? new bool(c.playTone[0]) : 0; - if(softButtons) delete softButtons; - softButtons= c.softButtons ? new std::vector<NsSmartDeviceLinkRPCV2::SoftButton>(c.softButtons[0]) : 0; - appId=c.appId; - return *this; -} - - -Alert::~Alert(void) -{ - if(AlertText1) delete AlertText1; - if(AlertText2) delete AlertText2; - if(AlertText3) delete AlertText3; - if(ttsChunks) delete ttsChunks; - if(duration) delete duration; - if(playTone) delete playTone; - if(softButtons) delete softButtons; -} - - -Alert::Alert(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERT), - AlertText1(0), - AlertText2(0), - AlertText3(0), - ttsChunks(0), - duration(0), - playTone(0), - softButtons(0) -{ -} - - -Alert::Alert(const Alert& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERT,c.getId()) -{ - *this=c; -} - - -const std::string* Alert::get_AlertText1(void) -{ - return AlertText1; -} - -bool Alert::set_AlertText1(const std::string& AlertText1_) -{ - if(AlertText1) delete AlertText1; - AlertText1=new std::string(AlertText1_); - return true; -} - -void Alert::reset_AlertText1(void) -{ - if(AlertText1) delete AlertText1; - AlertText1=0; -} - -const std::string* Alert::get_AlertText2(void) -{ - return AlertText2; -} - -bool Alert::set_AlertText2(const std::string& AlertText2_) -{ - if(AlertText2) delete AlertText2; - AlertText2=new std::string(AlertText2_); - return true; -} - -void Alert::reset_AlertText2(void) -{ - if(AlertText2) delete AlertText2; - AlertText2=0; -} - -const std::string* Alert::get_AlertText3(void) -{ - return AlertText3; -} - -bool Alert::set_AlertText3(const std::string& AlertText3_) -{ - if(AlertText3) delete AlertText3; - AlertText3=new std::string(AlertText3_); - return true; -} - -void Alert::reset_AlertText3(void) -{ - if(AlertText3) delete AlertText3; - AlertText3=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>* Alert::get_ttsChunks(void) -{ - return ttsChunks; -} - -bool Alert::set_ttsChunks(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& ttsChunks_) -{ - if(ttsChunks) delete ttsChunks; - ttsChunks=new std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>(ttsChunks_); - return true; -} - -void Alert::reset_ttsChunks(void) -{ - if(ttsChunks) delete ttsChunks; - ttsChunks=0; -} - -const unsigned int* Alert::get_duration(void) -{ - return duration; -} - -bool Alert::set_duration(const unsigned int& duration_) -{ - if(duration) delete duration; - duration=new unsigned int(duration_); - return true; -} - -void Alert::reset_duration(void) -{ - if(duration) delete duration; - duration=0; -} - -const bool* Alert::get_playTone(void) -{ - return playTone; -} - -bool Alert::set_playTone(const bool& playTone_) -{ - if(playTone) delete playTone; - playTone=new bool(playTone_); - return true; -} - -void Alert::reset_playTone(void) -{ - if(playTone) delete playTone; - playTone=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>* Alert::get_softButtons(void) -{ - return softButtons; -} - -bool Alert::set_softButtons(const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& softButtons_) -{ - if(softButtons) delete softButtons; - softButtons=new std::vector< NsSmartDeviceLinkRPCV2::SoftButton>(softButtons_); - return true; -} - -void Alert::reset_softButtons(void) -{ - if(softButtons) delete softButtons; - softButtons=0; -} - -int Alert::get_appId(void) -{ - return appId; -} - -bool Alert::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool Alert::checkIntegrity(void) -{ - return AlertMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuver.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuver.cpp deleted file mode 100644 index 834fdebd3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuver.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AlertManeuver.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -AlertManeuver& AlertManeuver::operator =(const AlertManeuver& c) -{ - ttsChunks=c.ttsChunks; - softButtons=c.softButtons; - appId=c.appId; - return *this; -} - - -AlertManeuver::~AlertManeuver(void) -{ -} - - -AlertManeuver::AlertManeuver(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERTMANEUVER) -{ -} - - -AlertManeuver::AlertManeuver(const AlertManeuver& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERTMANEUVER,c.getId()) -{ - *this=c; -} - - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& AlertManeuver::get_ttsChunks(void) -{ - return ttsChunks; -} - -bool AlertManeuver::set_ttsChunks(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& ttsChunks_) -{ - ttsChunks=ttsChunks_; - return true; -} - -const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& AlertManeuver::get_softButtons(void) -{ - return softButtons; -} - -bool AlertManeuver::set_softButtons(const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& softButtons_) -{ - softButtons=softButtons_; - return true; -} - -int AlertManeuver::get_appId(void) -{ - return appId; -} - -bool AlertManeuver::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool AlertManeuver::checkIntegrity(void) -{ - return AlertManeuverMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverMarshaller.cpp deleted file mode 100644 index 377012d59..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverMarshaller.cpp +++ /dev/null @@ -1,184 +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/UI/AlertManeuver.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/SoftButtonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AlertManeuverMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AlertManeuverMarshaller::checkIntegrity(AlertManeuver& s) -{ - return checkIntegrityConst(s); -} - - -bool AlertManeuverMarshaller::fromString(const std::string& s,AlertManeuver& 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 AlertManeuverMarshaller::toString(const AlertManeuver& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AlertManeuverMarshaller::checkIntegrityConst(const AlertManeuver& s) -{ - { - unsigned int i=s.ttsChunks.size(); - if(i<1) return false; - if(i>100) return false; - } - - { - unsigned int i=s.softButtons.size(); - if(i<0) return false; - if(i>3) return false; - } - - return true; -} - - -Json::Value AlertManeuverMarshaller::toJSON(const AlertManeuver& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.AlertManeuver"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - { - unsigned int i=e.ttsChunks.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.ttsChunks[i]); - - json["params"]["ttsChunks"]=j; - } - { - unsigned int i=e.softButtons.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::toJSON(e.softButtons[i]); - - json["params"]["softButtons"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool AlertManeuverMarshaller::fromJSON(const Json::Value& json,AlertManeuver& 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("UI.AlertManeuver")) 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("ttsChunks") || !js["ttsChunks"].isArray()) return false; - { - unsigned int i=js["ttsChunks"].size(); - if(i<1) return false; - if(i>100) return false; - c.ttsChunks.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::TTSChunk t; - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["ttsChunks"][i],t)) - return false; - c.ttsChunks[i]=t; - } - } - - if(!js.isMember("softButtons") || !js["softButtons"].isArray()) return false; - { - unsigned int i=js["softButtons"].size(); - if(i<0) return false; - if(i>3) return false; - c.softButtons.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::SoftButton t; - if(!NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::fromJSON(js["softButtons"][i],t)) - return false; - c.softButtons[i]=t; - } - } - - 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/UI/AlertManeuverMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverMarshaller.h deleted file mode 100644 index 79b357cbe..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverMarshaller.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_UI_ALERTMANEUVERMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ALERTMANEUVERMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AlertManeuver.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AlertManeuverMarshaller - { - static bool checkIntegrity(AlertManeuver& e); - static bool checkIntegrityConst(const AlertManeuver& e); - - static bool fromString(const std::string& s,AlertManeuver& e); - static const std::string toString(const AlertManeuver& e); - - static bool fromJSON(const Json::Value& s,AlertManeuver& e); - static Json::Value toJSON(const AlertManeuver& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponse.cpp deleted file mode 100644 index 98128676b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponse.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/UI/AlertManeuverResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -AlertManeuverResponse& AlertManeuverResponse::operator =(const AlertManeuverResponse& c) -{ - return *this; -} - - -AlertManeuverResponse::~AlertManeuverResponse(void) -{ -} - - -AlertManeuverResponse::AlertManeuverResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERTMANEUVERRESPONSE) -{ -} - - -AlertManeuverResponse::AlertManeuverResponse(const AlertManeuverResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERTMANEUVERRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool AlertManeuverResponse::checkIntegrity(void) -{ - return AlertManeuverResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponseMarshaller.cpp deleted file mode 100644 index c55f9122c..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponseMarshaller.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/UI/AlertManeuverResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AlertManeuverResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AlertManeuverResponseMarshaller::checkIntegrity(AlertManeuverResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool AlertManeuverResponseMarshaller::fromString(const std::string& s,AlertManeuverResponse& 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 AlertManeuverResponseMarshaller::toString(const AlertManeuverResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AlertManeuverResponseMarshaller::checkIntegrityConst(const AlertManeuverResponse& s) -{ - return true; -} - - -Json::Value AlertManeuverResponseMarshaller::toJSON(const AlertManeuverResponse& 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("UI.AlertManeuverResponse"); - - return json; -} - - -bool AlertManeuverResponseMarshaller::fromJSON(const Json::Value& json,AlertManeuverResponse& 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("UI.AlertManeuverResponse")) 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/UI/AlertManeuverResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponseMarshaller.h deleted file mode 100644 index 08c41d425..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertManeuverResponseMarshaller.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_UI_ALERTMANEUVERRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ALERTMANEUVERRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AlertManeuverResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AlertManeuverResponseMarshaller - { - static bool checkIntegrity(AlertManeuverResponse& e); - static bool checkIntegrityConst(const AlertManeuverResponse& e); - - static bool fromString(const std::string& s,AlertManeuverResponse& e); - static const std::string toString(const AlertManeuverResponse& e); - - static bool fromJSON(const Json::Value& s,AlertManeuverResponse& e); - static Json::Value toJSON(const AlertManeuverResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertMarshaller.cpp deleted file mode 100644 index ab2b1607e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertMarshaller.cpp +++ /dev/null @@ -1,264 +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/UI/Alert.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/SoftButtonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AlertMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AlertMarshaller::checkIntegrity(Alert& s) -{ - return checkIntegrityConst(s); -} - - -bool AlertMarshaller::fromString(const std::string& s,Alert& 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 AlertMarshaller::toString(const Alert& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AlertMarshaller::checkIntegrityConst(const Alert& s) -{ - if(s.AlertText1 && (s.AlertText1[0].length()>500)) return false; - - if(s.AlertText2 && (s.AlertText2[0].length()>500)) return false; - - if(s.AlertText3 && (s.AlertText3[0].length()>500)) return false; - - if(s.ttsChunks) - { - unsigned int i=s.ttsChunks[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.duration && (s.duration[0]<3000 || s.duration[0]>10000)) return false; - - if(s.softButtons) - { - unsigned int i=s.softButtons[0].size(); - if(i<0) return false; - if(i>4) return false; - } - - return true; -} - - -Json::Value AlertMarshaller::toJSON(const Alert& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.Alert"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - if(e.AlertText1) - json["params"]["AlertText1"]=Json::Value(e.AlertText1[0]);; - if(e.AlertText2) - json["params"]["AlertText2"]=Json::Value(e.AlertText2[0]);; - if(e.AlertText3) - json["params"]["AlertText3"]=Json::Value(e.AlertText3[0]);; - if(e.ttsChunks) - { - unsigned int i=e.ttsChunks[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.ttsChunks[0][i]); - - json["params"]["ttsChunks"]=j; - } - if(e.duration) - json["params"]["duration"]=Json::Value(e.duration[0]);; - if(e.playTone) - json["params"]["playTone"]=Json::Value(e.playTone[0]);; - if(e.softButtons) - { - unsigned int i=e.softButtons[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::toJSON(e.softButtons[0][i]); - - json["params"]["softButtons"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool AlertMarshaller::fromJSON(const Json::Value& json,Alert& 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("UI.Alert")) 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(c.AlertText1) delete c.AlertText1; - c.AlertText1=0; - if(js.isMember("AlertText1")) - { - if(!js["AlertText1"].isString()) return false; - c.AlertText1=new std::string(); - c.AlertText1[0]=js["AlertText1"].asString(); - if(c.AlertText1[0].length()>500) return false; - - } - - if(c.AlertText2) delete c.AlertText2; - c.AlertText2=0; - if(js.isMember("AlertText2")) - { - if(!js["AlertText2"].isString()) return false; - c.AlertText2=new std::string(); - c.AlertText2[0]=js["AlertText2"].asString(); - if(c.AlertText2[0].length()>500) return false; - - } - - if(c.AlertText3) delete c.AlertText3; - c.AlertText3=0; - if(js.isMember("AlertText3")) - { - if(!js["AlertText3"].isString()) return false; - c.AlertText3=new std::string(); - c.AlertText3[0]=js["AlertText3"].asString(); - if(c.AlertText3[0].length()>500) return false; - - } - - if(c.ttsChunks) delete c.ttsChunks; - c.ttsChunks=0; - if(js.isMember("ttsChunks")) - { - if(!js["ttsChunks"].isArray()) return false; - unsigned int i=js["ttsChunks"].size(); - if(i<1) return false; - if(i>100) return false; - - c.ttsChunks=new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(); - c.ttsChunks->resize(js["ttsChunks"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["ttsChunks"][i],c.ttsChunks[0][i])) return false; - } - - - if(c.duration) delete c.duration; - c.duration=0; - if(js.isMember("duration")) - { - if(!js["duration"].isInt()) return false; - c.duration=new unsigned int(); - c.duration[0]=js["duration"].asInt(); - if(c.duration[0]<3000 || c.duration[0]>10000) return false; - - } - - if(c.playTone) delete c.playTone; - c.playTone=0; - if(js.isMember("playTone")) - { - if(!js["playTone"].isBool()) return false; - c.playTone=new bool(); - c.playTone[0]=js["playTone"].asBool(); - - } - - if(c.softButtons) delete c.softButtons; - c.softButtons=0; - if(js.isMember("softButtons")) - { - if(!js["softButtons"].isArray()) return false; - unsigned int i=js["softButtons"].size(); - if(i<0) return false; - if(i>4) return false; - - c.softButtons=new std::vector<NsSmartDeviceLinkRPCV2::SoftButton>(); - c.softButtons->resize(js["softButtons"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::fromJSON(js["softButtons"][i],c.softButtons[0][i])) 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/UI/AlertMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertMarshaller.h deleted file mode 100644 index bc88d7eb6..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertMarshaller.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_UI_ALERTMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ALERTMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/Alert.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AlertMarshaller - { - static bool checkIntegrity(Alert& e); - static bool checkIntegrityConst(const Alert& e); - - static bool fromString(const std::string& s,Alert& e); - static const std::string toString(const Alert& e); - - static bool fromJSON(const Json::Value& s,Alert& e); - static Json::Value toJSON(const Alert& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponse.cpp deleted file mode 100644 index 212651c2a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponse.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AlertResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -AlertResponse& AlertResponse::operator =(const AlertResponse& c) -{ - if(tryAgainTime) delete tryAgainTime; - tryAgainTime= c.tryAgainTime ? new unsigned int(c.tryAgainTime[0]) : 0; - return *this; -} - - -AlertResponse::~AlertResponse(void) -{ - if(tryAgainTime) delete tryAgainTime; -} - - -AlertResponse::AlertResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERTRESPONSE), - tryAgainTime(0) -{ -} - - -AlertResponse::AlertResponse(const AlertResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ALERTRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -const unsigned int* AlertResponse::get_tryAgainTime(void) -{ - return tryAgainTime; -} - -bool AlertResponse::set_tryAgainTime(const unsigned int& tryAgainTime_) -{ - if(tryAgainTime) delete tryAgainTime; - tryAgainTime=new unsigned int(tryAgainTime_); - return true; -} - -void AlertResponse::reset_tryAgainTime(void) -{ - if(tryAgainTime) delete tryAgainTime; - tryAgainTime=0; -} - -bool AlertResponse::checkIntegrity(void) -{ - return AlertResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponseMarshaller.cpp deleted file mode 100644 index 82e6454bc..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponseMarshaller.cpp +++ /dev/null @@ -1,142 +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/UI/AlertResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/AlertResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool AlertResponseMarshaller::checkIntegrity(AlertResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool AlertResponseMarshaller::fromString(const std::string& s,AlertResponse& 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 AlertResponseMarshaller::toString(const AlertResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool AlertResponseMarshaller::checkIntegrityConst(const AlertResponse& s) -{ - if(s.tryAgainTime && (s.tryAgainTime[0]>2000000000)) return false; - - return true; -} - - -Json::Value AlertResponseMarshaller::toJSON(const AlertResponse& 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("UI.AlertResponse"); - - if(e.tryAgainTime) - json["result"]["tryAgainTime"]=Json::Value(e.tryAgainTime[0]);; - return json; -} - - -bool AlertResponseMarshaller::fromJSON(const Json::Value& json,AlertResponse& 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("UI.AlertResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(c.tryAgainTime) delete c.tryAgainTime; - c.tryAgainTime=0; - if(js.isMember("tryAgainTime")) - { - if(!js["tryAgainTime"].isInt()) return false; - c.tryAgainTime=new unsigned int(); - c.tryAgainTime[0]=js["tryAgainTime"].asInt(); - if(c.tryAgainTime[0]>2000000000) return false; - - } - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponseMarshaller.h deleted file mode 100644 index b8675ff0f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/AlertResponseMarshaller.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_UI_ALERTRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ALERTRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/AlertResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct AlertResponseMarshaller - { - static bool checkIntegrity(AlertResponse& e); - static bool checkIntegrityConst(const AlertResponse& e); - - static bool fromString(const std::string& s,AlertResponse& e); - static const std::string toString(const AlertResponse& e); - - static bool fromJSON(const Json::Value& s,AlertResponse& e); - static Json::Value toJSON(const AlertResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistration.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistration.cpp deleted file mode 100644 index e388d44bb..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistration.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/UI/ChangeRegistration.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ChangeRegistration& ChangeRegistration::operator =(const ChangeRegistration& c) -{ - hmiDisplayLanguage=c.hmiDisplayLanguage; - appId=c.appId; - return *this; -} - - -ChangeRegistration::~ChangeRegistration(void) -{ -} - - -ChangeRegistration::ChangeRegistration(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CHANGEREGISTRATION) -{ -} - - -ChangeRegistration::ChangeRegistration(const ChangeRegistration& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CHANGEREGISTRATION,c.getId()) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::Language& ChangeRegistration::get_hmiDisplayLanguage(void) -{ - return hmiDisplayLanguage; -} - -bool ChangeRegistration::set_hmiDisplayLanguage(const NsSmartDeviceLinkRPCV2::Language& hmiDisplayLanguage_) -{ - hmiDisplayLanguage=hmiDisplayLanguage_; - return true; -} - -int ChangeRegistration::get_appId(void) -{ - return appId; -} - -bool ChangeRegistration::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool ChangeRegistration::checkIntegrity(void) -{ - return ChangeRegistrationMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationMarshaller.cpp deleted file mode 100644 index bd918ce48..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationMarshaller.cpp +++ /dev/null @@ -1,128 +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/UI/ChangeRegistration.h" -#include "../src/SDLRPCObjectsImpl/V2/LanguageMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ChangeRegistrationMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ChangeRegistrationMarshaller::checkIntegrity(ChangeRegistration& s) -{ - return checkIntegrityConst(s); -} - - -bool ChangeRegistrationMarshaller::fromString(const std::string& s,ChangeRegistration& 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 ChangeRegistrationMarshaller::toString(const ChangeRegistration& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ChangeRegistrationMarshaller::checkIntegrityConst(const ChangeRegistration& s) -{ - if(!NsSmartDeviceLinkRPCV2::LanguageMarshaller::checkIntegrityConst(s.hmiDisplayLanguage)) return false; - - return true; -} - - -Json::Value ChangeRegistrationMarshaller::toJSON(const ChangeRegistration& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.ChangeRegistration"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["hmiDisplayLanguage"]=NsSmartDeviceLinkRPCV2::LanguageMarshaller::toJSON(e.hmiDisplayLanguage);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool ChangeRegistrationMarshaller::fromJSON(const Json::Value& json,ChangeRegistration& 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("UI.ChangeRegistration")) 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("hmiDisplayLanguage") || !NsSmartDeviceLinkRPCV2::LanguageMarshaller::fromJSON(js["hmiDisplayLanguage"],c.hmiDisplayLanguage)) 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/UI/ChangeRegistrationMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationMarshaller.h deleted file mode 100644 index 56bb52b0c..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationMarshaller.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_UI_CHANGEREGISTRATIONMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_CHANGEREGISTRATIONMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ChangeRegistration.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ChangeRegistrationMarshaller - { - static bool checkIntegrity(ChangeRegistration& e); - static bool checkIntegrityConst(const ChangeRegistration& e); - - static bool fromString(const std::string& s,ChangeRegistration& e); - static const std::string toString(const ChangeRegistration& e); - - static bool fromJSON(const Json::Value& s,ChangeRegistration& e); - static Json::Value toJSON(const ChangeRegistration& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponse.cpp deleted file mode 100644 index ba7203fc3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponse.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/UI/ChangeRegistrationResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ChangeRegistrationResponse& ChangeRegistrationResponse::operator =(const ChangeRegistrationResponse& c) -{ - return *this; -} - - -ChangeRegistrationResponse::~ChangeRegistrationResponse(void) -{ -} - - -ChangeRegistrationResponse::ChangeRegistrationResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CHANGEREGISTRATIONRESPONSE) -{ -} - - -ChangeRegistrationResponse::ChangeRegistrationResponse(const ChangeRegistrationResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CHANGEREGISTRATIONRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool ChangeRegistrationResponse::checkIntegrity(void) -{ - return ChangeRegistrationResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponseMarshaller.cpp deleted file mode 100644 index 8f04e5d7d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponseMarshaller.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/UI/ChangeRegistrationResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ChangeRegistrationResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ChangeRegistrationResponseMarshaller::checkIntegrity(ChangeRegistrationResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool ChangeRegistrationResponseMarshaller::fromString(const std::string& s,ChangeRegistrationResponse& 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 ChangeRegistrationResponseMarshaller::toString(const ChangeRegistrationResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ChangeRegistrationResponseMarshaller::checkIntegrityConst(const ChangeRegistrationResponse& s) -{ - return true; -} - - -Json::Value ChangeRegistrationResponseMarshaller::toJSON(const ChangeRegistrationResponse& 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("UI.ChangeRegistrationResponse"); - - return json; -} - - -bool ChangeRegistrationResponseMarshaller::fromJSON(const Json::Value& json,ChangeRegistrationResponse& 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("UI.ChangeRegistrationResponse")) 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/UI/ChangeRegistrationResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponseMarshaller.h deleted file mode 100644 index f7848921d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ChangeRegistrationResponseMarshaller.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_UI_CHANGEREGISTRATIONRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_CHANGEREGISTRATIONRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ChangeRegistrationResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ChangeRegistrationResponseMarshaller - { - static bool checkIntegrity(ChangeRegistrationResponse& e); - static bool checkIntegrityConst(const ChangeRegistrationResponse& e); - - static bool fromString(const std::string& s,ChangeRegistrationResponse& e); - static const std::string toString(const ChangeRegistrationResponse& e); - - static bool fromJSON(const Json::Value& s,ChangeRegistrationResponse& e); - static Json::Value toJSON(const ChangeRegistrationResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSet.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSet.cpp deleted file mode 100644 index ca1b1ce4b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSet.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/CreateInteractionChoiceSet.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -CreateInteractionChoiceSet& CreateInteractionChoiceSet::operator =(const CreateInteractionChoiceSet& c) -{ - interactionChoiceSetID=c.interactionChoiceSetID; - choiceSet=c.choiceSet; - appId=c.appId; - return *this; -} - - -CreateInteractionChoiceSet::~CreateInteractionChoiceSet(void) -{ -} - - -CreateInteractionChoiceSet::CreateInteractionChoiceSet(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CREATEINTERACTIONCHOICESET) -{ -} - - -CreateInteractionChoiceSet::CreateInteractionChoiceSet(const CreateInteractionChoiceSet& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CREATEINTERACTIONCHOICESET,c.getId()) -{ - *this=c; -} - - -unsigned int CreateInteractionChoiceSet::get_interactionChoiceSetID(void) -{ - return interactionChoiceSetID; -} - -bool CreateInteractionChoiceSet::set_interactionChoiceSetID(unsigned int interactionChoiceSetID_) -{ - interactionChoiceSetID=interactionChoiceSetID_; - return true; -} - -const std::vector< NsSmartDeviceLinkRPCV2::Choice>& CreateInteractionChoiceSet::get_choiceSet(void) -{ - return choiceSet; -} - -bool CreateInteractionChoiceSet::set_choiceSet(const std::vector< NsSmartDeviceLinkRPCV2::Choice>& choiceSet_) -{ - choiceSet=choiceSet_; - return true; -} - -int CreateInteractionChoiceSet::get_appId(void) -{ - return appId; -} - -bool CreateInteractionChoiceSet::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool CreateInteractionChoiceSet::checkIntegrity(void) -{ - return CreateInteractionChoiceSetMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetMarshaller.cpp deleted file mode 100644 index 680b2785e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetMarshaller.cpp +++ /dev/null @@ -1,160 +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/UI/CreateInteractionChoiceSet.h" -#include "../src/SDLRPCObjectsImpl/V2/ChoiceMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/CreateInteractionChoiceSetMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool CreateInteractionChoiceSetMarshaller::checkIntegrity(CreateInteractionChoiceSet& s) -{ - return checkIntegrityConst(s); -} - - -bool CreateInteractionChoiceSetMarshaller::fromString(const std::string& s,CreateInteractionChoiceSet& 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 CreateInteractionChoiceSetMarshaller::toString(const CreateInteractionChoiceSet& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool CreateInteractionChoiceSetMarshaller::checkIntegrityConst(const CreateInteractionChoiceSet& s) -{ - if(s.interactionChoiceSetID>2000000000) return false; - - { - unsigned int i=s.choiceSet.size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value CreateInteractionChoiceSetMarshaller::toJSON(const CreateInteractionChoiceSet& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.CreateInteractionChoiceSet"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["interactionChoiceSetID"]=Json::Value(e.interactionChoiceSetID);; - { - unsigned int i=e.choiceSet.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::ChoiceMarshaller::toJSON(e.choiceSet[i]); - - json["params"]["choiceSet"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool CreateInteractionChoiceSetMarshaller::fromJSON(const Json::Value& json,CreateInteractionChoiceSet& 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("UI.CreateInteractionChoiceSet")) 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("interactionChoiceSetID") || !js["interactionChoiceSetID"].isInt()) return false; - c.interactionChoiceSetID=js["interactionChoiceSetID"].asInt(); - if(c.interactionChoiceSetID>2000000000) return false; - - if(!js.isMember("choiceSet") || !js["choiceSet"].isArray()) return false; - { - unsigned int i=js["choiceSet"].size(); - if(i<1) return false; - if(i>100) return false; - c.choiceSet.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::Choice t; - if(!NsSmartDeviceLinkRPCV2::ChoiceMarshaller::fromJSON(js["choiceSet"][i],t)) - return false; - c.choiceSet[i]=t; - } - } - - 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/UI/CreateInteractionChoiceSetMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetMarshaller.h deleted file mode 100644 index d087969d2..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetMarshaller.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_UI_CREATEINTERACTIONCHOICESETMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_CREATEINTERACTIONCHOICESETMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/CreateInteractionChoiceSet.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct CreateInteractionChoiceSetMarshaller - { - static bool checkIntegrity(CreateInteractionChoiceSet& e); - static bool checkIntegrityConst(const CreateInteractionChoiceSet& e); - - static bool fromString(const std::string& s,CreateInteractionChoiceSet& e); - static const std::string toString(const CreateInteractionChoiceSet& e); - - static bool fromJSON(const Json::Value& s,CreateInteractionChoiceSet& e); - static Json::Value toJSON(const CreateInteractionChoiceSet& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponse.cpp deleted file mode 100644 index 282b3bdc5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponse.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/UI/CreateInteractionChoiceSetResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -CreateInteractionChoiceSetResponse& CreateInteractionChoiceSetResponse::operator =(const CreateInteractionChoiceSetResponse& c) -{ - return *this; -} - - -CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse(void) -{ -} - - -CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CREATEINTERACTIONCHOICESETRESPONSE) -{ -} - - -CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse(const CreateInteractionChoiceSetResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__CREATEINTERACTIONCHOICESETRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool CreateInteractionChoiceSetResponse::checkIntegrity(void) -{ - return CreateInteractionChoiceSetResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponseMarshaller.cpp deleted file mode 100644 index 84f492f9f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponseMarshaller.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/UI/CreateInteractionChoiceSetResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/CreateInteractionChoiceSetResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool CreateInteractionChoiceSetResponseMarshaller::checkIntegrity(CreateInteractionChoiceSetResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool CreateInteractionChoiceSetResponseMarshaller::fromString(const std::string& s,CreateInteractionChoiceSetResponse& 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 CreateInteractionChoiceSetResponseMarshaller::toString(const CreateInteractionChoiceSetResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool CreateInteractionChoiceSetResponseMarshaller::checkIntegrityConst(const CreateInteractionChoiceSetResponse& s) -{ - return true; -} - - -Json::Value CreateInteractionChoiceSetResponseMarshaller::toJSON(const CreateInteractionChoiceSetResponse& 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("UI.CreateInteractionChoiceSetResponse"); - - return json; -} - - -bool CreateInteractionChoiceSetResponseMarshaller::fromJSON(const Json::Value& json,CreateInteractionChoiceSetResponse& 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("UI.CreateInteractionChoiceSetResponse")) 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/UI/CreateInteractionChoiceSetResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponseMarshaller.h deleted file mode 100644 index 33348682d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/CreateInteractionChoiceSetResponseMarshaller.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_UI_CREATEINTERACTIONCHOICESETRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_CREATEINTERACTIONCHOICESETRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/CreateInteractionChoiceSetResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct CreateInteractionChoiceSetResponseMarshaller - { - static bool checkIntegrity(CreateInteractionChoiceSetResponse& e); - static bool checkIntegrityConst(const CreateInteractionChoiceSetResponse& e); - - static bool fromString(const std::string& s,CreateInteractionChoiceSetResponse& e); - static const std::string toString(const CreateInteractionChoiceSetResponse& e); - - static bool fromJSON(const Json::Value& s,CreateInteractionChoiceSetResponse& e); - static Json::Value toJSON(const CreateInteractionChoiceSetResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommand.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommand.cpp deleted file mode 100644 index 54eab8d85..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommand.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/UI/DeleteCommand.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DeleteCommand& DeleteCommand::operator =(const DeleteCommand& c) -{ - cmdId=c.cmdId; - appId=c.appId; - return *this; -} - - -DeleteCommand::~DeleteCommand(void) -{ -} - - -DeleteCommand::DeleteCommand(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETECOMMAND) -{ -} - - -DeleteCommand::DeleteCommand(const DeleteCommand& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETECOMMAND,c.getId()) -{ - *this=c; -} - - -unsigned int DeleteCommand::get_cmdId(void) -{ - return cmdId; -} - -bool DeleteCommand::set_cmdId(unsigned int cmdId_) -{ - cmdId=cmdId_; - return true; -} - -int DeleteCommand::get_appId(void) -{ - return appId; -} - -bool DeleteCommand::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool DeleteCommand::checkIntegrity(void) -{ - return DeleteCommandMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandMarshaller.cpp deleted file mode 100644 index 5ea174123..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandMarshaller.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteCommand.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DeleteCommandMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DeleteCommandMarshaller::checkIntegrity(DeleteCommand& s) -{ - return checkIntegrityConst(s); -} - - -bool DeleteCommandMarshaller::fromString(const std::string& s,DeleteCommand& 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 DeleteCommandMarshaller::toString(const DeleteCommand& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DeleteCommandMarshaller::checkIntegrityConst(const DeleteCommand& s) -{ - if(s.cmdId>2000000000) return false; - - return true; -} - - -Json::Value DeleteCommandMarshaller::toJSON(const DeleteCommand& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.DeleteCommand"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["cmdId"]=Json::Value(e.cmdId);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool DeleteCommandMarshaller::fromJSON(const Json::Value& json,DeleteCommand& 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("UI.DeleteCommand")) 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("cmdId") || !js["cmdId"].isInt()) return false; - c.cmdId=js["cmdId"].asInt(); - if(c.cmdId>2000000000) 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/UI/DeleteCommandMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandMarshaller.h deleted file mode 100644 index 7ce55f67f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandMarshaller.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_UI_DELETECOMMANDMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DELETECOMMANDMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteCommand.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DeleteCommandMarshaller - { - static bool checkIntegrity(DeleteCommand& e); - static bool checkIntegrityConst(const DeleteCommand& e); - - static bool fromString(const std::string& s,DeleteCommand& e); - static const std::string toString(const DeleteCommand& e); - - static bool fromJSON(const Json::Value& s,DeleteCommand& e); - static Json::Value toJSON(const DeleteCommand& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponse.cpp deleted file mode 100644 index e1dff2f5e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponse.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/UI/DeleteCommandResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DeleteCommandResponse& DeleteCommandResponse::operator =(const DeleteCommandResponse& c) -{ - return *this; -} - - -DeleteCommandResponse::~DeleteCommandResponse(void) -{ -} - - -DeleteCommandResponse::DeleteCommandResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETECOMMANDRESPONSE) -{ -} - - -DeleteCommandResponse::DeleteCommandResponse(const DeleteCommandResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETECOMMANDRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool DeleteCommandResponse::checkIntegrity(void) -{ - return DeleteCommandResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponseMarshaller.cpp deleted file mode 100644 index a1c4962c9..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponseMarshaller.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/UI/DeleteCommandResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DeleteCommandResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DeleteCommandResponseMarshaller::checkIntegrity(DeleteCommandResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool DeleteCommandResponseMarshaller::fromString(const std::string& s,DeleteCommandResponse& 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 DeleteCommandResponseMarshaller::toString(const DeleteCommandResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DeleteCommandResponseMarshaller::checkIntegrityConst(const DeleteCommandResponse& s) -{ - return true; -} - - -Json::Value DeleteCommandResponseMarshaller::toJSON(const DeleteCommandResponse& 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("UI.DeleteCommandResponse"); - - return json; -} - - -bool DeleteCommandResponseMarshaller::fromJSON(const Json::Value& json,DeleteCommandResponse& 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("UI.DeleteCommandResponse")) 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/UI/DeleteCommandResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponseMarshaller.h deleted file mode 100644 index 5555926d7..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteCommandResponseMarshaller.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_UI_DELETECOMMANDRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DELETECOMMANDRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteCommandResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DeleteCommandResponseMarshaller - { - static bool checkIntegrity(DeleteCommandResponse& e); - static bool checkIntegrityConst(const DeleteCommandResponse& e); - - static bool fromString(const std::string& s,DeleteCommandResponse& e); - static const std::string toString(const DeleteCommandResponse& e); - - static bool fromJSON(const Json::Value& s,DeleteCommandResponse& e); - static Json::Value toJSON(const DeleteCommandResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSet.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSet.cpp deleted file mode 100644 index fb0659300..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSet.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/UI/DeleteInteractionChoiceSet.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DeleteInteractionChoiceSet& DeleteInteractionChoiceSet::operator =(const DeleteInteractionChoiceSet& c) -{ - interactionChoiceSetID=c.interactionChoiceSetID; - appId=c.appId; - return *this; -} - - -DeleteInteractionChoiceSet::~DeleteInteractionChoiceSet(void) -{ -} - - -DeleteInteractionChoiceSet::DeleteInteractionChoiceSet(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETEINTERACTIONCHOICESET) -{ -} - - -DeleteInteractionChoiceSet::DeleteInteractionChoiceSet(const DeleteInteractionChoiceSet& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETEINTERACTIONCHOICESET,c.getId()) -{ - *this=c; -} - - -unsigned int DeleteInteractionChoiceSet::get_interactionChoiceSetID(void) -{ - return interactionChoiceSetID; -} - -bool DeleteInteractionChoiceSet::set_interactionChoiceSetID(unsigned int interactionChoiceSetID_) -{ - interactionChoiceSetID=interactionChoiceSetID_; - return true; -} - -int DeleteInteractionChoiceSet::get_appId(void) -{ - return appId; -} - -bool DeleteInteractionChoiceSet::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool DeleteInteractionChoiceSet::checkIntegrity(void) -{ - return DeleteInteractionChoiceSetMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetMarshaller.cpp deleted file mode 100644 index 02beef484..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetMarshaller.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteInteractionChoiceSet.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DeleteInteractionChoiceSetMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DeleteInteractionChoiceSetMarshaller::checkIntegrity(DeleteInteractionChoiceSet& s) -{ - return checkIntegrityConst(s); -} - - -bool DeleteInteractionChoiceSetMarshaller::fromString(const std::string& s,DeleteInteractionChoiceSet& 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 DeleteInteractionChoiceSetMarshaller::toString(const DeleteInteractionChoiceSet& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DeleteInteractionChoiceSetMarshaller::checkIntegrityConst(const DeleteInteractionChoiceSet& s) -{ - if(s.interactionChoiceSetID>2000000000) return false; - - return true; -} - - -Json::Value DeleteInteractionChoiceSetMarshaller::toJSON(const DeleteInteractionChoiceSet& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.DeleteInteractionChoiceSet"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["interactionChoiceSetID"]=Json::Value(e.interactionChoiceSetID);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool DeleteInteractionChoiceSetMarshaller::fromJSON(const Json::Value& json,DeleteInteractionChoiceSet& 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("UI.DeleteInteractionChoiceSet")) 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("interactionChoiceSetID") || !js["interactionChoiceSetID"].isInt()) return false; - c.interactionChoiceSetID=js["interactionChoiceSetID"].asInt(); - if(c.interactionChoiceSetID>2000000000) 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/UI/DeleteInteractionChoiceSetMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetMarshaller.h deleted file mode 100644 index 79c27127b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetMarshaller.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_UI_DELETEINTERACTIONCHOICESETMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DELETEINTERACTIONCHOICESETMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteInteractionChoiceSet.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DeleteInteractionChoiceSetMarshaller - { - static bool checkIntegrity(DeleteInteractionChoiceSet& e); - static bool checkIntegrityConst(const DeleteInteractionChoiceSet& e); - - static bool fromString(const std::string& s,DeleteInteractionChoiceSet& e); - static const std::string toString(const DeleteInteractionChoiceSet& e); - - static bool fromJSON(const Json::Value& s,DeleteInteractionChoiceSet& e); - static Json::Value toJSON(const DeleteInteractionChoiceSet& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponse.cpp deleted file mode 100644 index d5d3d6b16..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponse.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/UI/DeleteInteractionChoiceSetResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DeleteInteractionChoiceSetResponse& DeleteInteractionChoiceSetResponse::operator =(const DeleteInteractionChoiceSetResponse& c) -{ - return *this; -} - - -DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse(void) -{ -} - - -DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETEINTERACTIONCHOICESETRESPONSE) -{ -} - - -DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse(const DeleteInteractionChoiceSetResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETEINTERACTIONCHOICESETRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool DeleteInteractionChoiceSetResponse::checkIntegrity(void) -{ - return DeleteInteractionChoiceSetResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponseMarshaller.cpp deleted file mode 100644 index 568cfe8fd..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponseMarshaller.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/UI/DeleteInteractionChoiceSetResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DeleteInteractionChoiceSetResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DeleteInteractionChoiceSetResponseMarshaller::checkIntegrity(DeleteInteractionChoiceSetResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool DeleteInteractionChoiceSetResponseMarshaller::fromString(const std::string& s,DeleteInteractionChoiceSetResponse& 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 DeleteInteractionChoiceSetResponseMarshaller::toString(const DeleteInteractionChoiceSetResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DeleteInteractionChoiceSetResponseMarshaller::checkIntegrityConst(const DeleteInteractionChoiceSetResponse& s) -{ - return true; -} - - -Json::Value DeleteInteractionChoiceSetResponseMarshaller::toJSON(const DeleteInteractionChoiceSetResponse& 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("UI.DeleteInteractionChoiceSetResponse"); - - return json; -} - - -bool DeleteInteractionChoiceSetResponseMarshaller::fromJSON(const Json::Value& json,DeleteInteractionChoiceSetResponse& 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("UI.DeleteInteractionChoiceSetResponse")) 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/UI/DeleteInteractionChoiceSetResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponseMarshaller.h deleted file mode 100644 index 2cf4fca55..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponseMarshaller.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_UI_DELETEINTERACTIONCHOICESETRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DELETEINTERACTIONCHOICESETRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteInteractionChoiceSetResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DeleteInteractionChoiceSetResponseMarshaller - { - static bool checkIntegrity(DeleteInteractionChoiceSetResponse& e); - static bool checkIntegrityConst(const DeleteInteractionChoiceSetResponse& e); - - static bool fromString(const std::string& s,DeleteInteractionChoiceSetResponse& e); - static const std::string toString(const DeleteInteractionChoiceSetResponse& e); - - static bool fromJSON(const Json::Value& s,DeleteInteractionChoiceSetResponse& e); - static Json::Value toJSON(const DeleteInteractionChoiceSetResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenu.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenu.cpp deleted file mode 100644 index 99f1bb0c3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenu.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/UI/DeleteSubMenu.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DeleteSubMenu& DeleteSubMenu::operator =(const DeleteSubMenu& c) -{ - menuId=c.menuId; - appId=c.appId; - return *this; -} - - -DeleteSubMenu::~DeleteSubMenu(void) -{ -} - - -DeleteSubMenu::DeleteSubMenu(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETESUBMENU) -{ -} - - -DeleteSubMenu::DeleteSubMenu(const DeleteSubMenu& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETESUBMENU,c.getId()) -{ - *this=c; -} - - -unsigned int DeleteSubMenu::get_menuId(void) -{ - return menuId; -} - -bool DeleteSubMenu::set_menuId(unsigned int menuId_) -{ - menuId=menuId_; - return true; -} - -int DeleteSubMenu::get_appId(void) -{ - return appId; -} - -bool DeleteSubMenu::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool DeleteSubMenu::checkIntegrity(void) -{ - return DeleteSubMenuMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuMarshaller.cpp deleted file mode 100644 index 564d0902e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuMarshaller.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteSubMenu.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DeleteSubMenuMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DeleteSubMenuMarshaller::checkIntegrity(DeleteSubMenu& s) -{ - return checkIntegrityConst(s); -} - - -bool DeleteSubMenuMarshaller::fromString(const std::string& s,DeleteSubMenu& 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 DeleteSubMenuMarshaller::toString(const DeleteSubMenu& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DeleteSubMenuMarshaller::checkIntegrityConst(const DeleteSubMenu& s) -{ - if(s.menuId>2000000000) return false; - - return true; -} - - -Json::Value DeleteSubMenuMarshaller::toJSON(const DeleteSubMenu& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.DeleteSubMenu"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["menuId"]=Json::Value(e.menuId);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool DeleteSubMenuMarshaller::fromJSON(const Json::Value& json,DeleteSubMenu& 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("UI.DeleteSubMenu")) 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("menuId") || !js["menuId"].isInt()) return false; - c.menuId=js["menuId"].asInt(); - if(c.menuId>2000000000) 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/UI/DeleteSubMenuMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuMarshaller.h deleted file mode 100644 index 348720175..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuMarshaller.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_UI_DELETESUBMENUMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DELETESUBMENUMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteSubMenu.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DeleteSubMenuMarshaller - { - static bool checkIntegrity(DeleteSubMenu& e); - static bool checkIntegrityConst(const DeleteSubMenu& e); - - static bool fromString(const std::string& s,DeleteSubMenu& e); - static const std::string toString(const DeleteSubMenu& e); - - static bool fromJSON(const Json::Value& s,DeleteSubMenu& e); - static Json::Value toJSON(const DeleteSubMenu& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponse.cpp deleted file mode 100644 index 818e52032..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponse.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/UI/DeleteSubMenuResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DeleteSubMenuResponse& DeleteSubMenuResponse::operator =(const DeleteSubMenuResponse& c) -{ - return *this; -} - - -DeleteSubMenuResponse::~DeleteSubMenuResponse(void) -{ -} - - -DeleteSubMenuResponse::DeleteSubMenuResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETESUBMENURESPONSE) -{ -} - - -DeleteSubMenuResponse::DeleteSubMenuResponse(const DeleteSubMenuResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DELETESUBMENURESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool DeleteSubMenuResponse::checkIntegrity(void) -{ - return DeleteSubMenuResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponseMarshaller.cpp deleted file mode 100644 index acc82de87..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponseMarshaller.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/UI/DeleteSubMenuResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DeleteSubMenuResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DeleteSubMenuResponseMarshaller::checkIntegrity(DeleteSubMenuResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool DeleteSubMenuResponseMarshaller::fromString(const std::string& s,DeleteSubMenuResponse& 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 DeleteSubMenuResponseMarshaller::toString(const DeleteSubMenuResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DeleteSubMenuResponseMarshaller::checkIntegrityConst(const DeleteSubMenuResponse& s) -{ - return true; -} - - -Json::Value DeleteSubMenuResponseMarshaller::toJSON(const DeleteSubMenuResponse& 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("UI.DeleteSubMenuResponse"); - - return json; -} - - -bool DeleteSubMenuResponseMarshaller::fromJSON(const Json::Value& json,DeleteSubMenuResponse& 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("UI.DeleteSubMenuResponse")) 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/UI/DeleteSubMenuResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponseMarshaller.h deleted file mode 100644 index 52ea48acb..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DeleteSubMenuResponseMarshaller.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_UI_DELETESUBMENURESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DELETESUBMENURESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DeleteSubMenuResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DeleteSubMenuResponseMarshaller - { - static bool checkIntegrity(DeleteSubMenuResponse& e); - static bool checkIntegrityConst(const DeleteSubMenuResponse& e); - - static bool fromString(const std::string& s,DeleteSubMenuResponse& e); - static const std::string toString(const DeleteSubMenuResponse& e); - - static bool fromJSON(const Json::Value& s,DeleteSubMenuResponse& e); - static Json::Value toJSON(const DeleteSubMenuResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumber.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumber.cpp deleted file mode 100644 index a897f23d0..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumber.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/UI/DialNumber.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DialNumber& DialNumber::operator =(const DialNumber& c) -{ - number=c.number; - appId=c.appId; - return *this; -} - - -DialNumber::~DialNumber(void) -{ -} - - -DialNumber::DialNumber(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DIALNUMBER) -{ -} - - -DialNumber::DialNumber(const DialNumber& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DIALNUMBER,c.getId()) -{ - *this=c; -} - - -const std::string& DialNumber::get_number(void) -{ - return number; -} - -bool DialNumber::set_number(const std::string& number_) -{ - number=number_; - return true; -} - -int DialNumber::get_appId(void) -{ - return appId; -} - -bool DialNumber::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool DialNumber::checkIntegrity(void) -{ - return DialNumberMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberMarshaller.cpp deleted file mode 100644 index 409658320..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberMarshaller.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DialNumber.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DialNumberMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DialNumberMarshaller::checkIntegrity(DialNumber& s) -{ - return checkIntegrityConst(s); -} - - -bool DialNumberMarshaller::fromString(const std::string& s,DialNumber& 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 DialNumberMarshaller::toString(const DialNumber& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DialNumberMarshaller::checkIntegrityConst(const DialNumber& s) -{ - if(s.number.length()>500) return false; - - return true; -} - - -Json::Value DialNumberMarshaller::toJSON(const DialNumber& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.DialNumber"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["number"]=Json::Value(e.number);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool DialNumberMarshaller::fromJSON(const Json::Value& json,DialNumber& 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("UI.DialNumber")) 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("number") || !js["number"].isString()) return false; - c.number=js["number"].asString(); - if(c.number.length()>500) 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/UI/DialNumberMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberMarshaller.h deleted file mode 100644 index 58ae4033b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberMarshaller.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_UI_DIALNUMBERMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DIALNUMBERMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DialNumber.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DialNumberMarshaller - { - static bool checkIntegrity(DialNumber& e); - static bool checkIntegrityConst(const DialNumber& e); - - static bool fromString(const std::string& s,DialNumber& e); - static const std::string toString(const DialNumber& e); - - static bool fromJSON(const Json::Value& s,DialNumber& e); - static Json::Value toJSON(const DialNumber& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponse.cpp deleted file mode 100644 index fe6963ce3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponse.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/UI/DialNumberResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -DialNumberResponse& DialNumberResponse::operator =(const DialNumberResponse& c) -{ - return *this; -} - - -DialNumberResponse::~DialNumberResponse(void) -{ -} - - -DialNumberResponse::DialNumberResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DIALNUMBERRESPONSE) -{ -} - - -DialNumberResponse::DialNumberResponse(const DialNumberResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__DIALNUMBERRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool DialNumberResponse::checkIntegrity(void) -{ - return DialNumberResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponseMarshaller.cpp deleted file mode 100644 index 062df7e7a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponseMarshaller.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/UI/DialNumberResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/DialNumberResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool DialNumberResponseMarshaller::checkIntegrity(DialNumberResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool DialNumberResponseMarshaller::fromString(const std::string& s,DialNumberResponse& 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 DialNumberResponseMarshaller::toString(const DialNumberResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool DialNumberResponseMarshaller::checkIntegrityConst(const DialNumberResponse& s) -{ - return true; -} - - -Json::Value DialNumberResponseMarshaller::toJSON(const DialNumberResponse& 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("UI.DialNumberResponse"); - - return json; -} - - -bool DialNumberResponseMarshaller::fromJSON(const Json::Value& json,DialNumberResponse& 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("UI.DialNumberResponse")) 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/UI/DialNumberResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponseMarshaller.h deleted file mode 100644 index df442bd4e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/DialNumberResponseMarshaller.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_UI_DIALNUMBERRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_DIALNUMBERRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/DialNumberResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct DialNumberResponseMarshaller - { - static bool checkIntegrity(DialNumberResponse& e); - static bool checkIntegrityConst(const DialNumberResponse& e); - - static bool fromString(const std::string& s,DialNumberResponse& e); - static const std::string toString(const DialNumberResponse& e); - - static bool fromJSON(const Json::Value& s,DialNumberResponse& e); - static Json::Value toJSON(const DialNumberResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThru.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThru.cpp deleted file mode 100644 index 6da0b38d5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThru.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/EndAudioPassThru.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -EndAudioPassThru& EndAudioPassThru::operator =(const EndAudioPassThru& c) -{ - appId=c.appId; - return *this; -} - - -EndAudioPassThru::~EndAudioPassThru(void) -{ -} - - -EndAudioPassThru::EndAudioPassThru(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ENDAUDIOPASSTHRU) -{ -} - - -EndAudioPassThru::EndAudioPassThru(const EndAudioPassThru& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ENDAUDIOPASSTHRU,c.getId()) -{ - *this=c; -} - - -int EndAudioPassThru::get_appId(void) -{ - return appId; -} - -bool EndAudioPassThru::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool EndAudioPassThru::checkIntegrity(void) -{ - return EndAudioPassThruMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruMarshaller.cpp deleted file mode 100644 index 23495dde7..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruMarshaller.cpp +++ /dev/null @@ -1,122 +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/UI/EndAudioPassThru.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/EndAudioPassThruMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool EndAudioPassThruMarshaller::checkIntegrity(EndAudioPassThru& s) -{ - return checkIntegrityConst(s); -} - - -bool EndAudioPassThruMarshaller::fromString(const std::string& s,EndAudioPassThru& 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 EndAudioPassThruMarshaller::toString(const EndAudioPassThru& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool EndAudioPassThruMarshaller::checkIntegrityConst(const EndAudioPassThru& s) -{ - return true; -} - - -Json::Value EndAudioPassThruMarshaller::toJSON(const EndAudioPassThru& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.EndAudioPassThru"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool EndAudioPassThruMarshaller::fromJSON(const Json::Value& json,EndAudioPassThru& 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("UI.EndAudioPassThru")) 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("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/UI/EndAudioPassThruMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruMarshaller.h deleted file mode 100644 index 5c1649272..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruMarshaller.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_UI_ENDAUDIOPASSTHRUMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ENDAUDIOPASSTHRUMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/EndAudioPassThru.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct EndAudioPassThruMarshaller - { - static bool checkIntegrity(EndAudioPassThru& e); - static bool checkIntegrityConst(const EndAudioPassThru& e); - - static bool fromString(const std::string& s,EndAudioPassThru& e); - static const std::string toString(const EndAudioPassThru& e); - - static bool fromJSON(const Json::Value& s,EndAudioPassThru& e); - static Json::Value toJSON(const EndAudioPassThru& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponse.cpp deleted file mode 100644 index 82d04ef74..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponse.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/UI/EndAudioPassThruResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -EndAudioPassThruResponse& EndAudioPassThruResponse::operator =(const EndAudioPassThruResponse& c) -{ - return *this; -} - - -EndAudioPassThruResponse::~EndAudioPassThruResponse(void) -{ -} - - -EndAudioPassThruResponse::EndAudioPassThruResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ENDAUDIOPASSTHRURESPONSE) -{ -} - - -EndAudioPassThruResponse::EndAudioPassThruResponse(const EndAudioPassThruResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ENDAUDIOPASSTHRURESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool EndAudioPassThruResponse::checkIntegrity(void) -{ - return EndAudioPassThruResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponseMarshaller.cpp deleted file mode 100644 index dd5399fc5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponseMarshaller.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/UI/EndAudioPassThruResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/EndAudioPassThruResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool EndAudioPassThruResponseMarshaller::checkIntegrity(EndAudioPassThruResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool EndAudioPassThruResponseMarshaller::fromString(const std::string& s,EndAudioPassThruResponse& 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 EndAudioPassThruResponseMarshaller::toString(const EndAudioPassThruResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool EndAudioPassThruResponseMarshaller::checkIntegrityConst(const EndAudioPassThruResponse& s) -{ - return true; -} - - -Json::Value EndAudioPassThruResponseMarshaller::toJSON(const EndAudioPassThruResponse& 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("UI.EndAudioPassThruResponse"); - - return json; -} - - -bool EndAudioPassThruResponseMarshaller::fromJSON(const Json::Value& json,EndAudioPassThruResponse& 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("UI.EndAudioPassThruResponse")) 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/UI/EndAudioPassThruResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponseMarshaller.h deleted file mode 100644 index f4990c054..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/EndAudioPassThruResponseMarshaller.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_UI_ENDAUDIOPASSTHRURESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ENDAUDIOPASSTHRURESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/EndAudioPassThruResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct EndAudioPassThruResponseMarshaller - { - static bool checkIntegrity(EndAudioPassThruResponse& e); - static bool checkIntegrityConst(const EndAudioPassThruResponse& e); - - static bool fromString(const std::string& s,EndAudioPassThruResponse& e); - static const std::string toString(const EndAudioPassThruResponse& e); - - static bool fromJSON(const Json::Value& s,EndAudioPassThruResponse& e); - static Json::Value toJSON(const EndAudioPassThruResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilities.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilities.cpp deleted file mode 100644 index ed2176a3a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilities.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/UI/GetCapabilities.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -GetCapabilities& GetCapabilities::operator =(const GetCapabilities& c) -{ - return *this; -} - - -GetCapabilities::~GetCapabilities(void) -{ -} - - -GetCapabilities::GetCapabilities(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETCAPABILITIES) -{ -} - - -GetCapabilities::GetCapabilities(const GetCapabilities& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETCAPABILITIES,c.getId()) -{ - *this=c; -} - - -bool GetCapabilities::checkIntegrity(void) -{ - return GetCapabilitiesMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesMarshaller.cpp deleted file mode 100644 index 9a19ca9c2..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesMarshaller.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/UI/GetCapabilities.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/GetCapabilitiesMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool GetCapabilitiesMarshaller::checkIntegrity(GetCapabilities& s) -{ - return checkIntegrityConst(s); -} - - -bool GetCapabilitiesMarshaller::fromString(const std::string& s,GetCapabilities& 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 GetCapabilitiesMarshaller::toString(const GetCapabilities& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetCapabilitiesMarshaller::checkIntegrityConst(const GetCapabilities& s) -{ - return true; -} - - -Json::Value GetCapabilitiesMarshaller::toJSON(const GetCapabilities& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.GetCapabilities"); - - json["id"]=Json::Value(e.getId()); - return json; -} - - -bool GetCapabilitiesMarshaller::fromJSON(const Json::Value& json,GetCapabilities& 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("UI.GetCapabilities")) 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/UI/GetCapabilitiesMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesMarshaller.h deleted file mode 100644 index 390510e68..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesMarshaller.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_UI_GETCAPABILITIESMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_GETCAPABILITIESMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetCapabilities.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct GetCapabilitiesMarshaller - { - static bool checkIntegrity(GetCapabilities& e); - static bool checkIntegrityConst(const GetCapabilities& e); - - static bool fromString(const std::string& s,GetCapabilities& e); - static const std::string toString(const GetCapabilities& e); - - static bool fromJSON(const Json::Value& s,GetCapabilities& e); - static Json::Value toJSON(const GetCapabilities& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponse.cpp deleted file mode 100644 index 204f6450a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponse.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetCapabilitiesResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -GetCapabilitiesResponse& GetCapabilitiesResponse::operator =(const GetCapabilitiesResponse& c) -{ - displayCapabilities=c.displayCapabilities; - hmiZoneCapabilities=c.hmiZoneCapabilities; - if(softButtonCapabilities) delete softButtonCapabilities; - softButtonCapabilities= c.softButtonCapabilities ? new std::vector<NsSmartDeviceLinkRPCV2::SoftButtonCapabilities>(c.softButtonCapabilities[0]) : 0; - return *this; -} - - -GetCapabilitiesResponse::~GetCapabilitiesResponse(void) -{ - if(softButtonCapabilities) delete softButtonCapabilities; -} - - -GetCapabilitiesResponse::GetCapabilitiesResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETCAPABILITIESRESPONSE), - softButtonCapabilities(0) -{ -} - - -GetCapabilitiesResponse::GetCapabilitiesResponse(const GetCapabilitiesResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETCAPABILITIESRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::DisplayCapabilities& GetCapabilitiesResponse::get_displayCapabilities(void) -{ - return displayCapabilities; -} - -bool GetCapabilitiesResponse::set_displayCapabilities(const NsSmartDeviceLinkRPCV2::DisplayCapabilities& displayCapabilities_) -{ - displayCapabilities=displayCapabilities_; - return true; -} - -const std::vector< NsSmartDeviceLinkRPCV2::HmiZoneCapabilities>& GetCapabilitiesResponse::get_hmiZoneCapabilities(void) -{ - return hmiZoneCapabilities; -} - -bool GetCapabilitiesResponse::set_hmiZoneCapabilities(const std::vector< NsSmartDeviceLinkRPCV2::HmiZoneCapabilities>& hmiZoneCapabilities_) -{ - hmiZoneCapabilities=hmiZoneCapabilities_; - return true; -} - -const std::vector< NsSmartDeviceLinkRPCV2::SoftButtonCapabilities>* GetCapabilitiesResponse::get_softButtonCapabilities(void) -{ - return softButtonCapabilities; -} - -bool GetCapabilitiesResponse::set_softButtonCapabilities(const std::vector< NsSmartDeviceLinkRPCV2::SoftButtonCapabilities>& softButtonCapabilities_) -{ - if(softButtonCapabilities) delete softButtonCapabilities; - softButtonCapabilities=new std::vector< NsSmartDeviceLinkRPCV2::SoftButtonCapabilities>(softButtonCapabilities_); - return true; -} - -void GetCapabilitiesResponse::reset_softButtonCapabilities(void) -{ - if(softButtonCapabilities) delete softButtonCapabilities; - softButtonCapabilities=0; -} - -bool GetCapabilitiesResponse::checkIntegrity(void) -{ - return GetCapabilitiesResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponseMarshaller.cpp deleted file mode 100644 index c6ee9c41e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponseMarshaller.cpp +++ /dev/null @@ -1,199 +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/UI/GetCapabilitiesResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/DisplayCapabilitiesMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/HmiZoneCapabilitiesMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/SoftButtonCapabilitiesMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/GetCapabilitiesResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool GetCapabilitiesResponseMarshaller::checkIntegrity(GetCapabilitiesResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool GetCapabilitiesResponseMarshaller::fromString(const std::string& s,GetCapabilitiesResponse& 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 GetCapabilitiesResponseMarshaller::toString(const GetCapabilitiesResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetCapabilitiesResponseMarshaller::checkIntegrityConst(const GetCapabilitiesResponse& s) -{ - if(!NsSmartDeviceLinkRPCV2::DisplayCapabilitiesMarshaller::checkIntegrityConst(s.displayCapabilities)) return false; - - { - unsigned int i=s.hmiZoneCapabilities.size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.softButtonCapabilities) - { - unsigned int i=s.softButtonCapabilities[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value GetCapabilitiesResponseMarshaller::toJSON(const GetCapabilitiesResponse& 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("UI.GetCapabilitiesResponse"); - - json["result"]["displayCapabilities"]=NsSmartDeviceLinkRPCV2::DisplayCapabilitiesMarshaller::toJSON(e.displayCapabilities);; - { - unsigned int i=e.hmiZoneCapabilities.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::HmiZoneCapabilitiesMarshaller::toJSON(e.hmiZoneCapabilities[i]); - - json["result"]["hmiZoneCapabilities"]=j; - } - if(e.softButtonCapabilities) - { - unsigned int i=e.softButtonCapabilities[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::SoftButtonCapabilitiesMarshaller::toJSON(e.softButtonCapabilities[0][i]); - - json["result"]["softButtonCapabilities"]=j; - } - return json; -} - - -bool GetCapabilitiesResponseMarshaller::fromJSON(const Json::Value& json,GetCapabilitiesResponse& 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("UI.GetCapabilitiesResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(!js.isMember("displayCapabilities") || !NsSmartDeviceLinkRPCV2::DisplayCapabilitiesMarshaller::fromJSON(js["displayCapabilities"],c.displayCapabilities)) return false; - - if(!js.isMember("hmiZoneCapabilities") || !js["hmiZoneCapabilities"].isArray()) return false; - { - unsigned int i=js["hmiZoneCapabilities"].size(); - if(i<1) return false; - if(i>100) return false; - c.hmiZoneCapabilities.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::HmiZoneCapabilities t; - if(!NsSmartDeviceLinkRPCV2::HmiZoneCapabilitiesMarshaller::fromJSON(js["hmiZoneCapabilities"][i],t)) - return false; - c.hmiZoneCapabilities[i]=t; - } - } - - if(c.softButtonCapabilities) delete c.softButtonCapabilities; - c.softButtonCapabilities=0; - if(js.isMember("softButtonCapabilities")) - { - if(!js["softButtonCapabilities"].isArray()) return false; - unsigned int i=js["softButtonCapabilities"].size(); - if(i<1) return false; - if(i>100) return false; - - c.softButtonCapabilities=new std::vector<NsSmartDeviceLinkRPCV2::SoftButtonCapabilities>(); - c.softButtonCapabilities->resize(js["softButtonCapabilities"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::SoftButtonCapabilitiesMarshaller::fromJSON(js["softButtonCapabilities"][i],c.softButtonCapabilities[0][i])) return false; - } - - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponseMarshaller.h deleted file mode 100644 index 1eeeaf76f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetCapabilitiesResponseMarshaller.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_UI_GETCAPABILITIESRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_GETCAPABILITIESRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetCapabilitiesResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct GetCapabilitiesResponseMarshaller - { - static bool checkIntegrity(GetCapabilitiesResponse& e); - static bool checkIntegrityConst(const GetCapabilitiesResponse& e); - - static bool fromString(const std::string& s,GetCapabilitiesResponse& e); - static const std::string toString(const GetCapabilitiesResponse& e); - - static bool fromJSON(const Json::Value& s,GetCapabilitiesResponse& e); - static Json::Value toJSON(const GetCapabilitiesResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguage.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguage.cpp deleted file mode 100644 index 36e740f20..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguage.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/UI/GetLanguage.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -GetLanguage& GetLanguage::operator =(const GetLanguage& c) -{ - return *this; -} - - -GetLanguage::~GetLanguage(void) -{ -} - - -GetLanguage::GetLanguage(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETLANGUAGE) -{ -} - - -GetLanguage::GetLanguage(const GetLanguage& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETLANGUAGE,c.getId()) -{ - *this=c; -} - - -bool GetLanguage::checkIntegrity(void) -{ - return GetLanguageMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageMarshaller.cpp deleted file mode 100644 index 1310baef3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageMarshaller.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/UI/GetLanguage.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/GetLanguageMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool GetLanguageMarshaller::checkIntegrity(GetLanguage& s) -{ - return checkIntegrityConst(s); -} - - -bool GetLanguageMarshaller::fromString(const std::string& s,GetLanguage& 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 GetLanguageMarshaller::toString(const GetLanguage& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetLanguageMarshaller::checkIntegrityConst(const GetLanguage& s) -{ - return true; -} - - -Json::Value GetLanguageMarshaller::toJSON(const GetLanguage& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.GetLanguage"); - - json["id"]=Json::Value(e.getId()); - return json; -} - - -bool GetLanguageMarshaller::fromJSON(const Json::Value& json,GetLanguage& 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("UI.GetLanguage")) 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/UI/GetLanguageMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageMarshaller.h deleted file mode 100644 index 03ed2fded..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageMarshaller.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_UI_GETLANGUAGEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_GETLANGUAGEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetLanguage.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct GetLanguageMarshaller - { - static bool checkIntegrity(GetLanguage& e); - static bool checkIntegrityConst(const GetLanguage& e); - - static bool fromString(const std::string& s,GetLanguage& e); - static const std::string toString(const GetLanguage& e); - - static bool fromJSON(const Json::Value& s,GetLanguage& e); - static Json::Value toJSON(const GetLanguage& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponse.cpp deleted file mode 100644 index 72e118ac9..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponse.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetLanguageResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -GetLanguageResponse& GetLanguageResponse::operator =(const GetLanguageResponse& c) -{ - hmiDisplayLanguage=c.hmiDisplayLanguage; - return *this; -} - - -GetLanguageResponse::~GetLanguageResponse(void) -{ -} - - -GetLanguageResponse::GetLanguageResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETLANGUAGERESPONSE) -{ -} - - -GetLanguageResponse::GetLanguageResponse(const GetLanguageResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETLANGUAGERESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::Language& GetLanguageResponse::get_hmiDisplayLanguage(void) -{ - return hmiDisplayLanguage; -} - -bool GetLanguageResponse::set_hmiDisplayLanguage(const NsSmartDeviceLinkRPCV2::Language& hmiDisplayLanguage_) -{ - hmiDisplayLanguage=hmiDisplayLanguage_; - return true; -} - -bool GetLanguageResponse::checkIntegrity(void) -{ - return GetLanguageResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponseMarshaller.cpp deleted file mode 100644 index e4f04dfa1..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponseMarshaller.cpp +++ /dev/null @@ -1,133 +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/UI/GetLanguageResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/LanguageMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/GetLanguageResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool GetLanguageResponseMarshaller::checkIntegrity(GetLanguageResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool GetLanguageResponseMarshaller::fromString(const std::string& s,GetLanguageResponse& 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 GetLanguageResponseMarshaller::toString(const GetLanguageResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetLanguageResponseMarshaller::checkIntegrityConst(const GetLanguageResponse& s) -{ - if(!NsSmartDeviceLinkRPCV2::LanguageMarshaller::checkIntegrityConst(s.hmiDisplayLanguage)) return false; - - return true; -} - - -Json::Value GetLanguageResponseMarshaller::toJSON(const GetLanguageResponse& 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("UI.GetLanguageResponse"); - - json["result"]["hmiDisplayLanguage"]=NsSmartDeviceLinkRPCV2::LanguageMarshaller::toJSON(e.hmiDisplayLanguage);; - return json; -} - - -bool GetLanguageResponseMarshaller::fromJSON(const Json::Value& json,GetLanguageResponse& 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("UI.GetLanguageResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(!js.isMember("hmiDisplayLanguage") || !NsSmartDeviceLinkRPCV2::LanguageMarshaller::fromJSON(js["hmiDisplayLanguage"],c.hmiDisplayLanguage)) return false; - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponseMarshaller.h deleted file mode 100644 index 01e9fada2..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetLanguageResponseMarshaller.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_UI_GETLANGUAGERESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_GETLANGUAGERESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetLanguageResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct GetLanguageResponseMarshaller - { - static bool checkIntegrity(GetLanguageResponse& e); - static bool checkIntegrityConst(const GetLanguageResponse& e); - - static bool fromString(const std::string& s,GetLanguageResponse& e); - static const std::string toString(const GetLanguageResponse& e); - - static bool fromJSON(const Json::Value& s,GetLanguageResponse& e); - static Json::Value toJSON(const GetLanguageResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguages.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguages.cpp deleted file mode 100644 index b68b5462e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguages.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/UI/GetSupportedLanguages.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -GetSupportedLanguages& GetSupportedLanguages::operator =(const GetSupportedLanguages& c) -{ - return *this; -} - - -GetSupportedLanguages::~GetSupportedLanguages(void) -{ -} - - -GetSupportedLanguages::GetSupportedLanguages(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETSUPPORTEDLANGUAGES) -{ -} - - -GetSupportedLanguages::GetSupportedLanguages(const GetSupportedLanguages& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETSUPPORTEDLANGUAGES,c.getId()) -{ - *this=c; -} - - -bool GetSupportedLanguages::checkIntegrity(void) -{ - return GetSupportedLanguagesMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesMarshaller.cpp deleted file mode 100644 index 1aa123469..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesMarshaller.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/UI/GetSupportedLanguages.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/GetSupportedLanguagesMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool GetSupportedLanguagesMarshaller::checkIntegrity(GetSupportedLanguages& s) -{ - return checkIntegrityConst(s); -} - - -bool GetSupportedLanguagesMarshaller::fromString(const std::string& s,GetSupportedLanguages& 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 GetSupportedLanguagesMarshaller::toString(const GetSupportedLanguages& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetSupportedLanguagesMarshaller::checkIntegrityConst(const GetSupportedLanguages& s) -{ - return true; -} - - -Json::Value GetSupportedLanguagesMarshaller::toJSON(const GetSupportedLanguages& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.GetSupportedLanguages"); - - json["id"]=Json::Value(e.getId()); - return json; -} - - -bool GetSupportedLanguagesMarshaller::fromJSON(const Json::Value& json,GetSupportedLanguages& 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("UI.GetSupportedLanguages")) 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/UI/GetSupportedLanguagesMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesMarshaller.h deleted file mode 100644 index e518431b4..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesMarshaller.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_UI_GETSUPPORTEDLANGUAGESMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_GETSUPPORTEDLANGUAGESMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetSupportedLanguages.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct GetSupportedLanguagesMarshaller - { - static bool checkIntegrity(GetSupportedLanguages& e); - static bool checkIntegrityConst(const GetSupportedLanguages& e); - - static bool fromString(const std::string& s,GetSupportedLanguages& e); - static const std::string toString(const GetSupportedLanguages& e); - - static bool fromJSON(const Json::Value& s,GetSupportedLanguages& e); - static Json::Value toJSON(const GetSupportedLanguages& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponse.cpp deleted file mode 100644 index 3ead1761c..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponse.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetSupportedLanguagesResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -GetSupportedLanguagesResponse& GetSupportedLanguagesResponse::operator =(const GetSupportedLanguagesResponse& c) -{ - languages=c.languages; - return *this; -} - - -GetSupportedLanguagesResponse::~GetSupportedLanguagesResponse(void) -{ -} - - -GetSupportedLanguagesResponse::GetSupportedLanguagesResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETSUPPORTEDLANGUAGESRESPONSE) -{ -} - - -GetSupportedLanguagesResponse::GetSupportedLanguagesResponse(const GetSupportedLanguagesResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__GETSUPPORTEDLANGUAGESRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -const std::vector< NsSmartDeviceLinkRPCV2::Language>& GetSupportedLanguagesResponse::get_languages(void) -{ - return languages; -} - -bool GetSupportedLanguagesResponse::set_languages(const std::vector< NsSmartDeviceLinkRPCV2::Language>& languages_) -{ - languages=languages_; - return true; -} - -bool GetSupportedLanguagesResponse::checkIntegrity(void) -{ - return GetSupportedLanguagesResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponseMarshaller.cpp deleted file mode 100644 index 6c947feb1..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponseMarshaller.cpp +++ /dev/null @@ -1,158 +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/UI/GetSupportedLanguagesResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/LanguageMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/GetSupportedLanguagesResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool GetSupportedLanguagesResponseMarshaller::checkIntegrity(GetSupportedLanguagesResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool GetSupportedLanguagesResponseMarshaller::fromString(const std::string& s,GetSupportedLanguagesResponse& 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 GetSupportedLanguagesResponseMarshaller::toString(const GetSupportedLanguagesResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool GetSupportedLanguagesResponseMarshaller::checkIntegrityConst(const GetSupportedLanguagesResponse& s) -{ - { - unsigned int i=s.languages.size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value GetSupportedLanguagesResponseMarshaller::toJSON(const GetSupportedLanguagesResponse& 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("UI.GetSupportedLanguagesResponse"); - - { - unsigned int i=e.languages.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::LanguageMarshaller::toJSON(e.languages[i]); - - json["result"]["languages"]=j; - } - return json; -} - - -bool GetSupportedLanguagesResponseMarshaller::fromJSON(const Json::Value& json,GetSupportedLanguagesResponse& 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("UI.GetSupportedLanguagesResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(!js.isMember("languages") || !js["languages"].isArray()) return false; - { - unsigned int i=js["languages"].size(); - if(i<1) return false; - if(i>100) return false; - c.languages.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::Language t; - if(!NsSmartDeviceLinkRPCV2::LanguageMarshaller::fromJSON(js["languages"][i],t)) - return false; - c.languages[i]=t; - } - } - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponseMarshaller.h deleted file mode 100644 index f0d17f125..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/GetSupportedLanguagesResponseMarshaller.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_UI_GETSUPPORTEDLANGUAGESRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_GETSUPPORTEDLANGUAGESRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/GetSupportedLanguagesResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct GetSupportedLanguagesResponseMarshaller - { - static bool checkIntegrity(GetSupportedLanguagesResponse& e); - static bool checkIntegrityConst(const GetSupportedLanguagesResponse& e); - - static bool fromString(const std::string& s,GetSupportedLanguagesResponse& e); - static const std::string toString(const GetSupportedLanguagesResponse& e); - - static bool fromJSON(const Json::Value& s,GetSupportedLanguagesResponse& e); - static Json::Value toJSON(const GetSupportedLanguagesResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommand.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommand.cpp deleted file mode 100644 index 07fb31b9b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommand.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/UI/OnCommand.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -OnCommand& OnCommand::operator =(const OnCommand& c) -{ - commandId=c.commandId; - appId=c.appId; - return *this; -} - - -OnCommand::~OnCommand(void) -{ -} - - -OnCommand::OnCommand(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONCOMMAND) -{ -} - - -OnCommand::OnCommand(const OnCommand& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONCOMMAND) -{ - *this=c; -} - - -unsigned int OnCommand::get_commandId(void) -{ - return commandId; -} - -bool OnCommand::set_commandId(unsigned int commandId_) -{ - commandId=commandId_; - return true; -} - -int OnCommand::get_appId(void) -{ - return appId; -} - -bool OnCommand::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool OnCommand::checkIntegrity(void) -{ - return OnCommandMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommandMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommandMarshaller.cpp deleted file mode 100644 index a9cddfd63..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommandMarshaller.cpp +++ /dev/null @@ -1,126 +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/UI/OnCommand.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/OnCommandMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool OnCommandMarshaller::checkIntegrity(OnCommand& s) -{ - return checkIntegrityConst(s); -} - - -bool OnCommandMarshaller::fromString(const std::string& s,OnCommand& 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 OnCommandMarshaller::toString(const OnCommand& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnCommandMarshaller::checkIntegrityConst(const OnCommand& s) -{ - if(s.commandId>2000000000) return false; - - return true; -} - - -Json::Value OnCommandMarshaller::toJSON(const OnCommand& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.OnCommand"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["commandId"]=Json::Value(e.commandId);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool OnCommandMarshaller::fromJSON(const Json::Value& json,OnCommand& 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("UI.OnCommand")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("commandId") || !js["commandId"].isInt()) return false; - c.commandId=js["commandId"].asInt(); - if(c.commandId>2000000000) 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/UI/OnCommandMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommandMarshaller.h deleted file mode 100644 index 452bc9023..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnCommandMarshaller.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_UI_ONCOMMANDMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ONCOMMANDMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnCommand.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct OnCommandMarshaller - { - static bool checkIntegrity(OnCommand& e); - static bool checkIntegrityConst(const OnCommand& e); - - static bool fromString(const std::string& s,OnCommand& e); - static const std::string toString(const OnCommand& e); - - static bool fromJSON(const Json::Value& s,OnCommand& e); - static Json::Value toJSON(const OnCommand& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosen.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosen.cpp deleted file mode 100644 index 64030c3ef..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosen.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnDeviceChosen.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -OnDeviceChosen& OnDeviceChosen::operator =(const OnDeviceChosen& c) -{ - deviceName=c.deviceName; - return *this; -} - - -OnDeviceChosen::~OnDeviceChosen(void) -{ -} - - -OnDeviceChosen::OnDeviceChosen(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONDEVICECHOSEN) -{ -} - - -OnDeviceChosen::OnDeviceChosen(const OnDeviceChosen& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONDEVICECHOSEN) -{ - *this=c; -} - - -const std::string& OnDeviceChosen::get_deviceName(void) -{ - return deviceName; -} - -bool OnDeviceChosen::set_deviceName(const std::string& deviceName_) -{ - deviceName=deviceName_; - return true; -} - -bool OnDeviceChosen::checkIntegrity(void) -{ - return OnDeviceChosenMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosenMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosenMarshaller.cpp deleted file mode 100644 index b9ce689ec..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosenMarshaller.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnDeviceChosen.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/OnDeviceChosenMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool OnDeviceChosenMarshaller::checkIntegrity(OnDeviceChosen& s) -{ - return checkIntegrityConst(s); -} - - -bool OnDeviceChosenMarshaller::fromString(const std::string& s,OnDeviceChosen& 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 OnDeviceChosenMarshaller::toString(const OnDeviceChosen& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnDeviceChosenMarshaller::checkIntegrityConst(const OnDeviceChosen& s) -{ - return true; -} - - -Json::Value OnDeviceChosenMarshaller::toJSON(const OnDeviceChosen& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.OnDeviceChosen"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["deviceName"]=Json::Value(e.deviceName);; - return json; -} - - -bool OnDeviceChosenMarshaller::fromJSON(const Json::Value& json,OnDeviceChosen& 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("UI.OnDeviceChosen")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("deviceName") || !js["deviceName"].isString()) return false; - c.deviceName=js["deviceName"].asString(); - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosenMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosenMarshaller.h deleted file mode 100644 index eeb41cbad..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDeviceChosenMarshaller.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_UI_ONDEVICECHOSENMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ONDEVICECHOSENMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnDeviceChosen.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct OnDeviceChosenMarshaller - { - static bool checkIntegrity(OnDeviceChosen& e); - static bool checkIntegrityConst(const OnDeviceChosen& e); - - static bool fromString(const std::string& s,OnDeviceChosen& e); - static const std::string toString(const OnDeviceChosen& e); - - static bool fromJSON(const Json::Value& s,OnDeviceChosen& e); - static Json::Value toJSON(const OnDeviceChosen& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistraction.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistraction.cpp deleted file mode 100644 index 68cf2740d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistraction.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnDriverDistraction.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -OnDriverDistraction& OnDriverDistraction::operator =(const OnDriverDistraction& c) -{ - state=c.state; - return *this; -} - - -OnDriverDistraction::~OnDriverDistraction(void) -{ -} - - -OnDriverDistraction::OnDriverDistraction(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONDRIVERDISTRACTION) -{ -} - - -OnDriverDistraction::OnDriverDistraction(const OnDriverDistraction& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONDRIVERDISTRACTION) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::DriverDistractionState& OnDriverDistraction::get_state(void) -{ - return state; -} - -bool OnDriverDistraction::set_state(const NsSmartDeviceLinkRPCV2::DriverDistractionState& state_) -{ - state=state_; - return true; -} - -bool OnDriverDistraction::checkIntegrity(void) -{ - return OnDriverDistractionMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistractionMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistractionMarshaller.cpp deleted file mode 100644 index c62901454..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistractionMarshaller.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/UI/OnDriverDistraction.h" -#include "../src/SDLRPCObjectsImpl/V2/DriverDistractionStateMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/OnDriverDistractionMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool OnDriverDistractionMarshaller::checkIntegrity(OnDriverDistraction& s) -{ - return checkIntegrityConst(s); -} - - -bool OnDriverDistractionMarshaller::fromString(const std::string& s,OnDriverDistraction& 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 OnDriverDistractionMarshaller::toString(const OnDriverDistraction& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnDriverDistractionMarshaller::checkIntegrityConst(const OnDriverDistraction& s) -{ - if(!NsSmartDeviceLinkRPCV2::DriverDistractionStateMarshaller::checkIntegrityConst(s.state)) return false; - - return true; -} - - -Json::Value OnDriverDistractionMarshaller::toJSON(const OnDriverDistraction& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.OnDriverDistraction"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["state"]=NsSmartDeviceLinkRPCV2::DriverDistractionStateMarshaller::toJSON(e.state);; - return json; -} - - -bool OnDriverDistractionMarshaller::fromJSON(const Json::Value& json,OnDriverDistraction& 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("UI.OnDriverDistraction")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("state") || !NsSmartDeviceLinkRPCV2::DriverDistractionStateMarshaller::fromJSON(js["state"],c.state)) return false; - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistractionMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistractionMarshaller.h deleted file mode 100644 index 470fe089d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnDriverDistractionMarshaller.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_UI_ONDRIVERDISTRACTIONMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ONDRIVERDISTRACTIONMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnDriverDistraction.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct OnDriverDistractionMarshaller - { - static bool checkIntegrity(OnDriverDistraction& e); - static bool checkIntegrityConst(const OnDriverDistraction& e); - - static bool fromString(const std::string& s,OnDriverDistraction& e); - static const std::string toString(const OnDriverDistraction& e); - - static bool fromJSON(const Json::Value& s,OnDriverDistraction& e); - static Json::Value toJSON(const OnDriverDistraction& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChange.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChange.cpp deleted file mode 100644 index 0418a8f33..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChange.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnLanguageChange.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -OnLanguageChange& OnLanguageChange::operator =(const OnLanguageChange& c) -{ - hmiDisplayLanguage=c.hmiDisplayLanguage; - return *this; -} - - -OnLanguageChange::~OnLanguageChange(void) -{ -} - - -OnLanguageChange::OnLanguageChange(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONLANGUAGECHANGE) -{ -} - - -OnLanguageChange::OnLanguageChange(const OnLanguageChange& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONLANGUAGECHANGE) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::Language& OnLanguageChange::get_hmiDisplayLanguage(void) -{ - return hmiDisplayLanguage; -} - -bool OnLanguageChange::set_hmiDisplayLanguage(const NsSmartDeviceLinkRPCV2::Language& hmiDisplayLanguage_) -{ - hmiDisplayLanguage=hmiDisplayLanguage_; - return true; -} - -bool OnLanguageChange::checkIntegrity(void) -{ - return OnLanguageChangeMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChangeMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChangeMarshaller.cpp deleted file mode 100644 index 57e0b8c10..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChangeMarshaller.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/UI/OnLanguageChange.h" -#include "../src/SDLRPCObjectsImpl/V2/LanguageMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/OnLanguageChangeMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool OnLanguageChangeMarshaller::checkIntegrity(OnLanguageChange& s) -{ - return checkIntegrityConst(s); -} - - -bool OnLanguageChangeMarshaller::fromString(const std::string& s,OnLanguageChange& 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 OnLanguageChangeMarshaller::toString(const OnLanguageChange& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnLanguageChangeMarshaller::checkIntegrityConst(const OnLanguageChange& s) -{ - if(!NsSmartDeviceLinkRPCV2::LanguageMarshaller::checkIntegrityConst(s.hmiDisplayLanguage)) return false; - - return true; -} - - -Json::Value OnLanguageChangeMarshaller::toJSON(const OnLanguageChange& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.OnLanguageChange"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["hmiDisplayLanguage"]=NsSmartDeviceLinkRPCV2::LanguageMarshaller::toJSON(e.hmiDisplayLanguage);; - return json; -} - - -bool OnLanguageChangeMarshaller::fromJSON(const Json::Value& json,OnLanguageChange& 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("UI.OnLanguageChange")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("hmiDisplayLanguage") || !NsSmartDeviceLinkRPCV2::LanguageMarshaller::fromJSON(js["hmiDisplayLanguage"],c.hmiDisplayLanguage)) return false; - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChangeMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChangeMarshaller.h deleted file mode 100644 index 286ae7eb9..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnLanguageChangeMarshaller.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_UI_ONLANGUAGECHANGEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ONLANGUAGECHANGEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnLanguageChange.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct OnLanguageChangeMarshaller - { - static bool checkIntegrity(OnLanguageChange& e); - static bool checkIntegrityConst(const OnLanguageChange& e); - - static bool fromString(const std::string& s,OnLanguageChange& e); - static const std::string toString(const OnLanguageChange& e); - - static bool fromJSON(const Json::Value& s,OnLanguageChange& e); - static Json::Value toJSON(const OnLanguageChange& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReady.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReady.cpp deleted file mode 100644 index af4d65a2f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReady.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/UI/OnReady.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -OnReady& OnReady::operator =(const OnReady& c) -{ - return *this; -} - - -OnReady::~OnReady(void) -{ -} - - -OnReady::OnReady(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONREADY) -{ -} - - -OnReady::OnReady(const OnReady& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONREADY) -{ - *this=c; -} - - -bool OnReady::checkIntegrity(void) -{ - return OnReadyMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReadyMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReadyMarshaller.cpp deleted file mode 100644 index 5fc0178cc..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReadyMarshaller.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnReady.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/OnReadyMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool OnReadyMarshaller::checkIntegrity(OnReady& s) -{ - return checkIntegrityConst(s); -} - - -bool OnReadyMarshaller::fromString(const std::string& s,OnReady& 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 OnReadyMarshaller::toString(const OnReady& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnReadyMarshaller::checkIntegrityConst(const OnReady& s) -{ - return true; -} - - -Json::Value OnReadyMarshaller::toJSON(const OnReady& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.OnReady"); - - return json; -} - - -bool OnReadyMarshaller::fromJSON(const Json::Value& json,OnReady& 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("UI.OnReady")) return false; - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReadyMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReadyMarshaller.h deleted file mode 100644 index f96808e44..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnReadyMarshaller.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_UI_ONREADYMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ONREADYMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnReady.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct OnReadyMarshaller - { - static bool checkIntegrity(OnReady& e); - static bool checkIntegrityConst(const OnReady& e); - - static bool fromString(const std::string& s,OnReady& e); - static const std::string toString(const OnReady& e); - - static bool fromJSON(const Json::Value& s,OnReady& e); - static Json::Value toJSON(const OnReady& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContext.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContext.cpp deleted file mode 100644 index 1b87a26be..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContext.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnSystemContext.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -OnSystemContext& OnSystemContext::operator =(const OnSystemContext& c) -{ - systemContext=c.systemContext; - return *this; -} - - -OnSystemContext::~OnSystemContext(void) -{ -} - - -OnSystemContext::OnSystemContext(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONSYSTEMCONTEXT) -{ -} - - -OnSystemContext::OnSystemContext(const OnSystemContext& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONSYSTEMCONTEXT) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::SystemContext& OnSystemContext::get_systemContext(void) -{ - return systemContext; -} - -bool OnSystemContext::set_systemContext(const NsSmartDeviceLinkRPCV2::SystemContext& systemContext_) -{ - systemContext=systemContext_; - return true; -} - -bool OnSystemContext::checkIntegrity(void) -{ - return OnSystemContextMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContextMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContextMarshaller.cpp deleted file mode 100644 index 471b5330d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContextMarshaller.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/UI/OnSystemContext.h" -#include "../src/SDLRPCObjectsImpl/V2/SystemContextMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/OnSystemContextMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool OnSystemContextMarshaller::checkIntegrity(OnSystemContext& s) -{ - return checkIntegrityConst(s); -} - - -bool OnSystemContextMarshaller::fromString(const std::string& s,OnSystemContext& 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 OnSystemContextMarshaller::toString(const OnSystemContext& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnSystemContextMarshaller::checkIntegrityConst(const OnSystemContext& s) -{ - if(!NsSmartDeviceLinkRPCV2::SystemContextMarshaller::checkIntegrityConst(s.systemContext)) return false; - - return true; -} - - -Json::Value OnSystemContextMarshaller::toJSON(const OnSystemContext& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.OnSystemContext"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["systemContext"]=NsSmartDeviceLinkRPCV2::SystemContextMarshaller::toJSON(e.systemContext);; - return json; -} - - -bool OnSystemContextMarshaller::fromJSON(const Json::Value& json,OnSystemContext& 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("UI.OnSystemContext")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("systemContext") || !NsSmartDeviceLinkRPCV2::SystemContextMarshaller::fromJSON(js["systemContext"],c.systemContext)) return false; - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContextMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContextMarshaller.h deleted file mode 100644 index e9cece0ac..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnSystemContextMarshaller.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_UI_ONSYSTEMCONTEXTMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ONSYSTEMCONTEXTMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnSystemContext.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct OnSystemContextMarshaller - { - static bool checkIntegrity(OnSystemContext& e); - static bool checkIntegrityConst(const OnSystemContext& e); - - static bool fromString(const std::string& s,OnSystemContext& e); - static const std::string toString(const OnSystemContext& e); - - static bool fromJSON(const Json::Value& s,OnSystemContext& e); - static Json::Value toJSON(const OnSystemContext& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientState.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientState.cpp deleted file mode 100644 index f1dce8016..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientState.cpp +++ /dev/null @@ -1,96 +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/UI/OnTBTClientState.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -OnTBTClientState& OnTBTClientState::operator =(const OnTBTClientState& c) -{ - state=c.state; - return *this; -} - - -OnTBTClientState::~OnTBTClientState(void) -{ -} - - -OnTBTClientState::OnTBTClientState(void) : - RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONTBTCLIENTSTATE) -{ -} - - -OnTBTClientState::OnTBTClientState(const OnTBTClientState& c) : RPC2Notification(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__ONTBTCLIENTSTATE) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::TBTState& OnTBTClientState::get_state(void) -{ - return state; -} - -bool OnTBTClientState::set_state(const NsSmartDeviceLinkRPCV2::TBTState& state_) -{ - state=state_; - return true; -} - -int OnTBTClientState::get_appId(void) -{ - return appId; -} - -bool OnTBTClientState::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool OnTBTClientState::checkIntegrity(void) -{ - return OnTBTClientStateMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientStateMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientStateMarshaller.cpp deleted file mode 100644 index 891112e8e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientStateMarshaller.cpp +++ /dev/null @@ -1,124 +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/UI/OnTBTClientState.h" -#include "../src/SDLRPCObjectsImpl/V2/TBTStateMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/OnTBTClientStateMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool OnTBTClientStateMarshaller::checkIntegrity(OnTBTClientState& s) -{ - return checkIntegrityConst(s); -} - - -bool OnTBTClientStateMarshaller::fromString(const std::string& s,OnTBTClientState& 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 OnTBTClientStateMarshaller::toString(const OnTBTClientState& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool OnTBTClientStateMarshaller::checkIntegrityConst(const OnTBTClientState& s) -{ - if(!NsSmartDeviceLinkRPCV2::TBTStateMarshaller::checkIntegrityConst(s.state)) return false; - - return true; -} - - -Json::Value OnTBTClientStateMarshaller::toJSON(const OnTBTClientState& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.OnTBTClientState"); - json["params"]=Json::Value(Json::objectValue); - - json["params"]["state"]=NsSmartDeviceLinkRPCV2::TBTStateMarshaller::toJSON(e.state); - json["params"]["appId"]=Json::Value(e.appId); - return json; -} - - -bool OnTBTClientStateMarshaller::fromJSON(const Json::Value& json,OnTBTClientState& 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("UI.OnTBTClientState")) return false; - if(!json.isMember("params")) return false; - - Json::Value js=json["params"]; - if(!js.isObject()) return false; - - if(!js.isMember("state") || !NsSmartDeviceLinkRPCV2::TBTStateMarshaller::fromJSON(js["state"],c.state)) 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/UI/OnTBTClientStateMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientStateMarshaller.h deleted file mode 100644 index a78e8025f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/OnTBTClientStateMarshaller.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_UI_ONTBTCLIENTSTATEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_ONTBTCLIENTSTATEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/OnTBTClientState.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct OnTBTClientStateMarshaller - { - static bool checkIntegrity(OnTBTClientState& e); - static bool checkIntegrityConst(const OnTBTClientState& e); - - static bool fromString(const std::string& s,OnTBTClientState& e); - static const std::string toString(const OnTBTClientState& e); - - static bool fromJSON(const Json::Value& s,OnTBTClientState& e); - static Json::Value toJSON(const OnTBTClientState& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThru.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThru.cpp deleted file mode 100644 index 8365563d3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThru.cpp +++ /dev/null @@ -1,189 +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/UI/PerformAudioPassThru.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -PerformAudioPassThru& PerformAudioPassThru::operator =(const PerformAudioPassThru& c) -{ - initialPrompt=c.initialPrompt; - if(audioPassThruDisplayText1) delete audioPassThruDisplayText1; - audioPassThruDisplayText1= c.audioPassThruDisplayText1 ? new std::string(c.audioPassThruDisplayText1[0]) : 0; - if(audioPassThruDisplayText2) delete audioPassThruDisplayText2; - audioPassThruDisplayText2= c.audioPassThruDisplayText2 ? new std::string(c.audioPassThruDisplayText2[0]) : 0; - samplingRate=c.samplingRate; - maxDuration=c.maxDuration; - bitsPerSample=c.bitsPerSample; - audioType=c.audioType; - appId=c.appId; - return *this; -} - - -PerformAudioPassThru::~PerformAudioPassThru(void) -{ - if(audioPassThruDisplayText1) delete audioPassThruDisplayText1; - if(audioPassThruDisplayText2) delete audioPassThruDisplayText2; -} - - -PerformAudioPassThru::PerformAudioPassThru(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMAUDIOPASSTHRU), - audioPassThruDisplayText1(0), - audioPassThruDisplayText2(0) -{ -} - - -PerformAudioPassThru::PerformAudioPassThru(const PerformAudioPassThru& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMAUDIOPASSTHRU,c.getId()) -{ - *this=c; -} - - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& PerformAudioPassThru::get_initialPrompt(void) -{ - return initialPrompt; -} - -bool PerformAudioPassThru::set_initialPrompt(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& initialPrompt_) -{ - initialPrompt=initialPrompt_; - return true; -} - -const std::string* PerformAudioPassThru::get_audioPassThruDisplayText1(void) -{ - return audioPassThruDisplayText1; -} - -bool PerformAudioPassThru::set_audioPassThruDisplayText1(const std::string& audioPassThruDisplayText1_) -{ - if(audioPassThruDisplayText1) delete audioPassThruDisplayText1; - audioPassThruDisplayText1=new std::string(audioPassThruDisplayText1_); - return true; -} - -void PerformAudioPassThru::reset_audioPassThruDisplayText1(void) -{ - if(audioPassThruDisplayText1) delete audioPassThruDisplayText1; - audioPassThruDisplayText1=0; -} - -const std::string* PerformAudioPassThru::get_audioPassThruDisplayText2(void) -{ - return audioPassThruDisplayText2; -} - -bool PerformAudioPassThru::set_audioPassThruDisplayText2(const std::string& audioPassThruDisplayText2_) -{ - if(audioPassThruDisplayText2) delete audioPassThruDisplayText2; - audioPassThruDisplayText2=new std::string(audioPassThruDisplayText2_); - return true; -} - -void PerformAudioPassThru::reset_audioPassThruDisplayText2(void) -{ - if(audioPassThruDisplayText2) delete audioPassThruDisplayText2; - audioPassThruDisplayText2=0; -} - -const NsSmartDeviceLinkRPCV2::SamplingRate& PerformAudioPassThru::get_samplingRate(void) -{ - return samplingRate; -} - -bool PerformAudioPassThru::set_samplingRate(const NsSmartDeviceLinkRPCV2::SamplingRate& samplingRate_) -{ - samplingRate=samplingRate_; - return true; -} - -unsigned int PerformAudioPassThru::get_maxDuration(void) -{ - return maxDuration; -} - -bool PerformAudioPassThru::set_maxDuration(unsigned int maxDuration_) -{ - maxDuration=maxDuration_; - return true; -} - -const NsSmartDeviceLinkRPCV2::AudioCaptureQuality& PerformAudioPassThru::get_bitsPerSample(void) -{ - return bitsPerSample; -} - -bool PerformAudioPassThru::set_bitsPerSample(const NsSmartDeviceLinkRPCV2::AudioCaptureQuality& bitsPerSample_) -{ - bitsPerSample=bitsPerSample_; - return true; -} - -const NsSmartDeviceLinkRPCV2::AudioType& PerformAudioPassThru::get_audioType(void) -{ - return audioType; -} - -bool PerformAudioPassThru::set_audioType(const NsSmartDeviceLinkRPCV2::AudioType& audioType_) -{ - audioType=audioType_; - return true; -} - -int PerformAudioPassThru::get_appId(void) -{ - return appId; -} - -bool PerformAudioPassThru::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool PerformAudioPassThru::checkIntegrity(void) -{ - return PerformAudioPassThruMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruMarshaller.cpp deleted file mode 100644 index bda449899..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruMarshaller.cpp +++ /dev/null @@ -1,208 +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/UI/PerformAudioPassThru.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/SamplingRateMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/AudioCaptureQualityMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/AudioTypeMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/PerformAudioPassThruMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool PerformAudioPassThruMarshaller::checkIntegrity(PerformAudioPassThru& s) -{ - return checkIntegrityConst(s); -} - - -bool PerformAudioPassThruMarshaller::fromString(const std::string& s,PerformAudioPassThru& 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 PerformAudioPassThruMarshaller::toString(const PerformAudioPassThru& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool PerformAudioPassThruMarshaller::checkIntegrityConst(const PerformAudioPassThru& s) -{ - { - unsigned int i=s.initialPrompt.size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.audioPassThruDisplayText1 && (s.audioPassThruDisplayText1[0].length()>500)) return false; - - if(s.audioPassThruDisplayText2 && (s.audioPassThruDisplayText2[0].length()>500)) return false; - - if(!NsSmartDeviceLinkRPCV2::SamplingRateMarshaller::checkIntegrityConst(s.samplingRate)) return false; - - if(s.maxDuration>1000000) return false; - - if(!NsSmartDeviceLinkRPCV2::AudioCaptureQualityMarshaller::checkIntegrityConst(s.bitsPerSample)) return false; - - if(!NsSmartDeviceLinkRPCV2::AudioTypeMarshaller::checkIntegrityConst(s.audioType)) return false; - - return true; -} - - -Json::Value PerformAudioPassThruMarshaller::toJSON(const PerformAudioPassThru& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.PerformAudioPassThru"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - { - unsigned int i=e.initialPrompt.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.initialPrompt[i]); - - json["params"]["initialPrompt"]=j; - } - if(e.audioPassThruDisplayText1) - json["params"]["audioPassThruDisplayText1"]=Json::Value(e.audioPassThruDisplayText1[0]);; - if(e.audioPassThruDisplayText2) - json["params"]["audioPassThruDisplayText2"]=Json::Value(e.audioPassThruDisplayText2[0]);; - json["params"]["samplingRate"]=NsSmartDeviceLinkRPCV2::SamplingRateMarshaller::toJSON(e.samplingRate);; - json["params"]["maxDuration"]=Json::Value(e.maxDuration);; - json["params"]["bitsPerSample"]=NsSmartDeviceLinkRPCV2::AudioCaptureQualityMarshaller::toJSON(e.bitsPerSample);; - json["params"]["audioType"]=NsSmartDeviceLinkRPCV2::AudioTypeMarshaller::toJSON(e.audioType);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool PerformAudioPassThruMarshaller::fromJSON(const Json::Value& json,PerformAudioPassThru& 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("UI.PerformAudioPassThru")) 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("initialPrompt") || !js["initialPrompt"].isArray()) return false; - { - unsigned int i=js["initialPrompt"].size(); - if(i<1) return false; - if(i>100) return false; - c.initialPrompt.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::TTSChunk t; - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["initialPrompt"][i],t)) - return false; - c.initialPrompt[i]=t; - } - } - - if(c.audioPassThruDisplayText1) delete c.audioPassThruDisplayText1; - c.audioPassThruDisplayText1=0; - if(js.isMember("audioPassThruDisplayText1")) - { - if(!js["audioPassThruDisplayText1"].isString()) return false; - c.audioPassThruDisplayText1=new std::string(); - c.audioPassThruDisplayText1[0]=js["audioPassThruDisplayText1"].asString(); - if(c.audioPassThruDisplayText1[0].length()>500) return false; - - } - - if(c.audioPassThruDisplayText2) delete c.audioPassThruDisplayText2; - c.audioPassThruDisplayText2=0; - if(js.isMember("audioPassThruDisplayText2")) - { - if(!js["audioPassThruDisplayText2"].isString()) return false; - c.audioPassThruDisplayText2=new std::string(); - c.audioPassThruDisplayText2[0]=js["audioPassThruDisplayText2"].asString(); - if(c.audioPassThruDisplayText2[0].length()>500) return false; - - } - - if(!js.isMember("samplingRate") || !NsSmartDeviceLinkRPCV2::SamplingRateMarshaller::fromJSON(js["samplingRate"],c.samplingRate)) return false; - - if(!js.isMember("maxDuration") || !js["maxDuration"].isInt()) return false; - c.maxDuration=js["maxDuration"].asInt(); - if(c.maxDuration>1000000) return false; - - if(!js.isMember("bitsPerSample") || !NsSmartDeviceLinkRPCV2::AudioCaptureQualityMarshaller::fromJSON(js["bitsPerSample"],c.bitsPerSample)) return false; - - if(!js.isMember("audioType") || !NsSmartDeviceLinkRPCV2::AudioTypeMarshaller::fromJSON(js["audioType"],c.audioType)) 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/UI/PerformAudioPassThruMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruMarshaller.h deleted file mode 100644 index 76b662ff5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruMarshaller.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_UI_PERFORMAUDIOPASSTHRUMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_PERFORMAUDIOPASSTHRUMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/PerformAudioPassThru.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct PerformAudioPassThruMarshaller - { - static bool checkIntegrity(PerformAudioPassThru& e); - static bool checkIntegrityConst(const PerformAudioPassThru& e); - - static bool fromString(const std::string& s,PerformAudioPassThru& e); - static const std::string toString(const PerformAudioPassThru& e); - - static bool fromJSON(const Json::Value& s,PerformAudioPassThru& e); - static Json::Value toJSON(const PerformAudioPassThru& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponse.cpp deleted file mode 100644 index a622237d9..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponse.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/UI/PerformAudioPassThruResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -PerformAudioPassThruResponse& PerformAudioPassThruResponse::operator =(const PerformAudioPassThruResponse& c) -{ - return *this; -} - - -PerformAudioPassThruResponse::~PerformAudioPassThruResponse(void) -{ -} - - -PerformAudioPassThruResponse::PerformAudioPassThruResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMAUDIOPASSTHRURESPONSE) -{ -} - - -PerformAudioPassThruResponse::PerformAudioPassThruResponse(const PerformAudioPassThruResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMAUDIOPASSTHRURESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool PerformAudioPassThruResponse::checkIntegrity(void) -{ - return PerformAudioPassThruResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponseMarshaller.cpp deleted file mode 100644 index fef6ca726..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponseMarshaller.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/UI/PerformAudioPassThruResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/PerformAudioPassThruResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool PerformAudioPassThruResponseMarshaller::checkIntegrity(PerformAudioPassThruResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool PerformAudioPassThruResponseMarshaller::fromString(const std::string& s,PerformAudioPassThruResponse& 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 PerformAudioPassThruResponseMarshaller::toString(const PerformAudioPassThruResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool PerformAudioPassThruResponseMarshaller::checkIntegrityConst(const PerformAudioPassThruResponse& s) -{ - return true; -} - - -Json::Value PerformAudioPassThruResponseMarshaller::toJSON(const PerformAudioPassThruResponse& 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("UI.PerformAudioPassThruResponse"); - - return json; -} - - -bool PerformAudioPassThruResponseMarshaller::fromJSON(const Json::Value& json,PerformAudioPassThruResponse& 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("UI.PerformAudioPassThruResponse")) 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/UI/PerformAudioPassThruResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponseMarshaller.h deleted file mode 100644 index 45127eadb..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformAudioPassThruResponseMarshaller.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_UI_PERFORMAUDIOPASSTHRURESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_PERFORMAUDIOPASSTHRURESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/PerformAudioPassThruResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct PerformAudioPassThruResponseMarshaller - { - static bool checkIntegrity(PerformAudioPassThruResponse& e); - static bool checkIntegrityConst(const PerformAudioPassThruResponse& e); - - static bool fromString(const std::string& s,PerformAudioPassThruResponse& e); - static const std::string toString(const PerformAudioPassThruResponse& e); - - static bool fromJSON(const Json::Value& s,PerformAudioPassThruResponse& e); - static Json::Value toJSON(const PerformAudioPassThruResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteraction.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteraction.cpp deleted file mode 100644 index afd958da5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteraction.cpp +++ /dev/null @@ -1,221 +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/UI/PerformInteraction.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -PerformInteraction& PerformInteraction::operator =(const PerformInteraction& c) -{ - initialText=c.initialText; - initialPrompt=c.initialPrompt; - interactionMode=c.interactionMode; - interactionChoiceSetIDList=c.interactionChoiceSetIDList; - if(helpPrompt) delete helpPrompt; - helpPrompt= c.helpPrompt ? new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(c.helpPrompt[0]) : 0; - if(timeoutPrompt) delete timeoutPrompt; - timeoutPrompt= c.timeoutPrompt ? new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(c.timeoutPrompt[0]) : 0; - if(timeout) delete timeout; - timeout= c.timeout ? new unsigned int(c.timeout[0]) : 0; - if(vrHelp) delete vrHelp; - vrHelp= c.vrHelp ? new std::vector<NsSmartDeviceLinkRPCV2::VrHelpItem>(c.vrHelp[0]) : 0; - appId=c.appId; - return *this; -} - - -PerformInteraction::~PerformInteraction(void) -{ - if(helpPrompt) delete helpPrompt; - if(timeoutPrompt) delete timeoutPrompt; - if(timeout) delete timeout; - if(vrHelp) delete vrHelp; -} - - -PerformInteraction::PerformInteraction(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMINTERACTION), - helpPrompt(0), - timeoutPrompt(0), - timeout(0), - vrHelp(0) -{ -} - - -PerformInteraction::PerformInteraction(const PerformInteraction& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMINTERACTION,c.getId()) -{ - *this=c; -} - - -const std::string& PerformInteraction::get_initialText(void) -{ - return initialText; -} - -bool PerformInteraction::set_initialText(const std::string& initialText_) -{ - initialText=initialText_; - return true; -} - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& PerformInteraction::get_initialPrompt(void) -{ - return initialPrompt; -} - -bool PerformInteraction::set_initialPrompt(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& initialPrompt_) -{ - initialPrompt=initialPrompt_; - return true; -} - -const NsSmartDeviceLinkRPCV2::InteractionMode& PerformInteraction::get_interactionMode(void) -{ - return interactionMode; -} - -bool PerformInteraction::set_interactionMode(const NsSmartDeviceLinkRPCV2::InteractionMode& interactionMode_) -{ - interactionMode=interactionMode_; - return true; -} - -const std::vector< unsigned int>& PerformInteraction::get_interactionChoiceSetIDList(void) -{ - return interactionChoiceSetIDList; -} - -bool PerformInteraction::set_interactionChoiceSetIDList(const std::vector< unsigned int>& interactionChoiceSetIDList_) -{ - interactionChoiceSetIDList=interactionChoiceSetIDList_; - return true; -} - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>* PerformInteraction::get_helpPrompt(void) -{ - return helpPrompt; -} - -bool PerformInteraction::set_helpPrompt(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& helpPrompt_) -{ - if(helpPrompt) delete helpPrompt; - helpPrompt=new std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>(helpPrompt_); - return true; -} - -void PerformInteraction::reset_helpPrompt(void) -{ - if(helpPrompt) delete helpPrompt; - helpPrompt=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>* PerformInteraction::get_timeoutPrompt(void) -{ - return timeoutPrompt; -} - -bool PerformInteraction::set_timeoutPrompt(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& timeoutPrompt_) -{ - if(timeoutPrompt) delete timeoutPrompt; - timeoutPrompt=new std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>(timeoutPrompt_); - return true; -} - -void PerformInteraction::reset_timeoutPrompt(void) -{ - if(timeoutPrompt) delete timeoutPrompt; - timeoutPrompt=0; -} - -const unsigned int* PerformInteraction::get_timeout(void) -{ - return timeout; -} - -bool PerformInteraction::set_timeout(const unsigned int& timeout_) -{ - if(timeout) delete timeout; - timeout=new unsigned int(timeout_); - return true; -} - -void PerformInteraction::reset_timeout(void) -{ - if(timeout) delete timeout; - timeout=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::VrHelpItem>* PerformInteraction::get_vrHelp(void) -{ - return vrHelp; -} - -bool PerformInteraction::set_vrHelp(const std::vector< NsSmartDeviceLinkRPCV2::VrHelpItem>& vrHelp_) -{ - if(vrHelp) delete vrHelp; - vrHelp=new std::vector< NsSmartDeviceLinkRPCV2::VrHelpItem>(vrHelp_); - return true; -} - -void PerformInteraction::reset_vrHelp(void) -{ - if(vrHelp) delete vrHelp; - vrHelp=0; -} - -int PerformInteraction::get_appId(void) -{ - return appId; -} - -bool PerformInteraction::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool PerformInteraction::checkIntegrity(void) -{ - return PerformInteractionMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionMarshaller.cpp deleted file mode 100644 index 52b49e374..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionMarshaller.cpp +++ /dev/null @@ -1,324 +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/UI/PerformInteraction.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/InteractionModeMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/VrHelpItemMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/PerformInteractionMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool PerformInteractionMarshaller::checkIntegrity(PerformInteraction& s) -{ - return checkIntegrityConst(s); -} - - -bool PerformInteractionMarshaller::fromString(const std::string& s,PerformInteraction& 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 PerformInteractionMarshaller::toString(const PerformInteraction& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool PerformInteractionMarshaller::checkIntegrityConst(const PerformInteraction& s) -{ - if(s.initialText.length()>500) return false; - - { - unsigned int i=s.initialPrompt.size(); - if(i<1) return false; - if(i>100) return false; - } - - if(!NsSmartDeviceLinkRPCV2::InteractionModeMarshaller::checkIntegrityConst(s.interactionMode)) return false; - - { - unsigned int i=s.interactionChoiceSetIDList.size(); - if(i<1) return false; - if(i>100) return false; - while(i--) - { - if(s.interactionChoiceSetIDList[i]>2000000000) return false; - } - } - - if(s.helpPrompt) - { - unsigned int i=s.helpPrompt[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.timeoutPrompt) - { - unsigned int i=s.timeoutPrompt[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.timeout && (s.timeout[0]<5000 || s.timeout[0]>100000)) return false; - - if(s.vrHelp) - { - unsigned int i=s.vrHelp[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value PerformInteractionMarshaller::toJSON(const PerformInteraction& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.PerformInteraction"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["initialText"]=Json::Value(e.initialText);; - { - unsigned int i=e.initialPrompt.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.initialPrompt[i]); - - json["params"]["initialPrompt"]=j; - } - json["params"]["interactionMode"]=NsSmartDeviceLinkRPCV2::InteractionModeMarshaller::toJSON(e.interactionMode);; - { - unsigned int i=e.interactionChoiceSetIDList.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=Json::Value(e.interactionChoiceSetIDList[i]); - - json["params"]["interactionChoiceSetIDList"]=j; - } - if(e.helpPrompt) - { - unsigned int i=e.helpPrompt[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.helpPrompt[0][i]); - - json["params"]["helpPrompt"]=j; - } - if(e.timeoutPrompt) - { - unsigned int i=e.timeoutPrompt[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.timeoutPrompt[0][i]); - - json["params"]["timeoutPrompt"]=j; - } - if(e.timeout) - json["params"]["timeout"]=Json::Value(e.timeout[0]);; - if(e.vrHelp) - { - unsigned int i=e.vrHelp[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::VrHelpItemMarshaller::toJSON(e.vrHelp[0][i]); - - json["params"]["vrHelp"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool PerformInteractionMarshaller::fromJSON(const Json::Value& json,PerformInteraction& 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("UI.PerformInteraction")) 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("initialText") || !js["initialText"].isString()) return false; - c.initialText=js["initialText"].asString(); - if(c.initialText.length()>500) return false; - - if(!js.isMember("initialPrompt") || !js["initialPrompt"].isArray()) return false; - { - unsigned int i=js["initialPrompt"].size(); - if(i<1) return false; - if(i>100) return false; - c.initialPrompt.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::TTSChunk t; - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["initialPrompt"][i],t)) - return false; - c.initialPrompt[i]=t; - } - } - - if(!js.isMember("interactionMode") || !NsSmartDeviceLinkRPCV2::InteractionModeMarshaller::fromJSON(js["interactionMode"],c.interactionMode)) return false; - - if(!js.isMember("interactionChoiceSetIDList") || !js["interactionChoiceSetIDList"].isArray()) - return false; - { - c.interactionChoiceSetIDList.clear(); - unsigned int i=js["interactionChoiceSetIDList"].size(); - if(i<1) return false; - if(i>100) return false; - c.interactionChoiceSetIDList.resize(i); - while(i--) - { - if(!js["interactionChoiceSetIDList"][i].isInt()) - return false; - c.interactionChoiceSetIDList[i]=js["interactionChoiceSetIDList"][i].asInt(); - if(c.interactionChoiceSetIDList[i]>2000000000) return false; - - } - } - - - if(c.helpPrompt) delete c.helpPrompt; - c.helpPrompt=0; - if(js.isMember("helpPrompt")) - { - if(!js["helpPrompt"].isArray()) return false; - unsigned int i=js["helpPrompt"].size(); - if(i<1) return false; - if(i>100) return false; - - c.helpPrompt=new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(); - c.helpPrompt->resize(js["helpPrompt"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["helpPrompt"][i],c.helpPrompt[0][i])) return false; - } - - - if(c.timeoutPrompt) delete c.timeoutPrompt; - c.timeoutPrompt=0; - if(js.isMember("timeoutPrompt")) - { - if(!js["timeoutPrompt"].isArray()) return false; - unsigned int i=js["timeoutPrompt"].size(); - if(i<1) return false; - if(i>100) return false; - - c.timeoutPrompt=new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(); - c.timeoutPrompt->resize(js["timeoutPrompt"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["timeoutPrompt"][i],c.timeoutPrompt[0][i])) return false; - } - - - if(c.timeout) delete c.timeout; - c.timeout=0; - if(js.isMember("timeout")) - { - if(!js["timeout"].isInt()) return false; - c.timeout=new unsigned int(); - c.timeout[0]=js["timeout"].asInt(); - if(c.timeout[0]<5000 || c.timeout[0]>100000) return false; - - } - - if(c.vrHelp) delete c.vrHelp; - c.vrHelp=0; - if(js.isMember("vrHelp")) - { - if(!js["vrHelp"].isArray()) return false; - unsigned int i=js["vrHelp"].size(); - if(i<1) return false; - if(i>100) return false; - - c.vrHelp=new std::vector<NsSmartDeviceLinkRPCV2::VrHelpItem>(); - c.vrHelp->resize(js["vrHelp"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::VrHelpItemMarshaller::fromJSON(js["vrHelp"][i],c.vrHelp[0][i])) 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/UI/PerformInteractionMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionMarshaller.h deleted file mode 100644 index 32abde5e3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionMarshaller.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_UI_PERFORMINTERACTIONMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_PERFORMINTERACTIONMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/PerformInteraction.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct PerformInteractionMarshaller - { - static bool checkIntegrity(PerformInteraction& e); - static bool checkIntegrityConst(const PerformInteraction& e); - - static bool fromString(const std::string& s,PerformInteraction& e); - static const std::string toString(const PerformInteraction& e); - - static bool fromJSON(const Json::Value& s,PerformInteraction& e); - static Json::Value toJSON(const PerformInteraction& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponse.cpp deleted file mode 100644 index b357352ba..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponse.cpp +++ /dev/null @@ -1,117 +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/UI/PerformInteractionResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -PerformInteractionResponse& PerformInteractionResponse::operator =(const PerformInteractionResponse& c) -{ - if(choiceID) delete choiceID; - choiceID= c.choiceID ? new unsigned int(c.choiceID[0]) : 0; - if(triggerSource) delete triggerSource; - triggerSource= c.triggerSource ? new NsSmartDeviceLinkRPCV2::TriggerSource(c.triggerSource[0]) : 0; - return *this; -} - - -PerformInteractionResponse::~PerformInteractionResponse(void) -{ - if(choiceID) delete choiceID; - if(triggerSource) delete triggerSource; -} - - -PerformInteractionResponse::PerformInteractionResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMINTERACTIONRESPONSE), - choiceID(0), - triggerSource(0) -{ -} - - -PerformInteractionResponse::PerformInteractionResponse(const PerformInteractionResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__PERFORMINTERACTIONRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -const unsigned int* PerformInteractionResponse::get_choiceID(void) -{ - return choiceID; -} - -bool PerformInteractionResponse::set_choiceID(const unsigned int& choiceID_) -{ - if(choiceID) delete choiceID; - choiceID=new unsigned int(choiceID_); - return true; -} - -void PerformInteractionResponse::reset_choiceID(void) -{ - if(choiceID) delete choiceID; - choiceID=0; -} - -const NsSmartDeviceLinkRPCV2::TriggerSource* PerformInteractionResponse::get_triggerSource(void) -{ - return triggerSource; -} - -bool PerformInteractionResponse::set_triggerSource(const NsSmartDeviceLinkRPCV2::TriggerSource& triggerSource_) -{ - if(triggerSource) delete triggerSource; - triggerSource=new NsSmartDeviceLinkRPCV2::TriggerSource(triggerSource_); - return true; -} - -void PerformInteractionResponse::reset_triggerSource(void) -{ - if(triggerSource) delete triggerSource; - triggerSource=0; -} - -bool PerformInteractionResponse::checkIntegrity(void) -{ - return PerformInteractionResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponseMarshaller.cpp deleted file mode 100644 index 884377fe3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponseMarshaller.cpp +++ /dev/null @@ -1,155 +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/UI/PerformInteractionResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/TriggerSourceMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/PerformInteractionResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool PerformInteractionResponseMarshaller::checkIntegrity(PerformInteractionResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool PerformInteractionResponseMarshaller::fromString(const std::string& s,PerformInteractionResponse& 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 PerformInteractionResponseMarshaller::toString(const PerformInteractionResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool PerformInteractionResponseMarshaller::checkIntegrityConst(const PerformInteractionResponse& s) -{ - if(s.choiceID && (s.choiceID[0]>2000000000)) return false; - - if(s.triggerSource && (!NsSmartDeviceLinkRPCV2::TriggerSourceMarshaller::checkIntegrityConst(s.triggerSource[0]))) return false; - - return true; -} - - -Json::Value PerformInteractionResponseMarshaller::toJSON(const PerformInteractionResponse& 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("UI.PerformInteractionResponse"); - - if(e.choiceID) - json["result"]["choiceID"]=Json::Value(e.choiceID[0]);; - if(e.triggerSource) - json["result"]["triggerSource"]=NsSmartDeviceLinkRPCV2::TriggerSourceMarshaller::toJSON(e.triggerSource[0]);; - return json; -} - - -bool PerformInteractionResponseMarshaller::fromJSON(const Json::Value& json,PerformInteractionResponse& 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("UI.PerformInteractionResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(c.choiceID) delete c.choiceID; - c.choiceID=0; - if(js.isMember("choiceID")) - { - if(!js["choiceID"].isInt()) return false; - c.choiceID=new unsigned int(); - c.choiceID[0]=js["choiceID"].asInt(); - if(c.choiceID[0]>2000000000) return false; - - } - - if(c.triggerSource) delete c.triggerSource; - c.triggerSource=0; - if(js.isMember("triggerSource")) - { - c.triggerSource=new NsSmartDeviceLinkRPCV2::TriggerSource(); - if(!NsSmartDeviceLinkRPCV2::TriggerSourceMarshaller::fromJSON(js["triggerSource"],c.triggerSource[0])) return false; - } - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponseMarshaller.h deleted file mode 100644 index 19ff0387b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/PerformInteractionResponseMarshaller.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_UI_PERFORMINTERACTIONRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_PERFORMINTERACTIONRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/PerformInteractionResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct PerformInteractionResponseMarshaller - { - static bool checkIntegrity(PerformInteractionResponse& e); - static bool checkIntegrityConst(const PerformInteractionResponse& e); - - static bool fromString(const std::string& s,PerformInteractionResponse& e); - static const std::string toString(const PerformInteractionResponse& e); - - static bool fromJSON(const Json::Value& s,PerformInteractionResponse& e); - static Json::Value toJSON(const PerformInteractionResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalProperties.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalProperties.cpp deleted file mode 100644 index 01ee3bf89..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalProperties.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/UI/ResetGlobalProperties.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ResetGlobalProperties& ResetGlobalProperties::operator =(const ResetGlobalProperties& c) -{ - properties=c.properties; - appId=c.appId; - return *this; -} - - -ResetGlobalProperties::~ResetGlobalProperties(void) -{ -} - - -ResetGlobalProperties::ResetGlobalProperties(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__RESETGLOBALPROPERTIES) -{ -} - - -ResetGlobalProperties::ResetGlobalProperties(const ResetGlobalProperties& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__RESETGLOBALPROPERTIES,c.getId()) -{ - *this=c; -} - - -const std::vector< NsSmartDeviceLinkRPCV2::GlobalProperty>& ResetGlobalProperties::get_properties(void) -{ - return properties; -} - -bool ResetGlobalProperties::set_properties(const std::vector< NsSmartDeviceLinkRPCV2::GlobalProperty>& properties_) -{ - properties=properties_; - return true; -} - -int ResetGlobalProperties::get_appId(void) -{ - return appId; -} - -bool ResetGlobalProperties::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool ResetGlobalProperties::checkIntegrity(void) -{ - return ResetGlobalPropertiesMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesMarshaller.cpp deleted file mode 100644 index c66462c58..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesMarshaller.cpp +++ /dev/null @@ -1,153 +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/UI/ResetGlobalProperties.h" -#include "../src/SDLRPCObjectsImpl/V2/GlobalPropertyMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ResetGlobalPropertiesMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ResetGlobalPropertiesMarshaller::checkIntegrity(ResetGlobalProperties& s) -{ - return checkIntegrityConst(s); -} - - -bool ResetGlobalPropertiesMarshaller::fromString(const std::string& s,ResetGlobalProperties& 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 ResetGlobalPropertiesMarshaller::toString(const ResetGlobalProperties& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ResetGlobalPropertiesMarshaller::checkIntegrityConst(const ResetGlobalProperties& s) -{ - { - unsigned int i=s.properties.size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value ResetGlobalPropertiesMarshaller::toJSON(const ResetGlobalProperties& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.ResetGlobalProperties"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - { - unsigned int i=e.properties.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::GlobalPropertyMarshaller::toJSON(e.properties[i]); - - json["params"]["properties"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool ResetGlobalPropertiesMarshaller::fromJSON(const Json::Value& json,ResetGlobalProperties& 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("UI.ResetGlobalProperties")) 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("properties") || !js["properties"].isArray()) return false; - { - unsigned int i=js["properties"].size(); - if(i<1) return false; - if(i>100) return false; - c.properties.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::GlobalProperty t; - if(!NsSmartDeviceLinkRPCV2::GlobalPropertyMarshaller::fromJSON(js["properties"][i],t)) - return false; - c.properties[i]=t; - } - } - - 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/UI/ResetGlobalPropertiesMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesMarshaller.h deleted file mode 100644 index 4f0f41aee..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesMarshaller.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_UI_RESETGLOBALPROPERTIESMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_RESETGLOBALPROPERTIESMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ResetGlobalProperties.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ResetGlobalPropertiesMarshaller - { - static bool checkIntegrity(ResetGlobalProperties& e); - static bool checkIntegrityConst(const ResetGlobalProperties& e); - - static bool fromString(const std::string& s,ResetGlobalProperties& e); - static const std::string toString(const ResetGlobalProperties& e); - - static bool fromJSON(const Json::Value& s,ResetGlobalProperties& e); - static Json::Value toJSON(const ResetGlobalProperties& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponse.cpp deleted file mode 100644 index 4321d5c84..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponse.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/UI/ResetGlobalPropertiesResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ResetGlobalPropertiesResponse& ResetGlobalPropertiesResponse::operator =(const ResetGlobalPropertiesResponse& c) -{ - return *this; -} - - -ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse(void) -{ -} - - -ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__RESETGLOBALPROPERTIESRESPONSE) -{ -} - - -ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse(const ResetGlobalPropertiesResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__RESETGLOBALPROPERTIESRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool ResetGlobalPropertiesResponse::checkIntegrity(void) -{ - return ResetGlobalPropertiesResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponseMarshaller.cpp deleted file mode 100644 index a15c932d1..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponseMarshaller.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/UI/ResetGlobalPropertiesResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ResetGlobalPropertiesResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ResetGlobalPropertiesResponseMarshaller::checkIntegrity(ResetGlobalPropertiesResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool ResetGlobalPropertiesResponseMarshaller::fromString(const std::string& s,ResetGlobalPropertiesResponse& 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 ResetGlobalPropertiesResponseMarshaller::toString(const ResetGlobalPropertiesResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ResetGlobalPropertiesResponseMarshaller::checkIntegrityConst(const ResetGlobalPropertiesResponse& s) -{ - return true; -} - - -Json::Value ResetGlobalPropertiesResponseMarshaller::toJSON(const ResetGlobalPropertiesResponse& 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("UI.ResetGlobalPropertiesResponse"); - - return json; -} - - -bool ResetGlobalPropertiesResponseMarshaller::fromJSON(const Json::Value& json,ResetGlobalPropertiesResponse& 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("UI.ResetGlobalPropertiesResponse")) 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/UI/ResetGlobalPropertiesResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponseMarshaller.h deleted file mode 100644 index ade01a3ab..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ResetGlobalPropertiesResponseMarshaller.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_UI_RESETGLOBALPROPERTIESRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_RESETGLOBALPROPERTIESRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ResetGlobalPropertiesResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ResetGlobalPropertiesResponseMarshaller - { - static bool checkIntegrity(ResetGlobalPropertiesResponse& e); - static bool checkIntegrityConst(const ResetGlobalPropertiesResponse& e); - - static bool fromString(const std::string& s,ResetGlobalPropertiesResponse& e); - static const std::string toString(const ResetGlobalPropertiesResponse& e); - - static bool fromJSON(const Json::Value& s,ResetGlobalPropertiesResponse& e); - static Json::Value toJSON(const ResetGlobalPropertiesResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessage.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessage.cpp deleted file mode 100644 index 47bffe006..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessage.cpp +++ /dev/null @@ -1,141 +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/UI/ScrollableMessage.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ScrollableMessage& ScrollableMessage::operator =(const ScrollableMessage& c) -{ - scrollableMessageBody=c.scrollableMessageBody; - if(timeout) delete timeout; - timeout= c.timeout ? new unsigned int(c.timeout[0]) : 0; - if(softButtons) delete softButtons; - softButtons= c.softButtons ? new std::vector<NsSmartDeviceLinkRPCV2::SoftButton>(c.softButtons[0]) : 0; - appId=c.appId; - return *this; -} - - -ScrollableMessage::~ScrollableMessage(void) -{ - if(timeout) delete timeout; - if(softButtons) delete softButtons; -} - - -ScrollableMessage::ScrollableMessage(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SCROLLABLEMESSAGE), - timeout(0), - softButtons(0) -{ -} - - -ScrollableMessage::ScrollableMessage(const ScrollableMessage& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SCROLLABLEMESSAGE,c.getId()) -{ - *this=c; -} - - -const std::string& ScrollableMessage::get_scrollableMessageBody(void) -{ - return scrollableMessageBody; -} - -bool ScrollableMessage::set_scrollableMessageBody(const std::string& scrollableMessageBody_) -{ - scrollableMessageBody=scrollableMessageBody_; - return true; -} - -const unsigned int* ScrollableMessage::get_timeout(void) -{ - return timeout; -} - -bool ScrollableMessage::set_timeout(const unsigned int& timeout_) -{ - if(timeout) delete timeout; - timeout=new unsigned int(timeout_); - return true; -} - -void ScrollableMessage::reset_timeout(void) -{ - if(timeout) delete timeout; - timeout=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>* ScrollableMessage::get_softButtons(void) -{ - return softButtons; -} - -bool ScrollableMessage::set_softButtons(const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& softButtons_) -{ - if(softButtons) delete softButtons; - softButtons=new std::vector< NsSmartDeviceLinkRPCV2::SoftButton>(softButtons_); - return true; -} - -void ScrollableMessage::reset_softButtons(void) -{ - if(softButtons) delete softButtons; - softButtons=0; -} - -int ScrollableMessage::get_appId(void) -{ - return appId; -} - -bool ScrollableMessage::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool ScrollableMessage::checkIntegrity(void) -{ - return ScrollableMessageMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageMarshaller.cpp deleted file mode 100644 index b37f75f2f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageMarshaller.cpp +++ /dev/null @@ -1,179 +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/UI/ScrollableMessage.h" -#include "../src/SDLRPCObjectsImpl/V2/SoftButtonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ScrollableMessageMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ScrollableMessageMarshaller::checkIntegrity(ScrollableMessage& s) -{ - return checkIntegrityConst(s); -} - - -bool ScrollableMessageMarshaller::fromString(const std::string& s,ScrollableMessage& 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 ScrollableMessageMarshaller::toString(const ScrollableMessage& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ScrollableMessageMarshaller::checkIntegrityConst(const ScrollableMessage& s) -{ - if(s.scrollableMessageBody.length()>500) return false; - - if(s.timeout && (s.timeout[0]>65535)) return false; - - if(s.softButtons) - { - unsigned int i=s.softButtons[0].size(); - if(i<0) return false; - if(i>8) return false; - } - - return true; -} - - -Json::Value ScrollableMessageMarshaller::toJSON(const ScrollableMessage& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.ScrollableMessage"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["scrollableMessageBody"]=Json::Value(e.scrollableMessageBody);; - if(e.timeout) - json["params"]["timeout"]=Json::Value(e.timeout[0]);; - if(e.softButtons) - { - unsigned int i=e.softButtons[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::toJSON(e.softButtons[0][i]); - - json["params"]["softButtons"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool ScrollableMessageMarshaller::fromJSON(const Json::Value& json,ScrollableMessage& 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("UI.ScrollableMessage")) 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("scrollableMessageBody") || !js["scrollableMessageBody"].isString()) return false; - c.scrollableMessageBody=js["scrollableMessageBody"].asString(); - if(c.scrollableMessageBody.length()>500) return false; - - if(c.timeout) delete c.timeout; - c.timeout=0; - if(js.isMember("timeout")) - { - if(!js["timeout"].isInt()) return false; - c.timeout=new unsigned int(); - c.timeout[0]=js["timeout"].asInt(); - if(c.timeout[0]>65535) return false; - - } - - if(c.softButtons) delete c.softButtons; - c.softButtons=0; - if(js.isMember("softButtons")) - { - if(!js["softButtons"].isArray()) return false; - unsigned int i=js["softButtons"].size(); - if(i<0) return false; - if(i>8) return false; - - c.softButtons=new std::vector<NsSmartDeviceLinkRPCV2::SoftButton>(); - c.softButtons->resize(js["softButtons"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::fromJSON(js["softButtons"][i],c.softButtons[0][i])) 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/UI/ScrollableMessageMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageMarshaller.h deleted file mode 100644 index 9c5893b6a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageMarshaller.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_UI_SCROLLABLEMESSAGEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SCROLLABLEMESSAGEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ScrollableMessage.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ScrollableMessageMarshaller - { - static bool checkIntegrity(ScrollableMessage& e); - static bool checkIntegrityConst(const ScrollableMessage& e); - - static bool fromString(const std::string& s,ScrollableMessage& e); - static const std::string toString(const ScrollableMessage& e); - - static bool fromJSON(const Json::Value& s,ScrollableMessage& e); - static Json::Value toJSON(const ScrollableMessage& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponse.cpp deleted file mode 100644 index f624f26c4..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponse.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/UI/ScrollableMessageResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ScrollableMessageResponse& ScrollableMessageResponse::operator =(const ScrollableMessageResponse& c) -{ - return *this; -} - - -ScrollableMessageResponse::~ScrollableMessageResponse(void) -{ -} - - -ScrollableMessageResponse::ScrollableMessageResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SCROLLABLEMESSAGERESPONSE) -{ -} - - -ScrollableMessageResponse::ScrollableMessageResponse(const ScrollableMessageResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SCROLLABLEMESSAGERESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool ScrollableMessageResponse::checkIntegrity(void) -{ - return ScrollableMessageResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponseMarshaller.cpp deleted file mode 100644 index 805c766c5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponseMarshaller.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/UI/ScrollableMessageResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ScrollableMessageResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ScrollableMessageResponseMarshaller::checkIntegrity(ScrollableMessageResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool ScrollableMessageResponseMarshaller::fromString(const std::string& s,ScrollableMessageResponse& 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 ScrollableMessageResponseMarshaller::toString(const ScrollableMessageResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ScrollableMessageResponseMarshaller::checkIntegrityConst(const ScrollableMessageResponse& s) -{ - return true; -} - - -Json::Value ScrollableMessageResponseMarshaller::toJSON(const ScrollableMessageResponse& 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("UI.ScrollableMessageResponse"); - - return json; -} - - -bool ScrollableMessageResponseMarshaller::fromJSON(const Json::Value& json,ScrollableMessageResponse& 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("UI.ScrollableMessageResponse")) 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/UI/ScrollableMessageResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponseMarshaller.h deleted file mode 100644 index 8b24f7e9a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ScrollableMessageResponseMarshaller.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_UI_SCROLLABLEMESSAGERESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SCROLLABLEMESSAGERESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ScrollableMessageResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ScrollableMessageResponseMarshaller - { - static bool checkIntegrity(ScrollableMessageResponse& e); - static bool checkIntegrityConst(const ScrollableMessageResponse& e); - - static bool fromString(const std::string& s,ScrollableMessageResponse& e); - static const std::string toString(const ScrollableMessageResponse& e); - - static bool fromJSON(const Json::Value& s,ScrollableMessageResponse& e); - static Json::Value toJSON(const ScrollableMessageResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIcon.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIcon.cpp deleted file mode 100644 index 980d22391..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIcon.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/UI/SetAppIcon.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetAppIcon& SetAppIcon::operator =(const SetAppIcon& c) -{ - syncFileName=c.syncFileName; - appId=c.appId; - return *this; -} - - -SetAppIcon::~SetAppIcon(void) -{ -} - - -SetAppIcon::SetAppIcon(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETAPPICON) -{ -} - - -SetAppIcon::SetAppIcon(const SetAppIcon& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETAPPICON,c.getId()) -{ - *this=c; -} - - -const std::string& SetAppIcon::get_syncFileName(void) -{ - return syncFileName; -} - -bool SetAppIcon::set_syncFileName(const std::string& syncFileName_) -{ - syncFileName=syncFileName_; - return true; -} - -int SetAppIcon::get_appId(void) -{ - return appId; -} - -bool SetAppIcon::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool SetAppIcon::checkIntegrity(void) -{ - return SetAppIconMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconMarshaller.cpp deleted file mode 100644 index 42d468572..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconMarshaller.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetAppIcon.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetAppIconMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetAppIconMarshaller::checkIntegrity(SetAppIcon& s) -{ - return checkIntegrityConst(s); -} - - -bool SetAppIconMarshaller::fromString(const std::string& s,SetAppIcon& 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 SetAppIconMarshaller::toString(const SetAppIcon& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetAppIconMarshaller::checkIntegrityConst(const SetAppIcon& s) -{ - if(s.syncFileName.length()>500) return false; - - return true; -} - - -Json::Value SetAppIconMarshaller::toJSON(const SetAppIcon& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.SetAppIcon"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["syncFileName"]=Json::Value(e.syncFileName);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool SetAppIconMarshaller::fromJSON(const Json::Value& json,SetAppIcon& 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("UI.SetAppIcon")) 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("syncFileName") || !js["syncFileName"].isString()) return false; - c.syncFileName=js["syncFileName"].asString(); - if(c.syncFileName.length()>500) 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/UI/SetAppIconMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconMarshaller.h deleted file mode 100644 index 65f722b11..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconMarshaller.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_UI_SETAPPICONMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETAPPICONMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetAppIcon.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetAppIconMarshaller - { - static bool checkIntegrity(SetAppIcon& e); - static bool checkIntegrityConst(const SetAppIcon& e); - - static bool fromString(const std::string& s,SetAppIcon& e); - static const std::string toString(const SetAppIcon& e); - - static bool fromJSON(const Json::Value& s,SetAppIcon& e); - static Json::Value toJSON(const SetAppIcon& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponse.cpp deleted file mode 100644 index b0c0297c3..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponse.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/UI/SetAppIconResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetAppIconResponse& SetAppIconResponse::operator =(const SetAppIconResponse& c) -{ - return *this; -} - - -SetAppIconResponse::~SetAppIconResponse(void) -{ -} - - -SetAppIconResponse::SetAppIconResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETAPPICONRESPONSE) -{ -} - - -SetAppIconResponse::SetAppIconResponse(const SetAppIconResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETAPPICONRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool SetAppIconResponse::checkIntegrity(void) -{ - return SetAppIconResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponseMarshaller.cpp deleted file mode 100644 index fdb121213..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponseMarshaller.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/UI/SetAppIconResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetAppIconResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetAppIconResponseMarshaller::checkIntegrity(SetAppIconResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool SetAppIconResponseMarshaller::fromString(const std::string& s,SetAppIconResponse& 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 SetAppIconResponseMarshaller::toString(const SetAppIconResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetAppIconResponseMarshaller::checkIntegrityConst(const SetAppIconResponse& s) -{ - return true; -} - - -Json::Value SetAppIconResponseMarshaller::toJSON(const SetAppIconResponse& 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("UI.SetAppIconResponse"); - - return json; -} - - -bool SetAppIconResponseMarshaller::fromJSON(const Json::Value& json,SetAppIconResponse& 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("UI.SetAppIconResponse")) 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/UI/SetAppIconResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponseMarshaller.h deleted file mode 100644 index e749198f4..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetAppIconResponseMarshaller.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_UI_SETAPPICONRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETAPPICONRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetAppIconResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetAppIconResponseMarshaller - { - static bool checkIntegrity(SetAppIconResponse& e); - static bool checkIntegrityConst(const SetAppIconResponse& e); - - static bool fromString(const std::string& s,SetAppIconResponse& e); - static const std::string toString(const SetAppIconResponse& e); - - static bool fromJSON(const Json::Value& s,SetAppIconResponse& e); - static Json::Value toJSON(const SetAppIconResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayout.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayout.cpp deleted file mode 100644 index 898414601..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayout.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/UI/SetDisplayLayout.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetDisplayLayout& SetDisplayLayout::operator =(const SetDisplayLayout& c) -{ - displayLayout=c.displayLayout; - appId=c.appId; - return *this; -} - - -SetDisplayLayout::~SetDisplayLayout(void) -{ -} - - -SetDisplayLayout::SetDisplayLayout(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETDISPLAYLAYOUT) -{ -} - - -SetDisplayLayout::SetDisplayLayout(const SetDisplayLayout& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETDISPLAYLAYOUT,c.getId()) -{ - *this=c; -} - - -const std::string& SetDisplayLayout::get_displayLayout(void) -{ - return displayLayout; -} - -bool SetDisplayLayout::set_displayLayout(const std::string& displayLayout_) -{ - displayLayout=displayLayout_; - return true; -} - -int SetDisplayLayout::get_appId(void) -{ - return appId; -} - -bool SetDisplayLayout::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool SetDisplayLayout::checkIntegrity(void) -{ - return SetDisplayLayoutMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutMarshaller.cpp deleted file mode 100644 index 7a23e0e03..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutMarshaller.cpp +++ /dev/null @@ -1,126 +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/UI/SetDisplayLayout.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetDisplayLayoutMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetDisplayLayoutMarshaller::checkIntegrity(SetDisplayLayout& s) -{ - return checkIntegrityConst(s); -} - - -bool SetDisplayLayoutMarshaller::fromString(const std::string& s,SetDisplayLayout& 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 SetDisplayLayoutMarshaller::toString(const SetDisplayLayout& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetDisplayLayoutMarshaller::checkIntegrityConst(const SetDisplayLayout& s) -{ - return true; -} - - -Json::Value SetDisplayLayoutMarshaller::toJSON(const SetDisplayLayout& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.SetDisplayLayout"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["displayLayout"]=Json::Value(e.displayLayout);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool SetDisplayLayoutMarshaller::fromJSON(const Json::Value& json,SetDisplayLayout& 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("UI.SetDisplayLayout")) 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("displayLayout") || !js["displayLayout"].isString()) return false; - c.displayLayout=js["displayLayout"].asString(); - - 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/UI/SetDisplayLayoutMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutMarshaller.h deleted file mode 100644 index 40d879096..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutMarshaller.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_UI_SETDISPLAYLAYOUTMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETDISPLAYLAYOUTMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetDisplayLayout.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetDisplayLayoutMarshaller - { - static bool checkIntegrity(SetDisplayLayout& e); - static bool checkIntegrityConst(const SetDisplayLayout& e); - - static bool fromString(const std::string& s,SetDisplayLayout& e); - static const std::string toString(const SetDisplayLayout& e); - - static bool fromJSON(const Json::Value& s,SetDisplayLayout& e); - static Json::Value toJSON(const SetDisplayLayout& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponse.cpp deleted file mode 100644 index 79b35a1d2..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponse.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/UI/SetDisplayLayoutResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetDisplayLayoutResponse& SetDisplayLayoutResponse::operator =(const SetDisplayLayoutResponse& c) -{ - return *this; -} - - -SetDisplayLayoutResponse::~SetDisplayLayoutResponse(void) -{ -} - - -SetDisplayLayoutResponse::SetDisplayLayoutResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETDISPLAYLAYOUTRESPONSE) -{ -} - - -SetDisplayLayoutResponse::SetDisplayLayoutResponse(const SetDisplayLayoutResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETDISPLAYLAYOUTRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool SetDisplayLayoutResponse::checkIntegrity(void) -{ - return SetDisplayLayoutResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponseMarshaller.cpp deleted file mode 100644 index dd52e08f7..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponseMarshaller.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/UI/SetDisplayLayoutResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetDisplayLayoutResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetDisplayLayoutResponseMarshaller::checkIntegrity(SetDisplayLayoutResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool SetDisplayLayoutResponseMarshaller::fromString(const std::string& s,SetDisplayLayoutResponse& 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 SetDisplayLayoutResponseMarshaller::toString(const SetDisplayLayoutResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetDisplayLayoutResponseMarshaller::checkIntegrityConst(const SetDisplayLayoutResponse& s) -{ - return true; -} - - -Json::Value SetDisplayLayoutResponseMarshaller::toJSON(const SetDisplayLayoutResponse& 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("UI.SetDisplayLayoutResponse"); - - return json; -} - - -bool SetDisplayLayoutResponseMarshaller::fromJSON(const Json::Value& json,SetDisplayLayoutResponse& 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("UI.SetDisplayLayoutResponse")) 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/UI/SetDisplayLayoutResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponseMarshaller.h deleted file mode 100644 index 9e8e25a92..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetDisplayLayoutResponseMarshaller.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_UI_SETDISPLAYLAYOUTRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETDISPLAYLAYOUTRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetDisplayLayoutResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetDisplayLayoutResponseMarshaller - { - static bool checkIntegrity(SetDisplayLayoutResponse& e); - static bool checkIntegrityConst(const SetDisplayLayoutResponse& e); - - static bool fromString(const std::string& s,SetDisplayLayoutResponse& e); - static const std::string toString(const SetDisplayLayoutResponse& e); - - static bool fromJSON(const Json::Value& s,SetDisplayLayoutResponse& e); - static Json::Value toJSON(const SetDisplayLayoutResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalProperties.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalProperties.cpp deleted file mode 100644 index ed014c13e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalProperties.cpp +++ /dev/null @@ -1,173 +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/UI/SetGlobalProperties.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetGlobalProperties& SetGlobalProperties::operator =(const SetGlobalProperties& c) -{ - if(helpPrompt) delete helpPrompt; - helpPrompt= c.helpPrompt ? new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(c.helpPrompt[0]) : 0; - if(timeoutPrompt) delete timeoutPrompt; - timeoutPrompt= c.timeoutPrompt ? new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(c.timeoutPrompt[0]) : 0; - if(vrHelpTitle) delete vrHelpTitle; - vrHelpTitle= c.vrHelpTitle ? new std::string(c.vrHelpTitle[0]) : 0; - if(vrHelp) delete vrHelp; - vrHelp= c.vrHelp ? new std::vector<NsSmartDeviceLinkRPCV2::VrHelpItem>(c.vrHelp[0]) : 0; - appId=c.appId; - return *this; -} - - -SetGlobalProperties::~SetGlobalProperties(void) -{ - if(helpPrompt) delete helpPrompt; - if(timeoutPrompt) delete timeoutPrompt; - if(vrHelpTitle) delete vrHelpTitle; - if(vrHelp) delete vrHelp; -} - - -SetGlobalProperties::SetGlobalProperties(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETGLOBALPROPERTIES), - helpPrompt(0), - timeoutPrompt(0), - vrHelpTitle(0), - vrHelp(0) -{ -} - - -SetGlobalProperties::SetGlobalProperties(const SetGlobalProperties& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETGLOBALPROPERTIES,c.getId()) -{ - *this=c; -} - - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>* SetGlobalProperties::get_helpPrompt(void) -{ - return helpPrompt; -} - -bool SetGlobalProperties::set_helpPrompt(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& helpPrompt_) -{ - if(helpPrompt) delete helpPrompt; - helpPrompt=new std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>(helpPrompt_); - return true; -} - -void SetGlobalProperties::reset_helpPrompt(void) -{ - if(helpPrompt) delete helpPrompt; - helpPrompt=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>* SetGlobalProperties::get_timeoutPrompt(void) -{ - return timeoutPrompt; -} - -bool SetGlobalProperties::set_timeoutPrompt(const std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>& timeoutPrompt_) -{ - if(timeoutPrompt) delete timeoutPrompt; - timeoutPrompt=new std::vector< NsSmartDeviceLinkRPCV2::TTSChunk>(timeoutPrompt_); - return true; -} - -void SetGlobalProperties::reset_timeoutPrompt(void) -{ - if(timeoutPrompt) delete timeoutPrompt; - timeoutPrompt=0; -} - -const std::string* SetGlobalProperties::get_vrHelpTitle(void) -{ - return vrHelpTitle; -} - -bool SetGlobalProperties::set_vrHelpTitle(const std::string& vrHelpTitle_) -{ - if(vrHelpTitle) delete vrHelpTitle; - vrHelpTitle=new std::string(vrHelpTitle_); - return true; -} - -void SetGlobalProperties::reset_vrHelpTitle(void) -{ - if(vrHelpTitle) delete vrHelpTitle; - vrHelpTitle=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::VrHelpItem>* SetGlobalProperties::get_vrHelp(void) -{ - return vrHelp; -} - -bool SetGlobalProperties::set_vrHelp(const std::vector< NsSmartDeviceLinkRPCV2::VrHelpItem>& vrHelp_) -{ - if(vrHelp) delete vrHelp; - vrHelp=new std::vector< NsSmartDeviceLinkRPCV2::VrHelpItem>(vrHelp_); - return true; -} - -void SetGlobalProperties::reset_vrHelp(void) -{ - if(vrHelp) delete vrHelp; - vrHelp=0; -} - -int SetGlobalProperties::get_appId(void) -{ - return appId; -} - -bool SetGlobalProperties::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool SetGlobalProperties::checkIntegrity(void) -{ - return SetGlobalPropertiesMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesMarshaller.cpp deleted file mode 100644 index 49e0df40a..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesMarshaller.cpp +++ /dev/null @@ -1,242 +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/UI/SetGlobalProperties.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/TTSChunkMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/VrHelpItemMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetGlobalPropertiesMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetGlobalPropertiesMarshaller::checkIntegrity(SetGlobalProperties& s) -{ - return checkIntegrityConst(s); -} - - -bool SetGlobalPropertiesMarshaller::fromString(const std::string& s,SetGlobalProperties& 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 SetGlobalPropertiesMarshaller::toString(const SetGlobalProperties& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetGlobalPropertiesMarshaller::checkIntegrityConst(const SetGlobalProperties& s) -{ - if(s.helpPrompt) - { - unsigned int i=s.helpPrompt[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.timeoutPrompt) - { - unsigned int i=s.timeoutPrompt[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - if(s.vrHelpTitle && (s.vrHelpTitle[0].length()>500)) return false; - - if(s.vrHelp) - { - unsigned int i=s.vrHelp[0].size(); - if(i<1) return false; - if(i>100) return false; - } - - return true; -} - - -Json::Value SetGlobalPropertiesMarshaller::toJSON(const SetGlobalProperties& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.SetGlobalProperties"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - if(e.helpPrompt) - { - unsigned int i=e.helpPrompt[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.helpPrompt[0][i]); - - json["params"]["helpPrompt"]=j; - } - if(e.timeoutPrompt) - { - unsigned int i=e.timeoutPrompt[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::toJSON(e.timeoutPrompt[0][i]); - - json["params"]["timeoutPrompt"]=j; - } - if(e.vrHelpTitle) - json["params"]["vrHelpTitle"]=Json::Value(e.vrHelpTitle[0]);; - if(e.vrHelp) - { - unsigned int i=e.vrHelp[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::VrHelpItemMarshaller::toJSON(e.vrHelp[0][i]); - - json["params"]["vrHelp"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool SetGlobalPropertiesMarshaller::fromJSON(const Json::Value& json,SetGlobalProperties& 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("UI.SetGlobalProperties")) 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(c.helpPrompt) delete c.helpPrompt; - c.helpPrompt=0; - if(js.isMember("helpPrompt")) - { - if(!js["helpPrompt"].isArray()) return false; - unsigned int i=js["helpPrompt"].size(); - if(i<1) return false; - if(i>100) return false; - - c.helpPrompt=new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(); - c.helpPrompt->resize(js["helpPrompt"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["helpPrompt"][i],c.helpPrompt[0][i])) return false; - } - - - if(c.timeoutPrompt) delete c.timeoutPrompt; - c.timeoutPrompt=0; - if(js.isMember("timeoutPrompt")) - { - if(!js["timeoutPrompt"].isArray()) return false; - unsigned int i=js["timeoutPrompt"].size(); - if(i<1) return false; - if(i>100) return false; - - c.timeoutPrompt=new std::vector<NsSmartDeviceLinkRPCV2::TTSChunk>(); - c.timeoutPrompt->resize(js["timeoutPrompt"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::TTSChunkMarshaller::fromJSON(js["timeoutPrompt"][i],c.timeoutPrompt[0][i])) return false; - } - - - if(c.vrHelpTitle) delete c.vrHelpTitle; - c.vrHelpTitle=0; - if(js.isMember("vrHelpTitle")) - { - if(!js["vrHelpTitle"].isString()) return false; - c.vrHelpTitle=new std::string(); - c.vrHelpTitle[0]=js["vrHelpTitle"].asString(); - if(c.vrHelpTitle[0].length()>500) return false; - - } - - if(c.vrHelp) delete c.vrHelp; - c.vrHelp=0; - if(js.isMember("vrHelp")) - { - if(!js["vrHelp"].isArray()) return false; - unsigned int i=js["vrHelp"].size(); - if(i<1) return false; - if(i>100) return false; - - c.vrHelp=new std::vector<NsSmartDeviceLinkRPCV2::VrHelpItem>(); - c.vrHelp->resize(js["vrHelp"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::VrHelpItemMarshaller::fromJSON(js["vrHelp"][i],c.vrHelp[0][i])) 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/UI/SetGlobalPropertiesMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesMarshaller.h deleted file mode 100644 index f61f004ad..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesMarshaller.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_UI_SETGLOBALPROPERTIESMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETGLOBALPROPERTIESMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetGlobalProperties.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetGlobalPropertiesMarshaller - { - static bool checkIntegrity(SetGlobalProperties& e); - static bool checkIntegrityConst(const SetGlobalProperties& e); - - static bool fromString(const std::string& s,SetGlobalProperties& e); - static const std::string toString(const SetGlobalProperties& e); - - static bool fromJSON(const Json::Value& s,SetGlobalProperties& e); - static Json::Value toJSON(const SetGlobalProperties& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponse.cpp deleted file mode 100644 index 302d7b667..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponse.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/UI/SetGlobalPropertiesResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetGlobalPropertiesResponse& SetGlobalPropertiesResponse::operator =(const SetGlobalPropertiesResponse& c) -{ - return *this; -} - - -SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse(void) -{ -} - - -SetGlobalPropertiesResponse::SetGlobalPropertiesResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETGLOBALPROPERTIESRESPONSE) -{ -} - - -SetGlobalPropertiesResponse::SetGlobalPropertiesResponse(const SetGlobalPropertiesResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETGLOBALPROPERTIESRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool SetGlobalPropertiesResponse::checkIntegrity(void) -{ - return SetGlobalPropertiesResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponseMarshaller.cpp deleted file mode 100644 index 653429e20..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponseMarshaller.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/UI/SetGlobalPropertiesResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetGlobalPropertiesResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetGlobalPropertiesResponseMarshaller::checkIntegrity(SetGlobalPropertiesResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool SetGlobalPropertiesResponseMarshaller::fromString(const std::string& s,SetGlobalPropertiesResponse& 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 SetGlobalPropertiesResponseMarshaller::toString(const SetGlobalPropertiesResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetGlobalPropertiesResponseMarshaller::checkIntegrityConst(const SetGlobalPropertiesResponse& s) -{ - return true; -} - - -Json::Value SetGlobalPropertiesResponseMarshaller::toJSON(const SetGlobalPropertiesResponse& 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("UI.SetGlobalPropertiesResponse"); - - return json; -} - - -bool SetGlobalPropertiesResponseMarshaller::fromJSON(const Json::Value& json,SetGlobalPropertiesResponse& 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("UI.SetGlobalPropertiesResponse")) 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/UI/SetGlobalPropertiesResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponseMarshaller.h deleted file mode 100644 index 5c0828dad..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetGlobalPropertiesResponseMarshaller.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_UI_SETGLOBALPROPERTIESRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETGLOBALPROPERTIESRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetGlobalPropertiesResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetGlobalPropertiesResponseMarshaller - { - static bool checkIntegrity(SetGlobalPropertiesResponse& e); - static bool checkIntegrityConst(const SetGlobalPropertiesResponse& e); - - static bool fromString(const std::string& s,SetGlobalPropertiesResponse& e); - static const std::string toString(const SetGlobalPropertiesResponse& e); - - static bool fromJSON(const Json::Value& s,SetGlobalPropertiesResponse& e); - static Json::Value toJSON(const SetGlobalPropertiesResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimer.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimer.cpp deleted file mode 100644 index 4c51da9af..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimer.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetMediaClockTimer.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetMediaClockTimer& SetMediaClockTimer::operator =(const SetMediaClockTimer& c) -{ - if(startTime) delete startTime; - startTime= c.startTime ? new NsSmartDeviceLinkRPCV2::StartTime(c.startTime[0]) : 0; - updateMode=c.updateMode; - appId=c.appId; - return *this; -} - - -SetMediaClockTimer::~SetMediaClockTimer(void) -{ - if(startTime) delete startTime; -} - - -SetMediaClockTimer::SetMediaClockTimer(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETMEDIACLOCKTIMER), - startTime(0) -{ -} - - -SetMediaClockTimer::SetMediaClockTimer(const SetMediaClockTimer& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETMEDIACLOCKTIMER,c.getId()) -{ - *this=c; -} - - -const NsSmartDeviceLinkRPCV2::StartTime* SetMediaClockTimer::get_startTime(void) -{ - return startTime; -} - -bool SetMediaClockTimer::set_startTime(const NsSmartDeviceLinkRPCV2::StartTime& startTime_) -{ - if(startTime) delete startTime; - startTime=new NsSmartDeviceLinkRPCV2::StartTime(startTime_); - return true; -} - -void SetMediaClockTimer::reset_startTime(void) -{ - if(startTime) delete startTime; - startTime=0; -} - -const NsSmartDeviceLinkRPCV2::UpdateMode& SetMediaClockTimer::get_updateMode(void) -{ - return updateMode; -} - -bool SetMediaClockTimer::set_updateMode(const NsSmartDeviceLinkRPCV2::UpdateMode& updateMode_) -{ - updateMode=updateMode_; - return true; -} - -int SetMediaClockTimer::get_appId(void) -{ - return appId; -} - -bool SetMediaClockTimer::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool SetMediaClockTimer::checkIntegrity(void) -{ - return SetMediaClockTimerMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerMarshaller.cpp deleted file mode 100644 index 08c6b4c5d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerMarshaller.cpp +++ /dev/null @@ -1,141 +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/UI/SetMediaClockTimer.h" -#include "../src/SDLRPCObjectsImpl/V2/StartTimeMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/UpdateModeMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetMediaClockTimerMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetMediaClockTimerMarshaller::checkIntegrity(SetMediaClockTimer& s) -{ - return checkIntegrityConst(s); -} - - -bool SetMediaClockTimerMarshaller::fromString(const std::string& s,SetMediaClockTimer& 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 SetMediaClockTimerMarshaller::toString(const SetMediaClockTimer& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetMediaClockTimerMarshaller::checkIntegrityConst(const SetMediaClockTimer& s) -{ - if(s.startTime && (!NsSmartDeviceLinkRPCV2::StartTimeMarshaller::checkIntegrityConst(s.startTime[0]))) return false; - - if(!NsSmartDeviceLinkRPCV2::UpdateModeMarshaller::checkIntegrityConst(s.updateMode)) return false; - - return true; -} - - -Json::Value SetMediaClockTimerMarshaller::toJSON(const SetMediaClockTimer& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.SetMediaClockTimer"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - if(e.startTime) - json["params"]["startTime"]=NsSmartDeviceLinkRPCV2::StartTimeMarshaller::toJSON(e.startTime[0]);; - json["params"]["updateMode"]=NsSmartDeviceLinkRPCV2::UpdateModeMarshaller::toJSON(e.updateMode);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool SetMediaClockTimerMarshaller::fromJSON(const Json::Value& json,SetMediaClockTimer& 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("UI.SetMediaClockTimer")) 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(c.startTime) delete c.startTime; - c.startTime=0; - if(js.isMember("startTime")) - { - c.startTime=new NsSmartDeviceLinkRPCV2::StartTime(); - if(!NsSmartDeviceLinkRPCV2::StartTimeMarshaller::fromJSON(js["startTime"],c.startTime[0])) return false; - } - - if(!js.isMember("updateMode") || !NsSmartDeviceLinkRPCV2::UpdateModeMarshaller::fromJSON(js["updateMode"],c.updateMode)) 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/UI/SetMediaClockTimerMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerMarshaller.h deleted file mode 100644 index b6efc75da..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerMarshaller.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_UI_SETMEDIACLOCKTIMERMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETMEDIACLOCKTIMERMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetMediaClockTimer.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetMediaClockTimerMarshaller - { - static bool checkIntegrity(SetMediaClockTimer& e); - static bool checkIntegrityConst(const SetMediaClockTimer& e); - - static bool fromString(const std::string& s,SetMediaClockTimer& e); - static const std::string toString(const SetMediaClockTimer& e); - - static bool fromJSON(const Json::Value& s,SetMediaClockTimer& e); - static Json::Value toJSON(const SetMediaClockTimer& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponse.cpp deleted file mode 100644 index 7f3a4504b..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponse.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/UI/SetMediaClockTimerResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SetMediaClockTimerResponse& SetMediaClockTimerResponse::operator =(const SetMediaClockTimerResponse& c) -{ - return *this; -} - - -SetMediaClockTimerResponse::~SetMediaClockTimerResponse(void) -{ -} - - -SetMediaClockTimerResponse::SetMediaClockTimerResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETMEDIACLOCKTIMERRESPONSE) -{ -} - - -SetMediaClockTimerResponse::SetMediaClockTimerResponse(const SetMediaClockTimerResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SETMEDIACLOCKTIMERRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool SetMediaClockTimerResponse::checkIntegrity(void) -{ - return SetMediaClockTimerResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponseMarshaller.cpp deleted file mode 100644 index 9ab8aa7ea..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponseMarshaller.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/UI/SetMediaClockTimerResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SetMediaClockTimerResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SetMediaClockTimerResponseMarshaller::checkIntegrity(SetMediaClockTimerResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool SetMediaClockTimerResponseMarshaller::fromString(const std::string& s,SetMediaClockTimerResponse& 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 SetMediaClockTimerResponseMarshaller::toString(const SetMediaClockTimerResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SetMediaClockTimerResponseMarshaller::checkIntegrityConst(const SetMediaClockTimerResponse& s) -{ - return true; -} - - -Json::Value SetMediaClockTimerResponseMarshaller::toJSON(const SetMediaClockTimerResponse& 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("UI.SetMediaClockTimerResponse"); - - return json; -} - - -bool SetMediaClockTimerResponseMarshaller::fromJSON(const Json::Value& json,SetMediaClockTimerResponse& 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("UI.SetMediaClockTimerResponse")) 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/UI/SetMediaClockTimerResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponseMarshaller.h deleted file mode 100644 index 16a912e29..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SetMediaClockTimerResponseMarshaller.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_UI_SETMEDIACLOCKTIMERRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SETMEDIACLOCKTIMERRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SetMediaClockTimerResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SetMediaClockTimerResponseMarshaller - { - static bool checkIntegrity(SetMediaClockTimerResponse& e); - static bool checkIntegrityConst(const SetMediaClockTimerResponse& e); - - static bool fromString(const std::string& s,SetMediaClockTimerResponse& e); - static const std::string toString(const SetMediaClockTimerResponse& e); - - static bool fromJSON(const Json::Value& s,SetMediaClockTimerResponse& e); - static Json::Value toJSON(const SetMediaClockTimerResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Show.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Show.cpp deleted file mode 100644 index d518a8af5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Show.cpp +++ /dev/null @@ -1,327 +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/UI/Show.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -Show& Show::operator =(const Show& c) -{ - if(mainField1) delete mainField1; - mainField1= c.mainField1 ? new std::string(c.mainField1[0]) : 0; - if(mainField2) delete mainField2; - mainField2= c.mainField2 ? new std::string(c.mainField2[0]) : 0; - if(mainField3) delete mainField3; - mainField3= c.mainField3 ? new std::string(c.mainField3[0]) : 0; - if(mainField4) delete mainField4; - mainField4= c.mainField4 ? new std::string(c.mainField4[0]) : 0; - if(alignment) delete alignment; - alignment= c.alignment ? new NsSmartDeviceLinkRPCV2::TextAlignment(c.alignment[0]) : 0; - if(statusBar) delete statusBar; - statusBar= c.statusBar ? new std::string(c.statusBar[0]) : 0; - if(mediaClock) delete mediaClock; - mediaClock= c.mediaClock ? new std::string(c.mediaClock[0]) : 0; - if(mediaTrack) delete mediaTrack; - mediaTrack= c.mediaTrack ? new std::string(c.mediaTrack[0]) : 0; - if(graphic) delete graphic; - graphic= c.graphic ? new NsSmartDeviceLinkRPCV2::Image(c.graphic[0]) : 0; - if(softButtons) delete softButtons; - softButtons= c.softButtons ? new std::vector<NsSmartDeviceLinkRPCV2::SoftButton>(c.softButtons[0]) : 0; - if(customPresets) delete customPresets; - customPresets= c.customPresets ? new std::vector<std::string>(c.customPresets[0]) : 0; - appId=c.appId; - return *this; -} - - -Show::~Show(void) -{ - if(mainField1) delete mainField1; - if(mainField2) delete mainField2; - if(mainField3) delete mainField3; - if(mainField4) delete mainField4; - if(alignment) delete alignment; - if(statusBar) delete statusBar; - if(mediaClock) delete mediaClock; - if(mediaTrack) delete mediaTrack; - if(graphic) delete graphic; - if(softButtons) delete softButtons; - if(customPresets) delete customPresets; -} - - -Show::Show(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOW), - mainField1(0), - mainField2(0), - mainField3(0), - mainField4(0), - alignment(0), - statusBar(0), - mediaClock(0), - mediaTrack(0), - graphic(0), - softButtons(0), - customPresets(0) -{ -} - - -Show::Show(const Show& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOW,c.getId()) -{ - *this=c; -} - - -const std::string* Show::get_mainField1(void) -{ - return mainField1; -} - -bool Show::set_mainField1(const std::string& mainField1_) -{ - if(mainField1) delete mainField1; - mainField1=new std::string(mainField1_); - return true; -} - -void Show::reset_mainField1(void) -{ - if(mainField1) delete mainField1; - mainField1=0; -} - -const std::string* Show::get_mainField2(void) -{ - return mainField2; -} - -bool Show::set_mainField2(const std::string& mainField2_) -{ - if(mainField2) delete mainField2; - mainField2=new std::string(mainField2_); - return true; -} - -void Show::reset_mainField2(void) -{ - if(mainField2) delete mainField2; - mainField2=0; -} - -const std::string* Show::get_mainField3(void) -{ - return mainField3; -} - -bool Show::set_mainField3(const std::string& mainField3_) -{ - if(mainField3) delete mainField3; - mainField3=new std::string(mainField3_); - return true; -} - -void Show::reset_mainField3(void) -{ - if(mainField3) delete mainField3; - mainField3=0; -} - -const std::string* Show::get_mainField4(void) -{ - return mainField4; -} - -bool Show::set_mainField4(const std::string& mainField4_) -{ - if(mainField4) delete mainField4; - mainField4=new std::string(mainField4_); - return true; -} - -void Show::reset_mainField4(void) -{ - if(mainField4) delete mainField4; - mainField4=0; -} - -const NsSmartDeviceLinkRPCV2::TextAlignment* Show::get_alignment(void) -{ - return alignment; -} - -bool Show::set_alignment(const NsSmartDeviceLinkRPCV2::TextAlignment& alignment_) -{ - if(alignment) delete alignment; - alignment=new NsSmartDeviceLinkRPCV2::TextAlignment(alignment_); - return true; -} - -void Show::reset_alignment(void) -{ - if(alignment) delete alignment; - alignment=0; -} - -const std::string* Show::get_statusBar(void) -{ - return statusBar; -} - -bool Show::set_statusBar(const std::string& statusBar_) -{ - if(statusBar) delete statusBar; - statusBar=new std::string(statusBar_); - return true; -} - -void Show::reset_statusBar(void) -{ - if(statusBar) delete statusBar; - statusBar=0; -} - -const std::string* Show::get_mediaClock(void) -{ - return mediaClock; -} - -bool Show::set_mediaClock(const std::string& mediaClock_) -{ - if(mediaClock) delete mediaClock; - mediaClock=new std::string(mediaClock_); - return true; -} - -void Show::reset_mediaClock(void) -{ - if(mediaClock) delete mediaClock; - mediaClock=0; -} - -const std::string* Show::get_mediaTrack(void) -{ - return mediaTrack; -} - -bool Show::set_mediaTrack(const std::string& mediaTrack_) -{ - if(mediaTrack) delete mediaTrack; - mediaTrack=new std::string(mediaTrack_); - return true; -} - -void Show::reset_mediaTrack(void) -{ - if(mediaTrack) delete mediaTrack; - mediaTrack=0; -} - -const NsSmartDeviceLinkRPCV2::Image* Show::get_graphic(void) -{ - return graphic; -} - -bool Show::set_graphic(const NsSmartDeviceLinkRPCV2::Image& graphic_) -{ - if(graphic) delete graphic; - graphic=new NsSmartDeviceLinkRPCV2::Image(graphic_); - return true; -} - -void Show::reset_graphic(void) -{ - if(graphic) delete graphic; - graphic=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>* Show::get_softButtons(void) -{ - return softButtons; -} - -bool Show::set_softButtons(const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& softButtons_) -{ - if(softButtons) delete softButtons; - softButtons=new std::vector< NsSmartDeviceLinkRPCV2::SoftButton>(softButtons_); - return true; -} - -void Show::reset_softButtons(void) -{ - if(softButtons) delete softButtons; - softButtons=0; -} - -const std::vector< std::string>* Show::get_customPresets(void) -{ - return customPresets; -} - -bool Show::set_customPresets(const std::vector< std::string>& customPresets_) -{ - if(customPresets) delete customPresets; - customPresets=new std::vector< std::string>(customPresets_); - return true; -} - -void Show::reset_customPresets(void) -{ - if(customPresets) delete customPresets; - customPresets=0; -} - -int Show::get_appId(void) -{ - return appId; -} - -bool Show::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool Show::checkIntegrity(void) -{ - return ShowMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBT.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBT.cpp deleted file mode 100644 index 255f1e16d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBT.cpp +++ /dev/null @@ -1,243 +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/UI/ShowConstantTBT.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ShowConstantTBT& ShowConstantTBT::operator =(const ShowConstantTBT& c) -{ - if(navigationText1) delete navigationText1; - navigationText1= c.navigationText1 ? new std::string(c.navigationText1[0]) : 0; - if(navigationText2) delete navigationText2; - navigationText2= c.navigationText2 ? new std::string(c.navigationText2[0]) : 0; - if(eta) delete eta; - eta= c.eta ? new std::string(c.eta[0]) : 0; - if(totalDistance) delete totalDistance; - totalDistance= c.totalDistance ? new std::string(c.totalDistance[0]) : 0; - turnIcon=c.turnIcon; - distanceToManeuver=c.distanceToManeuver; - distanceToManeuverScale=c.distanceToManeuverScale; - if(maneuverComplete) delete maneuverComplete; - maneuverComplete= c.maneuverComplete ? new bool(c.maneuverComplete[0]) : 0; - softButtons=c.softButtons; - appId=c.appId; - return *this; -} - - -ShowConstantTBT::~ShowConstantTBT(void) -{ - if(navigationText1) delete navigationText1; - if(navigationText2) delete navigationText2; - if(eta) delete eta; - if(totalDistance) delete totalDistance; - if(maneuverComplete) delete maneuverComplete; -} - - -ShowConstantTBT::ShowConstantTBT(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOWCONSTANTTBT), - navigationText1(0), - navigationText2(0), - eta(0), - totalDistance(0), - maneuverComplete(0) -{ -} - - -ShowConstantTBT::ShowConstantTBT(const ShowConstantTBT& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOWCONSTANTTBT,c.getId()) -{ - *this=c; -} - - -const std::string* ShowConstantTBT::get_navigationText1(void) -{ - return navigationText1; -} - -bool ShowConstantTBT::set_navigationText1(const std::string& navigationText1_) -{ - if(navigationText1) delete navigationText1; - navigationText1=new std::string(navigationText1_); - return true; -} - -void ShowConstantTBT::reset_navigationText1(void) -{ - if(navigationText1) delete navigationText1; - navigationText1=0; -} - -const std::string* ShowConstantTBT::get_navigationText2(void) -{ - return navigationText2; -} - -bool ShowConstantTBT::set_navigationText2(const std::string& navigationText2_) -{ - if(navigationText2) delete navigationText2; - navigationText2=new std::string(navigationText2_); - return true; -} - -void ShowConstantTBT::reset_navigationText2(void) -{ - if(navigationText2) delete navigationText2; - navigationText2=0; -} - -const std::string* ShowConstantTBT::get_eta(void) -{ - return eta; -} - -bool ShowConstantTBT::set_eta(const std::string& eta_) -{ - if(eta) delete eta; - eta=new std::string(eta_); - return true; -} - -void ShowConstantTBT::reset_eta(void) -{ - if(eta) delete eta; - eta=0; -} - -const std::string* ShowConstantTBT::get_totalDistance(void) -{ - return totalDistance; -} - -bool ShowConstantTBT::set_totalDistance(const std::string& totalDistance_) -{ - if(totalDistance) delete totalDistance; - totalDistance=new std::string(totalDistance_); - return true; -} - -void ShowConstantTBT::reset_totalDistance(void) -{ - if(totalDistance) delete totalDistance; - totalDistance=0; -} - -const NsSmartDeviceLinkRPCV2::Image& ShowConstantTBT::get_turnIcon(void) -{ - return turnIcon; -} - -bool ShowConstantTBT::set_turnIcon(const NsSmartDeviceLinkRPCV2::Image& turnIcon_) -{ - turnIcon=turnIcon_; - return true; -} - -float ShowConstantTBT::get_distanceToManeuver(void) -{ - return distanceToManeuver; -} - -bool ShowConstantTBT::set_distanceToManeuver(float distanceToManeuver_) -{ - distanceToManeuver=distanceToManeuver_; - return true; -} - -float ShowConstantTBT::get_distanceToManeuverScale(void) -{ - return distanceToManeuverScale; -} - -bool ShowConstantTBT::set_distanceToManeuverScale(float distanceToManeuverScale_) -{ - distanceToManeuverScale=distanceToManeuverScale_; - return true; -} - -const bool* ShowConstantTBT::get_maneuverComplete(void) -{ - return maneuverComplete; -} - -bool ShowConstantTBT::set_maneuverComplete(const bool& maneuverComplete_) -{ - if(maneuverComplete) delete maneuverComplete; - maneuverComplete=new bool(maneuverComplete_); - return true; -} - -void ShowConstantTBT::reset_maneuverComplete(void) -{ - if(maneuverComplete) delete maneuverComplete; - maneuverComplete=0; -} - -const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& ShowConstantTBT::get_softButtons(void) -{ - return softButtons; -} - -bool ShowConstantTBT::set_softButtons(const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& softButtons_) -{ - softButtons=softButtons_; - return true; -} - -int ShowConstantTBT::get_appId(void) -{ - return appId; -} - -bool ShowConstantTBT::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool ShowConstantTBT::checkIntegrity(void) -{ - return ShowConstantTBTMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTMarshaller.cpp deleted file mode 100644 index f4e509c08..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTMarshaller.cpp +++ /dev/null @@ -1,245 +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/UI/ShowConstantTBT.h" -#include "../src/SDLRPCObjectsImpl/V2/ImageMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/SoftButtonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ShowConstantTBTMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ShowConstantTBTMarshaller::checkIntegrity(ShowConstantTBT& s) -{ - return checkIntegrityConst(s); -} - - -bool ShowConstantTBTMarshaller::fromString(const std::string& s,ShowConstantTBT& 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 ShowConstantTBTMarshaller::toString(const ShowConstantTBT& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ShowConstantTBTMarshaller::checkIntegrityConst(const ShowConstantTBT& s) -{ - if(s.navigationText1 && (s.navigationText1[0].length()>500)) return false; - - if(s.navigationText2 && (s.navigationText2[0].length()>500)) return false; - - if(s.eta && (s.eta[0].length()>500)) return false; - - if(s.totalDistance && (s.totalDistance[0].length()>500)) return false; - - if(!NsSmartDeviceLinkRPCV2::ImageMarshaller::checkIntegrityConst(s.turnIcon)) return false; - - if(s.distanceToManeuver<0 || s.distanceToManeuver>1000000000) return false; - - if(s.distanceToManeuverScale<0 || s.distanceToManeuverScale>1000000000) return false; - - { - unsigned int i=s.softButtons.size(); - if(i<0) return false; - if(i>3) return false; - } - - return true; -} - - -Json::Value ShowConstantTBTMarshaller::toJSON(const ShowConstantTBT& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.ShowConstantTBT"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - if(e.navigationText1) - json["params"]["navigationText1"]=Json::Value(e.navigationText1[0]);; - if(e.navigationText2) - json["params"]["navigationText2"]=Json::Value(e.navigationText2[0]);; - if(e.eta) - json["params"]["eta"]=Json::Value(e.eta[0]);; - if(e.totalDistance) - json["params"]["totalDistance"]=Json::Value(e.totalDistance[0]);; - json["params"]["turnIcon"]=NsSmartDeviceLinkRPCV2::ImageMarshaller::toJSON(e.turnIcon);; - json["params"]["distanceToManeuver"]=Json::Value(e.distanceToManeuver);; - json["params"]["distanceToManeuverScale"]=Json::Value(e.distanceToManeuverScale);; - if(e.maneuverComplete) - json["params"]["maneuverComplete"]=Json::Value(e.maneuverComplete[0]);; - { - unsigned int i=e.softButtons.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::toJSON(e.softButtons[i]); - - json["params"]["softButtons"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool ShowConstantTBTMarshaller::fromJSON(const Json::Value& json,ShowConstantTBT& 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("UI.ShowConstantTBT")) 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(c.navigationText1) delete c.navigationText1; - c.navigationText1=0; - if(js.isMember("navigationText1")) - { - if(!js["navigationText1"].isString()) return false; - c.navigationText1=new std::string(); - c.navigationText1[0]=js["navigationText1"].asString(); - if(c.navigationText1[0].length()>500) return false; - - } - - if(c.navigationText2) delete c.navigationText2; - c.navigationText2=0; - if(js.isMember("navigationText2")) - { - if(!js["navigationText2"].isString()) return false; - c.navigationText2=new std::string(); - c.navigationText2[0]=js["navigationText2"].asString(); - if(c.navigationText2[0].length()>500) return false; - - } - - if(c.eta) delete c.eta; - c.eta=0; - if(js.isMember("eta")) - { - if(!js["eta"].isString()) return false; - c.eta=new std::string(); - c.eta[0]=js["eta"].asString(); - if(c.eta[0].length()>500) return false; - - } - - if(c.totalDistance) delete c.totalDistance; - c.totalDistance=0; - if(js.isMember("totalDistance")) - { - if(!js["totalDistance"].isString()) return false; - c.totalDistance=new std::string(); - c.totalDistance[0]=js["totalDistance"].asString(); - if(c.totalDistance[0].length()>500) return false; - - } - - if(!js.isMember("turnIcon") || !NsSmartDeviceLinkRPCV2::ImageMarshaller::fromJSON(js["turnIcon"],c.turnIcon)) return false; - - if(!js.isMember("distanceToManeuver") || !js["distanceToManeuver"].isNumeric()) return false; - c.distanceToManeuver=js["distanceToManeuver"].asDouble(); - if(c.distanceToManeuver<0 || c.distanceToManeuver>1000000000) return false; - - if(!js.isMember("distanceToManeuverScale") || !js["distanceToManeuverScale"].isNumeric()) return false; - c.distanceToManeuverScale=js["distanceToManeuverScale"].asDouble(); - if(c.distanceToManeuverScale<0 || c.distanceToManeuverScale>1000000000) return false; - - if(c.maneuverComplete) delete c.maneuverComplete; - c.maneuverComplete=0; - if(js.isMember("maneuverComplete")) - { - if(!js["maneuverComplete"].isBool()) return false; - c.maneuverComplete=new bool(); - c.maneuverComplete[0]=js["maneuverComplete"].asBool(); - - } - - if(!js.isMember("softButtons") || !js["softButtons"].isArray()) return false; - { - unsigned int i=js["softButtons"].size(); - if(i<0) return false; - if(i>3) return false; - c.softButtons.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::SoftButton t; - if(!NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::fromJSON(js["softButtons"][i],t)) - return false; - c.softButtons[i]=t; - } - } - - 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/UI/ShowConstantTBTMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTMarshaller.h deleted file mode 100644 index dfeef7eef..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTMarshaller.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_UI_SHOWCONSTANTTBTMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SHOWCONSTANTTBTMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ShowConstantTBT.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ShowConstantTBTMarshaller - { - static bool checkIntegrity(ShowConstantTBT& e); - static bool checkIntegrityConst(const ShowConstantTBT& e); - - static bool fromString(const std::string& s,ShowConstantTBT& e); - static const std::string toString(const ShowConstantTBT& e); - - static bool fromJSON(const Json::Value& s,ShowConstantTBT& e); - static Json::Value toJSON(const ShowConstantTBT& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponse.cpp deleted file mode 100644 index 2db452e5d..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponse.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/UI/ShowConstantTBTResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ShowConstantTBTResponse& ShowConstantTBTResponse::operator =(const ShowConstantTBTResponse& c) -{ - return *this; -} - - -ShowConstantTBTResponse::~ShowConstantTBTResponse(void) -{ -} - - -ShowConstantTBTResponse::ShowConstantTBTResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOWCONSTANTTBTRESPONSE) -{ -} - - -ShowConstantTBTResponse::ShowConstantTBTResponse(const ShowConstantTBTResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOWCONSTANTTBTRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool ShowConstantTBTResponse::checkIntegrity(void) -{ - return ShowConstantTBTResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponseMarshaller.cpp deleted file mode 100644 index e74ea5850..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponseMarshaller.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/UI/ShowConstantTBTResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ShowConstantTBTResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ShowConstantTBTResponseMarshaller::checkIntegrity(ShowConstantTBTResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool ShowConstantTBTResponseMarshaller::fromString(const std::string& s,ShowConstantTBTResponse& 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 ShowConstantTBTResponseMarshaller::toString(const ShowConstantTBTResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ShowConstantTBTResponseMarshaller::checkIntegrityConst(const ShowConstantTBTResponse& s) -{ - return true; -} - - -Json::Value ShowConstantTBTResponseMarshaller::toJSON(const ShowConstantTBTResponse& 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("UI.ShowConstantTBTResponse"); - - return json; -} - - -bool ShowConstantTBTResponseMarshaller::fromJSON(const Json::Value& json,ShowConstantTBTResponse& 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("UI.ShowConstantTBTResponse")) 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/UI/ShowConstantTBTResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponseMarshaller.h deleted file mode 100644 index 9205828d6..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowConstantTBTResponseMarshaller.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_UI_SHOWCONSTANTTBTRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SHOWCONSTANTTBTRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ShowConstantTBTResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ShowConstantTBTResponseMarshaller - { - static bool checkIntegrity(ShowConstantTBTResponse& e); - static bool checkIntegrityConst(const ShowConstantTBTResponse& e); - - static bool fromString(const std::string& s,ShowConstantTBTResponse& e); - static const std::string toString(const ShowConstantTBTResponse& e); - - static bool fromJSON(const Json::Value& s,ShowConstantTBTResponse& e); - static Json::Value toJSON(const ShowConstantTBTResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowMarshaller.cpp deleted file mode 100644 index 6b273bcab..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowMarshaller.cpp +++ /dev/null @@ -1,332 +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/UI/Show.h" -#include "../src/SDLRPCObjectsImpl/V2/TextAlignmentMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ImageMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/SoftButtonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ShowMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ShowMarshaller::checkIntegrity(Show& s) -{ - return checkIntegrityConst(s); -} - - -bool ShowMarshaller::fromString(const std::string& s,Show& 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 ShowMarshaller::toString(const Show& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ShowMarshaller::checkIntegrityConst(const Show& s) -{ - if(s.mainField1 && (s.mainField1[0].length()>500)) return false; - - if(s.mainField2 && (s.mainField2[0].length()>500)) return false; - - if(s.mainField3 && (s.mainField3[0].length()>500)) return false; - - if(s.mainField4 && (s.mainField4[0].length()>500)) return false; - - if(s.alignment && (!NsSmartDeviceLinkRPCV2::TextAlignmentMarshaller::checkIntegrityConst(s.alignment[0]))) return false; - - if(s.statusBar && (s.statusBar[0].length()>500)) return false; - - if(s.mediaClock && (s.mediaClock[0].length()>500)) return false; - - if(s.mediaTrack && (s.mediaTrack[0].length()>500)) return false; - - if(s.graphic && (!NsSmartDeviceLinkRPCV2::ImageMarshaller::checkIntegrityConst(s.graphic[0]))) return false; - - if(s.softButtons) - { - unsigned int i=s.softButtons[0].size(); - if(i<0) return false; - if(i>8) return false; - } - - if(s.customPresets) - { - unsigned int i=s.customPresets[0].size(); - if(i<0) return false; - if(i>6) return false; - while(i--) - { - if(s.customPresets[0][i].length()>500) return false; - } - } - - return true; -} - - -Json::Value ShowMarshaller::toJSON(const Show& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.Show"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - if(e.mainField1) - json["params"]["mainField1"]=Json::Value(e.mainField1[0]);; - if(e.mainField2) - json["params"]["mainField2"]=Json::Value(e.mainField2[0]);; - if(e.mainField3) - json["params"]["mainField3"]=Json::Value(e.mainField3[0]);; - if(e.mainField4) - json["params"]["mainField4"]=Json::Value(e.mainField4[0]);; - if(e.alignment) - json["params"]["alignment"]=NsSmartDeviceLinkRPCV2::TextAlignmentMarshaller::toJSON(e.alignment[0]);; - if(e.statusBar) - json["params"]["statusBar"]=Json::Value(e.statusBar[0]);; - if(e.mediaClock) - json["params"]["mediaClock"]=Json::Value(e.mediaClock[0]);; - if(e.mediaTrack) - json["params"]["mediaTrack"]=Json::Value(e.mediaTrack[0]);; - if(e.graphic) - json["params"]["graphic"]=NsSmartDeviceLinkRPCV2::ImageMarshaller::toJSON(e.graphic[0]);; - if(e.softButtons) - { - unsigned int i=e.softButtons[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::toJSON(e.softButtons[0][i]); - - json["params"]["softButtons"]=j; - } - if(e.customPresets) - { - unsigned int i=e.customPresets[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=Json::Value(e.customPresets[0][i]); - - json["params"]["customPresets"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool ShowMarshaller::fromJSON(const Json::Value& json,Show& 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("UI.Show")) 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(c.mainField1) delete c.mainField1; - c.mainField1=0; - if(js.isMember("mainField1")) - { - if(!js["mainField1"].isString()) return false; - c.mainField1=new std::string(); - c.mainField1[0]=js["mainField1"].asString(); - if(c.mainField1[0].length()>500) return false; - - } - - if(c.mainField2) delete c.mainField2; - c.mainField2=0; - if(js.isMember("mainField2")) - { - if(!js["mainField2"].isString()) return false; - c.mainField2=new std::string(); - c.mainField2[0]=js["mainField2"].asString(); - if(c.mainField2[0].length()>500) return false; - - } - - if(c.mainField3) delete c.mainField3; - c.mainField3=0; - if(js.isMember("mainField3")) - { - if(!js["mainField3"].isString()) return false; - c.mainField3=new std::string(); - c.mainField3[0]=js["mainField3"].asString(); - if(c.mainField3[0].length()>500) return false; - - } - - if(c.mainField4) delete c.mainField4; - c.mainField4=0; - if(js.isMember("mainField4")) - { - if(!js["mainField4"].isString()) return false; - c.mainField4=new std::string(); - c.mainField4[0]=js["mainField4"].asString(); - if(c.mainField4[0].length()>500) return false; - - } - - if(c.alignment) delete c.alignment; - c.alignment=0; - if(js.isMember("alignment")) - { - c.alignment=new NsSmartDeviceLinkRPCV2::TextAlignment(); - if(!NsSmartDeviceLinkRPCV2::TextAlignmentMarshaller::fromJSON(js["alignment"],c.alignment[0])) return false; - } - - if(c.statusBar) delete c.statusBar; - c.statusBar=0; - if(js.isMember("statusBar")) - { - if(!js["statusBar"].isString()) return false; - c.statusBar=new std::string(); - c.statusBar[0]=js["statusBar"].asString(); - if(c.statusBar[0].length()>500) return false; - - } - - if(c.mediaClock) delete c.mediaClock; - c.mediaClock=0; - if(js.isMember("mediaClock")) - { - if(!js["mediaClock"].isString()) return false; - c.mediaClock=new std::string(); - c.mediaClock[0]=js["mediaClock"].asString(); - if(c.mediaClock[0].length()>500) return false; - - } - - if(c.mediaTrack) delete c.mediaTrack; - c.mediaTrack=0; - if(js.isMember("mediaTrack")) - { - if(!js["mediaTrack"].isString()) return false; - c.mediaTrack=new std::string(); - c.mediaTrack[0]=js["mediaTrack"].asString(); - if(c.mediaTrack[0].length()>500) return false; - - } - - if(c.graphic) delete c.graphic; - c.graphic=0; - if(js.isMember("graphic")) - { - c.graphic=new NsSmartDeviceLinkRPCV2::Image(); - if(!NsSmartDeviceLinkRPCV2::ImageMarshaller::fromJSON(js["graphic"],c.graphic[0])) return false; - } - - if(c.softButtons) delete c.softButtons; - c.softButtons=0; - if(js.isMember("softButtons")) - { - if(!js["softButtons"].isArray()) return false; - unsigned int i=js["softButtons"].size(); - if(i<0) return false; - if(i>8) return false; - - c.softButtons=new std::vector<NsSmartDeviceLinkRPCV2::SoftButton>(); - c.softButtons->resize(js["softButtons"].size()); - - while(i--) - if(!NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::fromJSON(js["softButtons"][i],c.softButtons[0][i])) return false; - } - - - if(c.customPresets) delete c.customPresets; - c.customPresets=0; - if(js.isMember("customPresets")) - { - if(!js["customPresets"].isArray()) return false; - unsigned int i=js["customPresets"].size(); - if(i<0) return false; - if(i>6) return false; - - c.customPresets=new std::vector<std::string>(); - c.customPresets->resize(js["customPresets"].size()); - - while(i--) - { - if(!js["customPresets"][i].isString()) - return false; - - c.customPresets[0][i]=js["customPresets"][i].asString(); - if(c.customPresets[0][i].length()>500) 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/UI/ShowMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowMarshaller.h deleted file mode 100644 index 1b41e6683..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowMarshaller.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_UI_SHOWMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SHOWMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/Show.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ShowMarshaller - { - static bool checkIntegrity(Show& e); - static bool checkIntegrityConst(const Show& e); - - static bool fromString(const std::string& s,Show& e); - static const std::string toString(const Show& e); - - static bool fromJSON(const Json::Value& s,Show& e); - static Json::Value toJSON(const Show& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponse.cpp deleted file mode 100644 index c129bdc39..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponse.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/UI/ShowResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -ShowResponse& ShowResponse::operator =(const ShowResponse& c) -{ - return *this; -} - - -ShowResponse::~ShowResponse(void) -{ -} - - -ShowResponse::ShowResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOWRESPONSE) -{ -} - - -ShowResponse::ShowResponse(const ShowResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOWRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool ShowResponse::checkIntegrity(void) -{ - return ShowResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponseMarshaller.cpp deleted file mode 100644 index ebd723ca7..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponseMarshaller.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/UI/ShowResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/ShowResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool ShowResponseMarshaller::checkIntegrity(ShowResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool ShowResponseMarshaller::fromString(const std::string& s,ShowResponse& 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 ShowResponseMarshaller::toString(const ShowResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool ShowResponseMarshaller::checkIntegrityConst(const ShowResponse& s) -{ - return true; -} - - -Json::Value ShowResponseMarshaller::toJSON(const ShowResponse& 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("UI.ShowResponse"); - - return json; -} - - -bool ShowResponseMarshaller::fromJSON(const Json::Value& json,ShowResponse& 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("UI.ShowResponse")) 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/UI/ShowResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponseMarshaller.h deleted file mode 100644 index aa5f288bd..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/ShowResponseMarshaller.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_UI_SHOWRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SHOWRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/ShowResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct ShowResponseMarshaller - { - static bool checkIntegrity(ShowResponse& e); - static bool checkIntegrityConst(const ShowResponse& e); - - static bool fromString(const std::string& s,ShowResponse& e); - static const std::string toString(const ShowResponse& e); - - static bool fromJSON(const Json::Value& s,ShowResponse& e); - static Json::Value toJSON(const ShowResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Slider.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Slider.cpp deleted file mode 100644 index f50aed3c5..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/Slider.cpp +++ /dev/null @@ -1,155 +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/UI/Slider.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -Slider& Slider::operator =(const Slider& c) -{ - numTicks=c.numTicks; - position=c.position; - sliderHeader=c.sliderHeader; - if(sliderFooter) delete sliderFooter; - sliderFooter= c.sliderFooter ? new std::vector<std::string>(c.sliderFooter[0]) : 0; - timeout=c.timeout; - appId=c.appId; - return *this; -} - - -Slider::~Slider(void) -{ - if(sliderFooter) delete sliderFooter; -} - - -Slider::Slider(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SLIDER), - sliderFooter(0) -{ -} - - -Slider::Slider(const Slider& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SLIDER,c.getId()) -{ - *this=c; -} - - -unsigned int Slider::get_numTicks(void) -{ - return numTicks; -} - -bool Slider::set_numTicks(unsigned int numTicks_) -{ - numTicks=numTicks_; - return true; -} - -unsigned int Slider::get_position(void) -{ - return position; -} - -bool Slider::set_position(unsigned int position_) -{ - position=position_; - return true; -} - -const std::string& Slider::get_sliderHeader(void) -{ - return sliderHeader; -} - -bool Slider::set_sliderHeader(const std::string& sliderHeader_) -{ - sliderHeader=sliderHeader_; - return true; -} - -const std::vector< std::string>* Slider::get_sliderFooter(void) -{ - return sliderFooter; -} - -bool Slider::set_sliderFooter(const std::vector< std::string>& sliderFooter_) -{ - if(sliderFooter) delete sliderFooter; - sliderFooter=new std::vector< std::string>(sliderFooter_); - return true; -} - -void Slider::reset_sliderFooter(void) -{ - if(sliderFooter) delete sliderFooter; - sliderFooter=0; -} - -unsigned int Slider::get_timeout(void) -{ - return timeout; -} - -bool Slider::set_timeout(unsigned int timeout_) -{ - timeout=timeout_; - return true; -} - -int Slider::get_appId(void) -{ - return appId; -} - -bool Slider::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool Slider::checkIntegrity(void) -{ - return SliderMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderMarshaller.cpp deleted file mode 100644 index 2bcbddfc9..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderMarshaller.cpp +++ /dev/null @@ -1,194 +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/UI/Slider.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SliderMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SliderMarshaller::checkIntegrity(Slider& s) -{ - return checkIntegrityConst(s); -} - - -bool SliderMarshaller::fromString(const std::string& s,Slider& 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 SliderMarshaller::toString(const Slider& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SliderMarshaller::checkIntegrityConst(const Slider& s) -{ - if(s.numTicks<2 || s.numTicks>26) return false; - - if(s.position<1 || s.position>26) return false; - - if(s.sliderHeader.length()>500) return false; - - if(s.sliderFooter) - { - unsigned int i=s.sliderFooter[0].size(); - if(i<1) return false; - if(i>26) return false; - while(i--) - { - if(s.sliderFooter[0][i].length()>500) return false; - } - } - - if(s.timeout>65535) return false; - - return true; -} - - -Json::Value SliderMarshaller::toJSON(const Slider& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.Slider"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - json["params"]["numTicks"]=Json::Value(e.numTicks);; - json["params"]["position"]=Json::Value(e.position);; - json["params"]["sliderHeader"]=Json::Value(e.sliderHeader);; - if(e.sliderFooter) - { - unsigned int i=e.sliderFooter[0].size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=Json::Value(e.sliderFooter[0][i]); - - json["params"]["sliderFooter"]=j; - } - json["params"]["timeout"]=Json::Value(e.timeout);; - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool SliderMarshaller::fromJSON(const Json::Value& json,Slider& 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("UI.Slider")) 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("numTicks") || !js["numTicks"].isInt()) return false; - c.numTicks=js["numTicks"].asInt(); - if(c.numTicks<2 || c.numTicks>26) return false; - - if(!js.isMember("position") || !js["position"].isInt()) return false; - c.position=js["position"].asInt(); - if(c.position<1 || c.position>16) return false; - - if(!js.isMember("sliderHeader") || !js["sliderHeader"].isString()) return false; - c.sliderHeader=js["sliderHeader"].asString(); - if(c.sliderHeader.length()>500) return false; - - if(c.sliderFooter) delete c.sliderFooter; - c.sliderFooter=0; - if(js.isMember("sliderFooter")) - { - if(!js["sliderFooter"].isArray()) return false; - unsigned int i=js["sliderFooter"].size(); - if(i<1) return false; - if(i>26) return false; - - c.sliderFooter=new std::vector<std::string>(); - c.sliderFooter->resize(js["sliderFooter"].size()); - - while(i--) - { - if(!js["sliderFooter"][i].isString()) - return false; - - c.sliderFooter[0][i]=js["sliderFooter"][i].asString(); - if(c.sliderFooter[0][i].length()>500) return false; - } - } - - - if(!js.isMember("timeout") || !js["timeout"].isInt()) return false; - c.timeout=js["timeout"].asInt(); - if(c.timeout>65535) 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/UI/SliderMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderMarshaller.h deleted file mode 100644 index 62087dad0..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderMarshaller.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_UI_SLIDERMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SLIDERMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/Slider.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SliderMarshaller - { - static bool checkIntegrity(Slider& e); - static bool checkIntegrityConst(const Slider& e); - - static bool fromString(const std::string& s,Slider& e); - static const std::string toString(const Slider& e); - - static bool fromJSON(const Json::Value& s,Slider& e); - static Json::Value toJSON(const Slider& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponse.cpp deleted file mode 100644 index 3350ef5c1..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponse.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SliderResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -SliderResponse& SliderResponse::operator =(const SliderResponse& c) -{ - sliderPosition=c.sliderPosition; - return *this; -} - - -SliderResponse::~SliderResponse(void) -{ -} - - -SliderResponse::SliderResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SLIDERRESPONSE) -{ -} - - -SliderResponse::SliderResponse(const SliderResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SLIDERRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -unsigned int SliderResponse::get_sliderPosition(void) -{ - return sliderPosition; -} - -bool SliderResponse::set_sliderPosition(unsigned int sliderPosition_) -{ - sliderPosition=sliderPosition_; - return true; -} - -bool SliderResponse::checkIntegrity(void) -{ - return SliderResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponseMarshaller.cpp deleted file mode 100644 index 2cac2cacb..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponseMarshaller.cpp +++ /dev/null @@ -1,134 +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/UI/SliderResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/SliderResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool SliderResponseMarshaller::checkIntegrity(SliderResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool SliderResponseMarshaller::fromString(const std::string& s,SliderResponse& 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 SliderResponseMarshaller::toString(const SliderResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool SliderResponseMarshaller::checkIntegrityConst(const SliderResponse& s) -{ - if(s.sliderPosition<1 || s.sliderPosition>26) return false; - - return true; -} - - -Json::Value SliderResponseMarshaller::toJSON(const SliderResponse& 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("UI.SliderResponse"); - - json["result"]["sliderPosition"]=Json::Value(e.sliderPosition);; - return json; -} - - -bool SliderResponseMarshaller::fromJSON(const Json::Value& json,SliderResponse& 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("UI.SliderResponse")) return false; - - if(!NsSmartDeviceLinkRPCV2::ResultMarshaller::fromJSON(js["resultCode"],r)) return false; - c.setResult(r.get()); - if(!js.isMember("sliderPosition") || !js["sliderPosition"].isInt()) return false; - c.sliderPosition=js["sliderPosition"].asInt(); - if(c.sliderPosition<1 || c.sliderPosition>26) return false; - - } - catch(...) - { - return false; - } - return checkIntegrity(c); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponseMarshaller.h deleted file mode 100644 index f162ec300..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/SliderResponseMarshaller.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_UI_SLIDERRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_SLIDERRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/SliderResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct SliderResponseMarshaller - { - static bool checkIntegrity(SliderResponse& e); - static bool checkIntegrityConst(const SliderResponse& e); - - static bool fromString(const std::string& s,SliderResponse& e); - static const std::string toString(const SliderResponse& e); - - static bool fromJSON(const Json::Value& s,SliderResponse& e); - static Json::Value toJSON(const SliderResponse& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnList.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnList.cpp deleted file mode 100644 index 9b4dbc25e..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnList.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 "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/UpdateTurnList.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -UpdateTurnList& UpdateTurnList::operator =(const UpdateTurnList& c) -{ - turnList=c.turnList; - softButtons=c.softButtons; - appId=c.appId; - return *this; -} - - -UpdateTurnList::~UpdateTurnList(void) -{ -} - - -UpdateTurnList::UpdateTurnList(void) : - RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__UPDATETURNLIST) -{ -} - - -UpdateTurnList::UpdateTurnList(const UpdateTurnList& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__UPDATETURNLIST,c.getId()) -{ - *this=c; -} - - -const std::vector< NsSmartDeviceLinkRPCV2::Turn>& UpdateTurnList::get_turnList(void) -{ - return turnList; -} - -bool UpdateTurnList::set_turnList(const std::vector< NsSmartDeviceLinkRPCV2::Turn>& turnList_) -{ - turnList=turnList_; - return true; -} - -const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& UpdateTurnList::get_softButtons(void) -{ - return softButtons; -} - -bool UpdateTurnList::set_softButtons(const std::vector< NsSmartDeviceLinkRPCV2::SoftButton>& softButtons_) -{ - softButtons=softButtons_; - return true; -} - -int UpdateTurnList::get_appId(void) -{ - return appId; -} - -bool UpdateTurnList::set_appId(int appId_) -{ - appId=appId_; - return true; -} - -bool UpdateTurnList::checkIntegrity(void) -{ - return UpdateTurnListMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListMarshaller.cpp deleted file mode 100644 index 2ced1056f..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListMarshaller.cpp +++ /dev/null @@ -1,184 +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/UI/UpdateTurnList.h" -#include "../src/SDLRPCObjectsImpl/V2/TurnMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/SoftButtonMarshaller.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/UpdateTurnListMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool UpdateTurnListMarshaller::checkIntegrity(UpdateTurnList& s) -{ - return checkIntegrityConst(s); -} - - -bool UpdateTurnListMarshaller::fromString(const std::string& s,UpdateTurnList& 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 UpdateTurnListMarshaller::toString(const UpdateTurnList& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool UpdateTurnListMarshaller::checkIntegrityConst(const UpdateTurnList& s) -{ - { - unsigned int i=s.turnList.size(); - if(i<1) return false; - if(i>100) return false; - } - - { - unsigned int i=s.softButtons.size(); - if(i<0) return false; - if(i>1) return false; - } - - return true; -} - - -Json::Value UpdateTurnListMarshaller::toJSON(const UpdateTurnList& e) -{ - Json::Value json(Json::objectValue); - if(!checkIntegrityConst(e)) - return Json::Value(Json::nullValue); - - json["jsonrpc"]=Json::Value("2.0"); - json["method"]=Json::Value("UI.UpdateTurnList"); - - json["id"]=Json::Value(e.getId()); - json["params"]=Json::Value(Json::objectValue); - { - unsigned int i=e.turnList.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::TurnMarshaller::toJSON(e.turnList[i]); - - json["params"]["turnList"]=j; - } - { - unsigned int i=e.softButtons.size(); - Json::Value j=Json::Value(Json::arrayValue); - j.resize(i); - while(i--) - j[i]=NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::toJSON(e.softButtons[i]); - - json["params"]["softButtons"]=j; - } - json["params"]["appId"]=Json::Value(e.appId);; - return json; -} - - -bool UpdateTurnListMarshaller::fromJSON(const Json::Value& json,UpdateTurnList& 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("UI.UpdateTurnList")) 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("turnList") || !js["turnList"].isArray()) return false; - { - unsigned int i=js["turnList"].size(); - if(i<1) return false; - if(i>100) return false; - c.turnList.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::Turn t; - if(!NsSmartDeviceLinkRPCV2::TurnMarshaller::fromJSON(js["turnList"][i],t)) - return false; - c.turnList[i]=t; - } - } - - if(!js.isMember("softButtons") || !js["softButtons"].isArray()) return false; - { - unsigned int i=js["softButtons"].size(); - if(i<0) return false; - if(i>1) return false; - c.softButtons.resize(i); - while(i--) - { - NsSmartDeviceLinkRPCV2::SoftButton t; - if(!NsSmartDeviceLinkRPCV2::SoftButtonMarshaller::fromJSON(js["softButtons"][i],t)) - return false; - c.softButtons[i]=t; - } - } - - 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/UI/UpdateTurnListMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListMarshaller.h deleted file mode 100644 index 28e3dcbb7..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListMarshaller.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_UI_UPDATETURNLISTMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_UPDATETURNLISTMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/UpdateTurnList.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct UpdateTurnListMarshaller - { - static bool checkIntegrity(UpdateTurnList& e); - static bool checkIntegrityConst(const UpdateTurnList& e); - - static bool fromString(const std::string& s,UpdateTurnList& e); - static const std::string toString(const UpdateTurnList& e); - - static bool fromJSON(const Json::Value& s,UpdateTurnList& e); - static Json::Value toJSON(const UpdateTurnList& e); - }; - } -} - -#endif diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponse.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponse.cpp deleted file mode 100644 index c54fe06de..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponse.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/UI/UpdateTurnListResponse.h" -#include "../src/../include/JSONHandler/RPC2Objects/Marshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - - -UpdateTurnListResponse& UpdateTurnListResponse::operator =(const UpdateTurnListResponse& c) -{ - return *this; -} - - -UpdateTurnListResponse::~UpdateTurnListResponse(void) -{ -} - - -UpdateTurnListResponse::UpdateTurnListResponse(void) : - RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__UPDATETURNLISTRESPONSE) -{ -} - - -UpdateTurnListResponse::UpdateTurnListResponse(const UpdateTurnListResponse& c) : RPC2Response(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__UPDATETURNLISTRESPONSE,c.getId(),c.getResult()) -{ - *this=c; -} - - -bool UpdateTurnListResponse::checkIntegrity(void) -{ - return UpdateTurnListResponseMarshaller::checkIntegrity(*this); -} diff --git a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponseMarshaller.cpp b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponseMarshaller.cpp deleted file mode 100644 index 752f82916..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponseMarshaller.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/UI/UpdateTurnListResponse.h" -#include "../src/SDLRPCObjectsImpl/V2/ResultMarshaller.h" -#include "../src/../src/RPC2ObjectsImpl//NsRPC2Communication/UI/UpdateTurnListResponseMarshaller.h" - -/* - interface NsRPC2Communication::UI - 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::UI; - -bool UpdateTurnListResponseMarshaller::checkIntegrity(UpdateTurnListResponse& s) -{ - return checkIntegrityConst(s); -} - - -bool UpdateTurnListResponseMarshaller::fromString(const std::string& s,UpdateTurnListResponse& 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 UpdateTurnListResponseMarshaller::toString(const UpdateTurnListResponse& e) -{ - Json::FastWriter writer; - return checkIntegrityConst(e) ? writer.write(toJSON(e)) : ""; -} - - -bool UpdateTurnListResponseMarshaller::checkIntegrityConst(const UpdateTurnListResponse& s) -{ - return true; -} - - -Json::Value UpdateTurnListResponseMarshaller::toJSON(const UpdateTurnListResponse& 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("UI.UpdateTurnListResponse"); - - return json; -} - - -bool UpdateTurnListResponseMarshaller::fromJSON(const Json::Value& json,UpdateTurnListResponse& 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("UI.UpdateTurnListResponse")) 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/UI/UpdateTurnListResponseMarshaller.h b/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponseMarshaller.h deleted file mode 100644 index 00b514874..000000000 --- a/SDL_Core/src/components/JSONHandler/src/RPC2ObjectsImpl/NsRPC2Communication/UI/UpdateTurnListResponseMarshaller.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_UI_UPDATETURNLISTRESPONSEMARSHALLER_INCLUDE -#define NSRPC2COMMUNICATION_UI_UPDATETURNLISTRESPONSEMARSHALLER_INCLUDE - -#include <string> -#include <json/json.h> - -#include "../src/../include/JSONHandler/RPC2Objects/NsRPC2Communication/UI/UpdateTurnListResponse.h" - -namespace NsRPC2Communication -{ - namespace UI - { - - struct UpdateTurnListResponseMarshaller - { - static bool checkIntegrity(UpdateTurnListResponse& e); - static bool checkIntegrityConst(const UpdateTurnListResponse& e); - - static bool fromString(const std::string& s,UpdateTurnListResponse& e); - static const std::string toString(const UpdateTurnListResponse& e); - - static bool fromJSON(const Json::Value& s,UpdateTurnListResponse& e); - static Json::Value toJSON(const UpdateTurnListResponse& e); - }; - } -} - -#endif |