/usr/include/VTKEdge/vtkKWEXMLArchiveReader.h is in libvtkedge-dev 0.2.0~20110819-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | //=============================================================================
// This file is part of VTKEdge. See vtkedge.org for more information.
//
// Copyright (c) 2010 Kitware, Inc.
//
// VTKEdge may be used under the terms of the BSD License
// Please see the file Copyright.txt in the root directory of
// VTKEdge for further information.
//
// Alternatively, you may see:
//
// http://www.vtkedge.org/vtkedge/project/license.html
//
//
// For custom extensions, consulting services, or training for
// this or any other Kitware supported open source project, please
// contact Kitware at sales@kitware.com.
//
//
//=============================================================================
// .NAME vtkKWEXMLArchiveReader - Reads an XML archive from input stream
// .SECTION Description
// This concrete subclass of vtkKWESerializer reads an XML archive from
// an input stream and create a collection of sub-classes of vtkObject.
// For example:
// \code
// vtkstd::vector<vtkSmartPointer<vtkObject> > objs;
// ifstream ifs(filename);
//
// vtkSmartPointer<vtkKWEXMLArchiveReader> reader =
// vtkSmartPointer<vtkKWEXMLArchiveReader>::New();
// reader->Serialize(istr, "ObjectTree", objs);
// .. Do something with objs
// \endcode
// See vtkKWEXMLArchiveWriter for details about the XML format.
// .SECTION See Also
// vtkKWESerializer vtkKWEXMLArchiveWriter
#ifndef __vtkKWEXMLArchiveReader_h
#define __vtkKWEXMLArchiveReader_h
#include "vtkKWESerializer.h"
#include "VTKEdgeConfigure.h" // include configuration header
//BTX
class vtkKWEXMLElement;
struct vtkKWEXMLArchiveReaderInternals;
//ETX
class VTKEdge_IO_EXPORT vtkKWEXMLArchiveReader : public vtkKWESerializer
{
public:
static vtkKWEXMLArchiveReader *New();
vtkTypeRevisionMacro(vtkKWEXMLArchiveReader,vtkKWESerializer);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// This method returns true if the serializer is an output
// serializer (writer). Returns false.
virtual bool IsWriting() {return false;}
// Description:
// Main entry point called to read an XML archive.
// It populates the obj vector with the root objects in the
// archive (under the RootObjects element).
virtual void Serialize(istream& istr, const char* rootName,
vtkstd::vector<vtkSmartPointer<vtkObject> >& objs);
// Description:
// Additional entry point called to read an XML archive from a
// vtkKWEXMLElement (as opposed to "from a stream"). It
// populates the obj vector with the root objects in the
// archive (under the RootObjects element).
virtual void Serialize(vtkKWEXMLElement *rootElement, const char* rootName,
vtkstd::vector<vtkSmartPointer<vtkObject> >& objs);
// Description:
// Reads a single integer.
virtual void Serialize(const char* name, int& val);
// Description:
// Reads an array.
virtual void Serialize(const char* name, int*& val, unsigned int& length);
// Description:
// Serializes a single unsigned long.
virtual void Serialize(const char* name, unsigned long& val) ;
// Description:
// Serializes an array.
virtual void Serialize(const char* name, unsigned long*& val, unsigned int& length);
// Description:
// Reads a single vtkIdType.
#if defined(VTK_USE_64BIT_IDS)
virtual void Serialize(const char* name, vtkIdType& val);
#endif
// Description:
// Reads an array.
#if defined(VTK_USE_64BIT_IDS)
virtual void Serialize(const char* name, vtkIdType*& val, unsigned int& length);
#endif
// Description:
// Reads a single double.
virtual void Serialize(const char* name, double& val);
// Description:
// Reads an array.
virtual void Serialize(const char* name, double*& val, unsigned int& length);
// Description:
// Serializes a string.
virtual void Serialize(const char* name, char*& str);
// Description:
// Serializes a string.
virtual void Serialize(const char* name, vtkstd::string& str);
// Description:
// Reads a vtkObject. weakPtr should be set to true if this reference to the
// object should NOT be reference counted.
virtual void Serialize(const char* name, vtkObject*& obj, bool weakPtr = false);
// Description:
// Reads a vtkInformationObject. Note that only keys registered
// with the vtkKWEInformationKeyMap are restored.
virtual void Serialize(const char* name, vtkInformation* info);
// Description:
// Reads a vector of vtkObjects.
virtual void Serialize(const char* name,
vtkstd::vector<vtkSmartPointer<vtkObject> >& objs,
bool weakPtr = false);
// Description:
// Reads a map from int to vector of vtkObject.
virtual void Serialize(const char* name,
vtkstd::map<int, vtkstd::vector<vtkSmartPointer<vtkObject> > >& objs);
protected:
vtkKWEXMLArchiveReader();
~vtkKWEXMLArchiveReader();
private:
vtkKWEXMLArchiveReader(const vtkKWEXMLArchiveReader&); // Not implemented.
void operator=(const vtkKWEXMLArchiveReader&); // Not implemented.
void Serialize(vtkstd::vector<vtkSmartPointer<vtkObject> >& objs);
int ParseStream(istream& str);
vtkKWEXMLElement* RootElement;
// Description:
// weakPtr is true if the object is NOT to be reference counted.
vtkObject* ReadObject(int id, bool weakPtr);
// Description:
// Reads a vtkInformationObject. Note that only keys registered
// with the vtkKWEInformationKeyMap are restored.
virtual void Serialize(vtkKWEXMLElement* elem, vtkInformation* info);
void SetRootElement(vtkKWEXMLElement* re);
vtkKWEXMLArchiveReaderInternals* Internal;
};
#endif
|