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 powder_parser.h
18 * @author Piotr Marcinkiewicz (p.marcinkiew@samsung.com)
20 * @brief Parser for WAC defined POWDER
23 #ifndef _WRT_ENGINE_SRC_INSTALLERCORE_CONFIGURATION_PARSER_POWDER_PARSER_H_
24 #define _WRT_ENGINE_SRC_INSTALLERCORE_CONFIGURATION_PARSER_POWDER_PARSER_H_
26 #include <dpl/exception.h>
27 #include "element_parser.h"
28 #include <dpl/wrt-dao-ro/common_dao_types.h>
30 //TODO: Move to separate header
31 namespace PowderParserException {
32 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
33 DECLARE_EXCEPTION_TYPE(Base, ParserFailed)
36 struct PowderParserData
38 WrtDB::Powder::Description* description;
39 const DPL::String& host;
40 const DPL::String& path;
41 PowderParserData(WrtDB::Powder::Description* a_description,
42 const DPL::String& a_host,
43 const DPL::String& a_path) :
44 description(a_description),
50 //TODO: Move to other header
51 typedef std::set<DPL::String> StringSet;
53 class PowderParser : public ElementParser
56 //Typedef used by RootParser
57 typedef PowderParserData* Data;
59 explicit PowderParser(PowderParserData* data);
61 ElementParserPtr OnNameElement();
63 //TODO: Remove not implemented methods
64 virtual ActionFunc GetElementParser(const DPL::String& ns,
65 const DPL::String& name);
66 virtual void Accept(const Element& /*element*/);
67 virtual void Accept(const XmlAttribute& attribute);
68 virtual void Accept(const Text& text);
69 virtual void Verify();
71 ElementParserPtr OnIgnoredElement();
72 ElementParserPtr OnElement_dr();
73 ElementParserPtr OnDenyElement();
76 WrtDB::Powder::Description* m_data;
77 const DPL::String& m_host;
78 const DPL::String& m_path;
81 #endif // _WRT_ENGINE_SRC_INSTALLERCORE_CONFIGURATION_PARSER_POWDER_PARSER_H_