mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 11:43:29 +01:00
Reuse ostringstream in XML reporter
This commit is contained in:
parent
01a21f67f7
commit
c7931f6f18
@ -165,9 +165,10 @@ namespace Catch {
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
|
XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
|
||||||
std::ostringstream oss;
|
m_oss.clear();
|
||||||
oss << attribute;
|
m_oss.str(std::string());
|
||||||
return writeAttribute( name, oss.str() );
|
m_oss << attribute;
|
||||||
|
return writeAttribute( name, m_oss.str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlWriter& writeText( std::string const& text, bool indent = true ) {
|
XmlWriter& writeText( std::string const& text, bool indent = true ) {
|
||||||
@ -226,6 +227,7 @@ namespace Catch {
|
|||||||
std::vector<std::string> m_tags;
|
std::vector<std::string> m_tags;
|
||||||
std::string m_indent;
|
std::string m_indent;
|
||||||
std::ostream& m_os;
|
std::ostream& m_os;
|
||||||
|
std::ostringstream m_oss;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user