1 //******************************************************************
3 // Copyright 2014 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
32 #include "rapidxml.hpp"
36 using namespace rapidxml;
52 * @brief Configuration class
60 * A function to register pluins in the path.
61 * This function will load plugins in plugin manager table.
63 * @param path plugin file path to be registered.
64 * @return int, 1 is success, 0 is fail.
71 * new Singleton pattern instance.
73 * @return config pointer Address.
75 static Config *Getinstance()
77 if (NULL == s_configinstance)
79 s_configinstance = new Config();
82 return s_configinstance;
84 std::string getPluginPath();
85 std::string getVersion();
86 std::string getValue(const std::string key);
89 static Config *s_configinstance;
90 typedef std::map<std::string, std::string> configmap;
91 configmap m_configurationMap;
93 * Constructor for Config.
94 * During construction time, configuration file will be loaded.
102 virtual ~Config(void);
105 * delete Singleton pattern instance.
107 static void deleteinstance()
109 if (NULL != s_configinstance)
111 delete s_configinstance;
112 s_configinstance = NULL;
115 void setValue(const std::string key, const std::string value);
116 PMRESULT loadConfigFile(const std::string configfilepath);
117 PMRESULT parsing(std::vector<char> buffer, xml_document<> *doc);
118 PMRESULT getXmlData( xml_node<> *pluginInfo, std::string key);