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"
39 #define PATH_MAX_SIZE 100
41 using namespace rapidxml;
57 * @brief Configuration class
65 * A function to register pluins in the path.
66 * This function will load plugins in plugin manager table.
68 * @param path plugin file path to be registered.
69 * @return int, 1 is success, 0 is fail.
76 * new Singleton pattern instance.
78 * @return config pointer Address.
80 static Config *Getinstance(void *args = NULL)
82 if (NULL == s_configinstance)
84 s_configinstance = new Config(args);
87 return s_configinstance;
89 std::string getPluginPath();
90 std::string getVersion();
91 std::string getValue(const std::string key);
94 static Config *s_configinstance;
95 typedef std::map<std::string, std::string> configmap;
96 configmap m_configurationMap;
99 * Constructor for Config.
100 * During construction time, configuration file will be loaded.
103 Config(void *args = NULL);
108 virtual ~Config(void);
111 * delete Singleton pattern instance.
113 static void deleteinstance()
115 if (NULL != s_configinstance)
117 delete s_configinstance;
118 s_configinstance = NULL;
121 void setValue(const std::string key, const std::string value);
122 PMRESULT loadConfigFile(const std::string configfilepath);
123 PMRESULT parsing(char *xmlData, xml_document<> *doc);
124 PMRESULT getXmlData( xml_node<> *pluginInfo, std::string key);