libetonyek_xml.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libetonyek project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef LIBETONYEK_XML_H_INCLUDED
00011 #define LIBETONYEK_XML_H_INCLUDED
00012 
00013 #include <string>
00014 
00015 #include "libetonyek_utils.h"
00016 
00017 #define KEY_DEBUG_XML_NOT_EMPTY(name, ns) KEY_DEBUG_MSG(("element %s%s%s%s is not empty, skipping content...\n", ns ? "{" : "", ns, ns ? "}" : "", name))
00018 #define KEY_DEBUG_XML_UNKNOWN(type, name, ns) KEY_DEBUG_MSG(("unknown %s %s%s%s%s\n", type, ns ? "{" : "", ns, ns ? "}" : "", name))
00019 #define KEY_DEBUG_XML_TODO(type, name, ns) KEY_DEBUG_MSG(("TODO: unprocessed %s %s%s%s%s\n", type, ns ? "{" : "", ns, ns ? "}" : "", name))
00020 
00021 #define KEY_DEBUG_XML_TODO_ELEMENT(element) KEY_DEBUG_XML_TODO("element", (element).getName(), (element).getNamespace())
00022 #define KEY_DEBUG_XML_TODO_ATTRIBUTE(attr) KEY_DEBUG_XML_TODO("attribute", (attr).getName(), (attr).getNamespace())
00023 #define KEY_DEBUG_XML_UNKNOWN_ELEMENT(element) KEY_DEBUG_XML_UNKNOWN("element", (element).getName(), (element).getNamespace())
00024 #define KEY_DEBUG_XML_UNKNOWN_ATTRIBUTE(attr) KEY_DEBUG_XML_UNKNOWN("attribute", (attr).getName(), (attr).getNamespace())
00025 
00026 namespace libetonyek
00027 {
00028 
00029 class KEYXMLReader;
00030 
00031 void skipElement(const KEYXMLReader &reader);
00032 
00033 bool checkElement(const KEYXMLReader &reader, int name, int ns);
00034 bool checkEmptyElement(const KEYXMLReader &reader);
00035 bool checkNoAttributes(const KEYXMLReader &reader);
00036 
00037 std::string readOnlyAttribute(const KEYXMLReader &reader, int name, int ns);
00038 std::string readOnlyElementAttribute(const KEYXMLReader &reader, int name, int ns);
00039 
00040 }
00041 
00042 #endif // LIBETONYEK_XML_H_INCLUDED
00043 
00044 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */