2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
17 * @file plugin_metafile_reader.cpp
18 * @author Grzegorz Krawczyk(g.krawczyk@samsung.com)
23 #include "plugin_metafile_reader.h"
25 using namespace WrtDB;
28 const std::string XML_NAMESPACE = "";
30 const std::string TOKEN_LIBRARY_NAME = "library-name";
31 const std::string TOKEN_API_FEATURE = "api-feature";
32 const std::string TOKEN_NAME = "name";
33 const std::string TOKEN_DEVICECAPABILITY = "device-capability";
36 PluginMetafileReader::PluginMetafileReader() : m_parserSchema(this)
38 m_parserSchema.addEndTagCallback(
41 &PluginMetafileReader::tokenEndLibraryName);
43 m_parserSchema.addEndTagCallback(
46 &PluginMetafileReader::tokenEndApiFeature);
48 m_parserSchema.addEndTagCallback(
51 &PluginMetafileReader::tokenEndName);
53 m_parserSchema.addEndTagCallback(
54 TOKEN_DEVICECAPABILITY,
56 &PluginMetafileReader::tokenEndDeviceCapability);
59 void PluginMetafileReader::blankFunction(PluginMetafileData & /* data */)
63 void PluginMetafileReader::tokenEndLibraryName(PluginMetafileData &data)
65 data.m_libraryName = m_parserSchema.getText();
68 void PluginMetafileReader::tokenEndApiFeature(PluginMetafileData &data)
70 data.m_featureContainer.insert(m_feature);
71 m_feature.m_deviceCapabilities.clear();
74 void PluginMetafileReader::tokenEndName(PluginMetafileData & /* data */)
76 m_feature.m_name = m_parserSchema.getText();
79 void PluginMetafileReader::tokenEndDeviceCapability(PluginMetafileData& /*data*/)
81 m_feature.m_deviceCapabilities.insert(m_parserSchema.getText());