Fix to apply whitespace coding rules
[platform/core/security/krate.git] / server / app-bundle.h
1 /*
2  *  Copyright (c) 2015 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
17 #ifndef __APP_BUNDLE_H__
18 #define __APP_BUNDLE_H__
19
20 #include <string>
21 #include <vector>
22
23 #include <bundle.h>
24
25 class Bundle final {
26 public:
27         Bundle();
28         ~Bundle();
29
30         template<typename T>
31         void add(const std::string& key, const std::vector<T>& value)
32         {
33                 addArrayInternal(key, value);
34         }
35
36         template<typename T>
37         void add(const std::string& key, const T& value)
38         {
39                 addInternal(key, value);
40         }
41
42         bundle* get() const
43         {
44                 return handle;
45         }
46
47 private:
48         void addInternal(const std::string& key, const std::string& value);
49         void addArrayInternal(const std::string& key, const std::vector<std::string>& array);
50
51 private:
52         bundle* handle;
53 };
54
55 #endif //__APP_BUNDLE_H__