Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Servers/Filters/vtkPVXMLParser.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkPVXMLParser.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00021 #ifndef __vtkPVXMLParser_h
00022 #define __vtkPVXMLParser_h
00023 
00024 #include "vtkXMLParser.h"
00025 
00026 class vtkPVXMLElement;
00027 
00028 class VTK_EXPORT vtkPVXMLParser : public vtkXMLParser
00029 {
00030 public:
00031   vtkTypeRevisionMacro(vtkPVXMLParser,vtkXMLParser);
00032   void PrintSelf(ostream& os, vtkIndent indent);
00033   static vtkPVXMLParser* New();
00034 
00036   void PrintXML(ostream& os);
00037 
00039   vtkPVXMLElement* GetRootElement();
00040 
00042 
00043   vtkSetStringMacro(FileName);
00044   vtkGetStringMacro(FileName);
00046 
00047 protected:
00048   vtkPVXMLParser();
00049   ~vtkPVXMLParser();
00050 
00051   void StartElement(const char* name, const char** atts);
00052   void EndElement(const char* name);
00053   void CharacterDataHandler(const char* data, int length);
00054 
00055   void AddElement(vtkPVXMLElement* element);
00056   void PushOpenElement(vtkPVXMLElement* element);
00057   vtkPVXMLElement* PopOpenElement();
00058 
00059   // The root XML element.
00060   vtkPVXMLElement* RootElement;
00061 
00062   // The stack of elements currently being parsed.
00063   vtkPVXMLElement** OpenElements;
00064   unsigned int NumberOfOpenElements;
00065   unsigned int OpenElementsSize;
00066 
00067   // Counter to assign unique element ids to those that don't have any.
00068   unsigned int ElementIdIndex;
00069 
00070   // Called by Parse() to read the stream and call ParseBuffer.  Can
00071   // be replaced by subclasses to change how input is read.
00072   virtual int ParseXML();
00073 
00074 private:
00075   vtkPVXMLParser(const vtkPVXMLParser&);  // Not implemented.
00076   void operator=(const vtkPVXMLParser&);  // Not implemented.
00077 };
00078 
00079 #endif

Generated on Tue May 30 12:31:47 2006 for ParaView by doxygen 1.3.5