static int dump_ccd(int argc, char **argv) { int i, error; if (argc == 0) { error = dumpout(-1); } else { error = 0; for (i = 0; error == 0 && i < argc; i++) error = dumpout(resolve_ccdname(argv[i])); } return (error); }
void DatabaseImpl::dumpDatabase() { QFile dump( "dbdump.txt" ); if ( !dump.open( QIODevice::WriteOnly | QIODevice::Text ) ) { tDebug() << "Couldn't open dbdump.txt for writing!"; Q_ASSERT( false ); } else { QTextStream dumpout( &dump ); TomahawkSqlQuery query = newquery(); query.exec( "SELECT * FROM oplog" ); while ( query.next() ) { dumpout << "ID: " << query.value( 0 ).toInt() << endl << "GUID: " << query.value( 2 ).toString() << endl << "Command: " << query.value( 3 ).toString() << endl << "Singleton: " << query.value( 4 ).toBool() << endl << "JSON: " << ( query.value( 5 ).toBool() ? qUncompress( query.value( 6 ).toByteArray() ) : query.value( 6 ).toByteArray() ) << endl << endl << endl; } } }