Skip to content
Snippets Groups Projects
Commit 1da11953 authored by Radovan Červený's avatar Radovan Červený
Browse files

changed how default ostream measreuemnts result formatting works

parent b7db8def
No related branches found
No related tags found
1 merge request!14BP_cervera3 - new measurements
...@@ -110,7 +110,13 @@ void MeasurementResults::print_as_tree ( std::ostream & os, unsigned idx, std::s ...@@ -110,7 +110,13 @@ void MeasurementResults::print_as_tree ( std::ostream & os, unsigned idx, std::s
const int MeasurementXalloc::FORMAT = std::ios::xalloc ( ); const int MeasurementXalloc::FORMAT = std::ios::xalloc ( );
   
std::ostream & operator <<( std::ostream & os, const MeasurementResults & mr ) { std::ostream & operator <<( std::ostream & os, const MeasurementResults & mr ) {
MeasurementFormat mf = static_cast < MeasurementFormat > ( os.iword ( MeasurementXalloc::FORMAT ) ); MeasurementFormat mf = MeasurementFormat::XML;
int os_format = os.iword ( MeasurementXalloc::FORMAT );
// if format was set, use that format, otherwise default to XML
if ( os_format )
mf = static_cast < MeasurementFormat > ( os_format );
   
switch ( mf ) { switch ( mf ) {
case MeasurementFormat::LIST: case MeasurementFormat::LIST:
...@@ -121,7 +127,7 @@ std::ostream & operator <<( std::ostream & os, const MeasurementResults & mr ) { ...@@ -121,7 +127,7 @@ std::ostream & operator <<( std::ostream & os, const MeasurementResults & mr ) {
mr.print_as_tree ( os ); mr.print_as_tree ( os );
break; break;
   
default: /* MeasurementFormat::XML: */ case MeasurementFormat::XML:
sax::SaxComposeInterface::printStream ( os, mr.xml_tokens ( ) ); sax::SaxComposeInterface::printStream ( os, mr.xml_tokens ( ) );
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment