ITK  6.0.0
Insight Toolkit
itkDOMNodeXMLWriter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef itkDOMNodeXMLWriter_h
20#define itkDOMNodeXMLWriter_h
21
22#include "itkDOMNode.h"
23#include "itkObject.h"
24#include "ITKIOXMLExport.h"
25
26#include <ostream>
27
28namespace itk
29{
30
61class ITKIOXML_EXPORT DOMNodeXMLWriter : public Object
62{
63public:
64 ITK_DISALLOW_COPY_AND_MOVE(DOMNodeXMLWriter);
72
74 itkNewMacro(Self);
75
77 itkOverrideGetNameOfClassMacro(DOMNodeXMLWriter);
78
81
83 itkSetStringMacro(FileName);
84
86 itkGetStringMacro(FileName);
87
89 itkSetConstObjectMacro(Input, InputType);
90 itkGetConstObjectMacro(Input, InputType);
97 void
98 Update(std::ostream & os, std::string indent = "");
99
103 virtual void
105
106protected:
108
109private:
111 std::string m_FileName{};
112
115
117 std::string m_IndentStep{};
118};
119
120} // namespace itk
121
123inline std::ostream &
124operator<<(std::ostream & os, const itk::DOMNode & object)
125{
126 auto writer = itk::DOMNodeXMLWriter::New();
127 writer->SetInput(&object);
128 writer->Update(os);
129 return os;
130}
133#endif // itkDOMNodeXMLWriter_h
Class to write a DOM object to an XML file or an output stream.
static Pointer New()
void Update(std::ostream &os, std::string indent="")
virtual void Update()
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:54
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
SmartPointer< const Self > ConstPointer
std::ostream & operator<<(std::ostream &os, const itk::DOMNode &object)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....