replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / service / notification / cpp-wrapper / common / NSSyncInfo.cpp
1 //******************************************************************\r
2 //\r
3 // Copyright 2016 Samsung Electronics All Rights Reserved.\r
4 //\r
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
6 //\r
7 // Licensed under the Apache License, Version 2.0 (the "License");\r
8 // you may not use this file except in compliance with the License.\r
9 // You may obtain a copy of the License at\r
10 //\r
11 //      http://www.apache.org/licenses/LICENSE-2.0\r
12 //\r
13 // Unless required by applicable law or agreed to in writing, software\r
14 // distributed under the License is distributed on an "AS IS" BASIS,\r
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16 // See the License for the specific language governing permissions and\r
17 // limitations under the License.\r
18 //\r
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
20 \r
21 #include "NSSyncInfo.h"\r
22 #include "string.h"\r
23 #include "NSUtils.h"\r
24 \r
25 namespace OIC\r
26 {\r
27     namespace Service\r
28     {\r
29         NSSyncInfo::NSSyncInfo(::NSSyncInfo *syncInfo)\r
30         {\r
31             m_messageId = 0;\r
32             m_state = NSSyncInfo::NSSyncType::NS_SYNC_UNREAD;\r
33             if (syncInfo != nullptr)\r
34             {\r
35                 m_messageId = syncInfo->messageId;\r
36                 m_providerId.assign(syncInfo->providerId, NS_UTILS_UUID_STRING_SIZE - 1);\r
37                 m_state = (NSSyncType) syncInfo->state;\r
38             }\r
39         }\r
40 \r
41         uint64_t NSSyncInfo::getMessageId() const\r
42         {\r
43             return m_messageId;\r
44         }\r
45 \r
46         std::string NSSyncInfo::getProviderId() const\r
47         {\r
48             return m_providerId;\r
49         }\r
50 \r
51         NSSyncInfo::NSSyncType NSSyncInfo::getState() const\r
52         {\r
53             return m_state;\r
54         }\r
55     }\r
56 }\r