ConfigParserData& m_data;
};
+class PrivilegeParser : public ElementParser
+{
+ public:
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& name)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ virtual void Accept(const Text& /*text*/)
+ {
+ }
+
+ virtual void Accept(const Element& element)
+ {
+ if (element.ns ==
+ ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
+ LogDebug("element");
+ }
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ if (m_properNamespace) {
+ if (attribute.name == L"name") {
+ m_feature.name = attribute.value;
+ }
+ }
+ m_feature.required = true;
+ }
+
+ virtual void Verify()
+ {
+ LibIri::Wrapper iri(DPL::ToUTF8String(m_feature.name).c_str());
+
+ if (m_feature.name != L"") {
+ if (iri.Validate()) {
+ if (m_data.featuresList.find(m_feature) ==
+ m_data.featuresList.end()) {
+ m_data.featuresList.insert(m_feature);
+ } else {
+ LogDebug("Ignoring feature with name" <<
+ DPL::ToUTF8String(m_feature.name));
+ }
+ }
+ }
+ }
+
+ PrivilegeParser(ConfigParserData& data) :
+ ElementParser(),
+ m_data(data),
+ m_feature(L""),
+ m_properNamespace(false)
+ {
+ }
+
+ private:
+ ConfigParserData& m_data;
+ ConfigParserData::Feature m_feature;
+ bool m_properNamespace;
+};
+
ElementParser::ActionFunc WidgetParser::GetElementParser(const DPL::String& /*ns*/,
const DPL::String& name)
{
m_map[L"application"] = DPL::MakeDelegate(this, &WidgetParser::OnApplicationElement);
m_map[L"splash"] = DPL::MakeDelegate(this, &WidgetParser::OnSplashElement);
m_map[L"background"] = DPL::MakeDelegate(this, &WidgetParser::OnBackgroundElement);
+ m_map[L"privilege"] = DPL::MakeDelegate(this, &WidgetParser::OnPrivilegeElement);
}
ElementParserPtr WidgetParser::OnNameElement()
return ElementParserPtr(new BackgroundParser(m_data));
}
+ElementParserPtr WidgetParser::OnPrivilegeElement()
+{
+ return ElementParserPtr(new PrivilegeParser(m_data));
+}
+
void WidgetParser::Accept(const Element& element)
{
if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&