2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #define __CONFIG_H__ 1
23 #include <boost/any.hpp>
25 namespace tizen_browser
31 * @brief Abstract config interface.
36 virtual ~BasicConfig() {}
37 virtual void load(const std::string & filename) = 0;
38 virtual void store(const std::string & filename) = 0;
43 * @brief Default config placeholder.
45 class DefaultConfig : BasicConfig
50 * @brief This method loads config from file, validates if file has
51 * necessary values and sections.
53 * @param filename Name of config file.
55 void load(const std::string & filename); //final;
57 * @brief This method stores config to file.
59 * @param filename Name of config file.
61 void store(const std::string & filename); //final;
63 * @brief This method gets value from config stored under key.
65 * @param key Key of item we want to get
67 * @return Value from config.
69 boost::any get(const std::string & key);
71 * @brief This method sets passed value under passed key.
73 * @param key Key of item to set value.
74 * @param value Value to be set.
76 void set(const std::string & key, const boost::any & value);
78 std::map<std::string, boost::any> m_data;
82 } /* end of namespace config */
83 } /* end of namespace tizen_browser */
85 #endif /* __CONFIG_H__ */