00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil c-basic-offset: 3 -*- */ 00002 // vim:cindent:ts=3:sw=3:et:tw=80:sta: 00003 /*************************************************************** cppdom-cpr beg 00004 * 00005 * cppdom was forked from the original xmlpp version 0.6 under the LGPL. This 00006 * new, branched xmlpp is under the same LGPL (of course) and is being 00007 * maintained by: 00008 * Kevin Meinert <subatomic@users.sourceforge.net> 00009 * Allen Bierbaum <allenb@users.sourceforge.net> 00010 * Ben Scott <nonchocoboy@users.sourceforge.net> 00011 * 00012 * ----------------------------------------------------------------- 00013 * 00014 * xmlpp - an xml parser and validator written in C++ 00015 * copyright (c) 2000-2001 Michael Fink 00016 * 00017 * This library is free software; you can redistribute it and/or 00018 * modify it under the terms of the GNU Library General Public 00019 * License as published by the Free Software Foundation; either 00020 * version 2 of the License, or (at your option) any later version. 00021 * 00022 * This library is distributed in the hope that it will be useful, 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00025 * Library General Public License for more details. 00026 * 00027 * You should have received a copy of the GNU Library General Public 00028 * License along with this library; if not, write to the 00029 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00030 * Boston, MA 02111-1307, USA. 00031 * 00032 * ----------------------------------------------------------------- 00033 * File: $RCSfile: xmlparser.h,v $ 00034 * Date modified: $Date: 2003/01/03 03:06:47 $ 00035 * Version: $Revision: 1.10 $ 00036 * ----------------------------------------------------------------- 00037 * 00038 ************************************************************ cppdom-cpr-end */ 00045 // prevent multiple includes 00046 #ifndef CPPDOM_XML_PARSER_H 00047 #define CPPDOM_XML_PARSER_H 00048 00049 // needed includes 00050 #include "cppdom.h" 00051 #include "xmltokenizer.h" 00052 00053 // namespace declaration 00054 namespace cppdom 00055 { 00056 00058 class XMLParser 00059 { 00060 public: 00062 XMLParser(std::istream& inputstream, XMLLocation& loc); 00063 00065 bool parseDocument(XMLDocument& doc, XMLContextPtr& context); 00066 00068 bool parseNode(XMLNode& node, XMLContextPtr& context); 00069 00070 protected: 00072 bool parseHeader(XMLDocument& doc, XMLContextPtr& context); 00073 00075 bool parseAttributes(XMLAttributes& attr); 00076 00078 void parseComment(XMLContextPtr& context); 00079 00080 protected: 00082 std::istream& mInput; 00083 00085 xmlstream_iterator mTokenizer; 00086 }; 00087 } 00088 00089 #endif