1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
6 #ifndef WRT_UPGRADE_INFO_H
7 #define WRT_UPGRADE_INFO_H
16 PreferenceInfo(std::string key, std::string value);
17 std::string getSection() {return m_section_;}
18 std::string getKey() {return m_key_;}
19 std::string getValue() {return m_value_;}
21 std::string m_section_;
26 class SecurityOriginInfo{
34 std::string getSection() {return m_section_;}
35 std::string getKey() {return m_key_;}
36 std::string getValue() {return m_value_;}
38 std::string translateKey(
43 std::string translateValue(int result);
44 std::string m_section_;
49 class CertificateInfo{
54 std::string getSection() {return m_section_;}
55 std::string getKey() {return m_key_;}
56 std::string getValue() {return m_value_;}
58 std::string translateKey(std::string pem);
59 std::string translateValue(int result);
60 std::string m_section_;
68 explicit WrtUpgradeInfo(std::string appid);
70 std::string getAppid() { return app_id_; }
71 std::string getPkgid() { return pkg_id_; }
72 std::string getAppDir() { return app_dir_; }
73 std::string getSecurityOriginDB();
74 std::string getCertificateDB();
76 void addPreferenceInfo(PreferenceInfo preference);
77 void addSecurityOriginInfo(SecurityOriginInfo security_origin);
78 void addCertificateInfo(CertificateInfo certificate);
80 PreferenceInfo getPreferenceInfo(int idx)
81 {return preference_info_list_[idx];}
82 SecurityOriginInfo getSecurityOriginInfo(int idx)
83 {return security_origin_info_list_[idx];}
84 CertificateInfo getCertificateInfo(int idx)
85 {return certificate_info_list[idx];}
87 int getPreferenceInfoSize()
88 {return static_cast<int>(preference_info_list_.size());}
89 int getSecurityOriginInfoSize()
90 {return static_cast<int>(security_origin_info_list_.size());}
91 int getCertificateInfoSize()
92 {return static_cast<int>(certificate_info_list.size());}
98 std::vector<PreferenceInfo> preference_info_list_;
99 std::vector<SecurityOriginInfo> security_origin_info_list_;
100 std::vector<CertificateInfo> certificate_info_list;
102 } // namespace upgrade
103 #endif // WRT_UPGRADE_INFO_H