InterceptReader intReader;
reader.setContentHandler( &intReader );
read.setErrorHandler( &intReader );
int numFiles = xmlDir.count( );
for( int i = 0 ; i < numFiles ; i++ )
{
reader.parse( &file );
char *ref;
char *diff;
intReader.getEventIds( ref, diff ); // These char*s are malloced using strdup
if( ref && diff )
{
fprintf( stderr, "ref = %s, diff = %s\n", ref, diff );
free( ref );
ref = NULL;
free( diff );
diff = NULL;
}
else if( ref && !diff )
{
fprintf( stderr, "ref = %s\n", ref );
free( ref );
ref = NULL;
}
else if( !ref && diff )
{
fprintf( stderr, "diff = %s\n", diff );
free( diff );
diff = NULL;
}
}
QDir xmlDir = QDir( xmlDirString, QString( "*.xml" ) );
InterceptReader intReader;
QXmlSimpleReader reader;
reader.setContentHandler( &intReader );
read.setErrorHandler( &intReader );
int numFiles = xmlDir.count( );
for( int i = 0 ; i < numFiles ; i++ )
{
QFile file( xmlDir[i] );
reader.parse( &file );
char *ref;
char *diff;
intReader.getEventIds( ref, diff ); // These char*s are malloced using strdup
if( ref && diff )
{
fprintf( stderr, "ref = %s, diff = %s\n", ref, diff );
free( ref );
ref = NULL;
free( diff );
diff = NULL;
}
else if( ref && !diff )
{
fprintf( stderr, "ref = %s\n", ref );
free( ref );
ref = NULL;
}
else if( !ref && diff )
{
fprintf( stderr, "diff = %s\n", diff );
free( diff );
diff = NULL;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks