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

vtkXMLUtilities.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLUtilities.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
00023 #ifndef __vtkXMLUtilities_h
00024 #define __vtkXMLUtilities_h
00025 
00026 #include "vtkObject.h"
00027 
00028 class vtkXMLDataElement;
00029 
00030 class VTK_IO_EXPORT vtkXMLUtilities : public vtkObject
00031 {
00032 public:
00033   static vtkXMLUtilities* New();
00034   vtkTypeRevisionMacro(vtkXMLUtilities, vtkObject);
00035 
00037 
00040   static void EncodeString(const char *input, int input_encoding, 
00041                            ostream &output, int output_encoding,
00042                            int special_entities = 0);
00044 
00046 
00051   static void CollateAttributes(vtkXMLDataElement*, 
00052                                 ostream&, 
00053                                 const char *sep = 0);
00055 
00056   //BTX
00058 
00065   static void FlattenElement(vtkXMLDataElement*, 
00066                              ostream&, 
00067                              vtkIndent *indent = 0,
00068                              int indent_attributes = 1);
00070 
00072 
00075   static int WriteElementToFile(vtkXMLDataElement*, 
00076                                 const char *filename, 
00077                                 vtkIndent *indent = 0);
00078   //ETX
00080 
00082 
00091   static vtkXMLDataElement* ReadElementFromStream(
00092     istream&, int encoding = VTK_ENCODING_NONE);
00093   static vtkXMLDataElement* ReadElementFromString(
00094     const char *str, int encoding = VTK_ENCODING_NONE);
00095   static vtkXMLDataElement* ReadElementFromFile(
00096     const char *filename, int encoding = VTK_ENCODING_NONE);
00097   //ETX
00099 
00101 
00107   static int FindSimilarElements(vtkXMLDataElement *elem, 
00108                                  vtkXMLDataElement *tree, 
00109                                  vtkXMLDataElement ***results);
00110   //ETX
00112 
00114 
00117   static void FactorElements(vtkXMLDataElement *tree);
00118   static void UnFactorElements(vtkXMLDataElement *tree);
00120 
00121 protected:  
00122   vtkXMLUtilities() {};
00123   ~vtkXMLUtilities() {};
00124   
00125   static int FactorElementsInternal(vtkXMLDataElement *tree, 
00126                                     vtkXMLDataElement *root, 
00127                                     vtkXMLDataElement *pool);
00128   static int UnFactorElementsInternal(vtkXMLDataElement *tree, 
00129                                       vtkXMLDataElement *pool);
00130 
00131 private:
00132   vtkXMLUtilities(const vtkXMLUtilities&); // Not implemented
00133   void operator=(const vtkXMLUtilities&); // Not implemented    
00134 };
00135 
00136 #endif
00137 
00138 

Generated on Mon Jan 21 23:07:32 2008 for VTK by  doxygen 1.4.3-20050530