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_FEATURE_INSTALL_URI = "feature-install-uri";
32 const std::string TOKEN_FEATURE_KEY_CN = "feature-key-cn";
33 const std::string TOKEN_FEATURE_ROOT_CN = "feature-root-cn";
34 const std::string TOKEN_FEATURE_ROOT_FINGERPRINT = "feature-root-fingerprint";
35 const std::string TOKEN_API_FEATURE = "api-feature";
36 const std::string TOKEN_NAME = "name";
37 const std::string TOKEN_DEVICECAPABILITY = "device-capability";
40 PluginMetafileReader::PluginMetafileReader() : m_parserSchema(this)
42 m_parserSchema.addEndTagCallback(
45 &PluginMetafileReader::tokenEndLibraryName);
47 m_parserSchema.addEndTagCallback(
48 TOKEN_FEATURE_INSTALL_URI,
50 &PluginMetafileReader::tokenEndFeatureInstallURI);
52 m_parserSchema.addEndTagCallback(
55 &PluginMetafileReader::tokenEndFeatureKeyCN);
57 m_parserSchema.addEndTagCallback(
58 TOKEN_FEATURE_ROOT_CN,
60 &PluginMetafileReader::tokenEndFeatureRootCN);
62 m_parserSchema.addEndTagCallback(
63 TOKEN_FEATURE_ROOT_FINGERPRINT,
65 &PluginMetafileReader::tokenEndFeatureRootFingerprint);
67 m_parserSchema.addEndTagCallback(
70 &PluginMetafileReader::tokenEndApiFeature);
72 m_parserSchema.addEndTagCallback(
75 &PluginMetafileReader::tokenEndName);
77 m_parserSchema.addEndTagCallback(
78 TOKEN_DEVICECAPABILITY,
80 &PluginMetafileReader::tokenEndDeviceCapability);
83 void PluginMetafileReader::blankFunction(PluginMetafileData & /* data */)
87 void PluginMetafileReader::tokenEndLibraryName(PluginMetafileData &data)
89 data.m_libraryName = m_parserSchema.getText();
92 void PluginMetafileReader::tokenEndFeatureInstallURI(PluginMetafileData &data)
94 data.m_featuresInstallURI = m_parserSchema.getText();
97 void PluginMetafileReader::tokenEndFeatureKeyCN(PluginMetafileData &data)
99 data.m_featuresKeyCN = m_parserSchema.getText();
102 void PluginMetafileReader::tokenEndFeatureRootCN(PluginMetafileData &data)
104 data.m_featuresRootCN = m_parserSchema.getText();
107 void PluginMetafileReader::tokenEndFeatureRootFingerprint(
108 PluginMetafileData &data)
110 data.m_featuresRootFingerprint = m_parserSchema.getText();
113 void PluginMetafileReader::tokenEndApiFeature(PluginMetafileData &data)
115 data.m_featureContainer.insert(m_feature);
118 void PluginMetafileReader::tokenEndName(PluginMetafileData & /* data */)
120 m_feature.m_name = m_parserSchema.getText();
123 void PluginMetafileReader::tokenEndDeviceCapability(PluginMetafileData& /*data*/)
125 m_feature.m_deviceCapabilities.insert(m_parserSchema.getText());