Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::XmlWriter::ScopedElement Class Reference

#include <catch_xmlwriter.h>

Public Member Functions

 ScopedElement (XmlWriter *writer)
 
 ScopedElement (ScopedElement &&other) noexcept
 
ScopedElementoperator= (ScopedElement &&other) noexcept
 
 ~ScopedElement ()
 
ScopedElementwriteText (std::string const &text, bool indent=true)
 
template<typename T >
ScopedElementwriteAttribute (std::string const &name, T const &attribute)
 

Detailed Description

Definition at line 36 of file catch_xmlwriter.h.

Constructor & Destructor Documentation

◆ ScopedElement() [1/2]

Catch::XmlWriter::ScopedElement::ScopedElement ( XmlWriter * writer)

Definition at line 160 of file catch_xmlwriter.cpp.

161 : m_writer( writer )
162 {}

◆ ScopedElement() [2/2]

Catch::XmlWriter::ScopedElement::ScopedElement ( ScopedElement && other)
noexcept

Definition at line 164 of file catch_xmlwriter.cpp.

165 : m_writer( other.m_writer ){
166 other.m_writer = nullptr;
167 }

◆ ~ScopedElement()

Catch::XmlWriter::ScopedElement::~ScopedElement ( )

Definition at line 178 of file catch_xmlwriter.cpp.

178 {
179 if( m_writer )
180 m_writer->endElement();
181 }
XmlWriter & endElement()

Member Function Documentation

◆ operator=()

XmlWriter::ScopedElement & Catch::XmlWriter::ScopedElement::operator= ( ScopedElement && other)
noexcept

Definition at line 168 of file catch_xmlwriter.cpp.

168 {
169 if ( m_writer ) {
170 m_writer->endElement();
171 }
172 m_writer = other.m_writer;
173 other.m_writer = nullptr;
174 return *this;
175 }

◆ writeAttribute()

template<typename T >
ScopedElement & Catch::XmlWriter::ScopedElement::writeAttribute ( std::string const & name,
T const & attribute )
inline

Definition at line 48 of file catch_xmlwriter.h.

48 {
49 m_writer->writeAttribute( name, attribute );
50 return *this;
51 }
std::string name
XmlWriter & writeAttribute(std::string const &name, std::string const &attribute)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeText()

XmlWriter::ScopedElement & Catch::XmlWriter::ScopedElement::writeText ( std::string const & text,
bool indent = true )

Definition at line 183 of file catch_xmlwriter.cpp.

183 {
184 m_writer->writeText( text, indent );
185 return *this;
186 }
XmlWriter & writeText(std::string const &text, bool indent=true)
Here is the caller graph for this function:

The documentation for this class was generated from the following files: