vtkXMLUtilities.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00033 #ifndef __vtkXMLUtilities_h
00034 #define __vtkXMLUtilities_h
00035
00036 #include "vtkObject.h"
00037
00038 class vtkXMLDataElement;
00039
00040 class VTK_IO_EXPORT vtkXMLUtilities : public vtkObject
00041 {
00042 public:
00043 static vtkXMLUtilities* New();
00044 vtkTypeRevisionMacro(vtkXMLUtilities, vtkObject);
00045
00047
00050 static void EncodeString(const char *input, int input_encoding,
00051 ostream &output, int output_encoding,
00052 int special_entities = 0);
00054
00056
00061 static void CollateAttributes(vtkXMLDataElement*,
00062 ostream&,
00063 const char *sep = 0);
00065
00066
00068
00075 static void FlattenElement(vtkXMLDataElement*,
00076 ostream&,
00077 vtkIndent *indent = 0,
00078 int indent_attributes = 1);
00080
00082
00085 static int WriteElementToFile(vtkXMLDataElement*,
00086 const char *filename,
00087 vtkIndent *indent = 0);
00088
00090
00092
00101 static vtkXMLDataElement* ReadElementFromStream(
00102 istream&, int encoding = VTK_ENCODING_NONE);
00103 static vtkXMLDataElement* ReadElementFromString(
00104 const char *str, int encoding = VTK_ENCODING_NONE);
00105 static vtkXMLDataElement* ReadElementFromFile(
00106 const char *filename, int encoding = VTK_ENCODING_NONE);
00107
00109
00111
00117 static int FindSimilarElements(vtkXMLDataElement *elem,
00118 vtkXMLDataElement *tree,
00119 vtkXMLDataElement ***results);
00120
00122
00124
00127 static void FactorElements(vtkXMLDataElement *tree);
00128 static void UnFactorElements(vtkXMLDataElement *tree);
00130
00131 protected:
00132 vtkXMLUtilities() {};
00133 ~vtkXMLUtilities() {};
00134
00135 static int FactorElementsInternal(vtkXMLDataElement *tree,
00136 vtkXMLDataElement *root,
00137 vtkXMLDataElement *pool);
00138 static int UnFactorElementsInternal(vtkXMLDataElement *tree,
00139 vtkXMLDataElement *pool);
00140
00141 private:
00142 vtkXMLUtilities(const vtkXMLUtilities&);
00143 void operator=(const vtkXMLUtilities&);
00144 };
00145
00146 #endif
00147
00148