1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #include "RCSRequest.h"
23 #include "OCResourceRequest.h"
30 RCSRequest::RCSRequest(const std::shared_ptr< OC::OCResourceRequest >& ocRequest) :
31 m_ocRequest{ ocRequest }
35 RCSRequest::RCSRequest(const std::string& resourceUri) :
36 m_ocRequest{ std::make_shared< OC::OCResourceRequest >() }
38 m_ocRequest->setResourceUri(resourceUri);
41 std::string RCSRequest::getResourceUri() const
43 return m_ocRequest->getResourceUri();
46 const std::shared_ptr< OC::OCResourceRequest >& RCSRequest::getOCRequest() const
51 const std::map< std::string, std::string >& RCSRequest::getQueryParams() const
53 return m_ocRequest->getQueryParameters();
56 std::string RCSRequest::getInterface() const
58 const auto& params = m_ocRequest->getQueryParameters();
60 auto it = params.find(OC::Key::INTERFACESKEY);
62 if (it == params.end()) return "";