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.
18 * @author Lukasz Wrzosek (l.wrzosek@samsung.com)
22 #ifndef _WRT_ENGINE_SRC_INSTALLERCORE_CONFIGURATION_PARSER_ROOT_PARSER_H_
23 #define _WRT_ENGINE_SRC_INSTALLERCORE_CONFIGURATION_PARSER_ROOT_PARSER_H_
25 #include <dpl/log/log.h>
26 #include "element_parser.h"
28 template<typename ta_Parser>
29 class RootParser : public ElementParser
32 typedef typename ta_Parser::Data Data;
33 virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
34 const DPL::String& name)
37 return DPL::MakeDelegate(this,
38 &RootParser<ta_Parser>::OnWidgetElement);
40 ThrowMsg(Exception::ParseError,
41 name << " != " << m_tag);
46 const DPL::String& tag) :
54 virtual void Accept(const Element& /*element*/)
59 virtual void Accept(const XmlAttribute& /*attribute*/)
61 LogDebug("attribute");
64 virtual void Accept(const Text& /*text*/)
76 ElementParserPtr OnWidgetElement()
78 typedef ta_Parser Parser;
79 return ElementParserPtr(new Parser(this->m_data));
83 const DPL::String& m_tag;
86 #endif // _WRT_ENGINE_SRC_INSTALLERCORE_CONFIGURATION_PARSER_ROOT_PARSER_H_