98199ad20fd6c8efaecdf218424ac8821838cb83
[framework/web/wrt-commons.git] / modules / vcore / src / vcore / VerificationStatus.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 #include "VerificationStatus.h"
17
18 namespace ValidationCore {
19 VerificationStatus VerificationStatusSet::convertToStatus() const
20 {
21     if (m_verdictMap & VERIFICATION_STATUS_REVOKED) {
22         return VERIFICATION_STATUS_REVOKED;
23     }
24
25     if (m_verdictMap & VERIFICATION_STATUS_VERIFICATION_ERROR) {
26         return VERIFICATION_STATUS_VERIFICATION_ERROR;
27     }
28
29     if (m_verdictMap & VERIFICATION_STATUS_ERROR) {
30         return VERIFICATION_STATUS_ERROR;
31     }
32
33     if (m_verdictMap & VERIFICATION_STATUS_UNKNOWN) {
34         return VERIFICATION_STATUS_UNKNOWN;
35     }
36
37     if (m_verdictMap & VERIFICATION_STATUS_CONNECTION_FAILED) {
38         return VERIFICATION_STATUS_CONNECTION_FAILED;
39     }
40
41     if (m_verdictMap & VERIFICATION_STATUS_NOT_SUPPORT) {
42         return VERIFICATION_STATUS_NOT_SUPPORT;
43     }
44
45     if (m_verdictMap & VERIFICATION_STATUS_GOOD) {
46         return VERIFICATION_STATUS_GOOD;
47     }
48
49     return VERIFICATION_STATUS_ERROR;
50 }
51 } // namespace ValidationCore