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 Bartlomiej Grzelewski (b.grzelewski@samsung.com)
20 * @brief Simple c++ interface for libxml2.
21 * Its used in wrt-installer only and should be removed
28 #include <libxml/xmlreader.h>
30 #include <vcore/exception.h>
32 namespace ValidationCore {
40 VCORE_DECLARE_EXCEPTION_TYPE(ValidationCore::Exception, Base);
41 VCORE_DECLARE_EXCEPTION_TYPE(Base, FileOpeningError);
42 VCORE_DECLARE_EXCEPTION_TYPE(Base, FileNotValid);
43 VCORE_DECLARE_EXCEPTION_TYPE(Base, ParserInternalError);
44 VCORE_DECLARE_EXCEPTION_TYPE(Base, WrongToken);
45 VCORE_DECLARE_EXCEPTION_TYPE(Base, ReadingValueError);
46 VCORE_DECLARE_EXCEPTION_TYPE(Base, ReadingNameError);
47 VCORE_DECLARE_EXCEPTION_TYPE(Base, UnsupportedType);
65 * xml validation modes
78 const std::string &filename,
79 bool defaultArgs = false,
80 ValidationType validation = VALIDATION_DISABLE,
81 const std::string &schema = std::string());
83 * deinitializes parser
88 * Move to next xml node.
93 * Move to next xml node. If next node name is differ from token the exception wiil
96 void next(const std::string &token);
99 * Check if xml tag is empty.
104 * Read attribute tag.
106 std::string attribute(const std::string &token, ThrowType throwStatus = THROW_ENABLE);
109 * Read xml tag name without namespace.
114 * Read xml tag namespace URI
116 std::string namespaceURI();
119 * Read xml tag value.
124 * Return information about node type.
129 * Save all contonet of xml file which is between current tag and
130 * it's close tag into buffer.
132 void dumpNode(std::string &buffer);
136 * internal libxml text reader
138 xmlTextReaderPtr m_reader;
142 #endif // _SAXREADER_H_