Ejemplo n.º 1
0
void Warp::writeSettings( const WarpList &warps, const DataTargetRef &target )
{
	// create default <profile> (profiles are not yet supported)
	XmlTree profile;
	profile.setTag( "profile" );
	profile.setAttribute( "name", "default" );

	//
	for( unsigned i = 0; i < warps.size(); ++i ) {
		// create <map>
		XmlTree map;
		map.setTag( "map" );
		map.setAttribute( "id", i + 1 );
		map.setAttribute( "display", 1 ); // not supported yet

		// create <warp>
		map.push_back( warps[i]->toXml() );

		// add map to profile
		profile.push_back( map );
	}

	// create config document and root <warpconfig>
	XmlTree doc;
	doc.setTag( "warpconfig" );
	doc.setAttribute( "version", "1.0" );
	doc.setAttribute( "profile", "default" );

	// add profile to root
	doc.push_back( profile );

	// write file
	doc.write( target );
}
Ejemplo n.º 2
0
void XMLTestApp::mouseDown( MouseEvent event )
{
	XmlTree doc = XmlTree::createDoc();
	XmlTree library( "library", "" );
	XmlTree album( "album", "" );
	album.setAttribute( "musician", "Sufjan Stevens" );
	album.setAttribute( "year", "2004" );
	album.push_back( XmlTree( "title", "Seven Swans" ) );
	album.push_back( XmlTree( "track", "All the Trees of the Field Will Clap Their Hands" ) );
	album.push_back( XmlTree( "track", "The Dress Looks Nice on You" ) );
	album.push_back( XmlTree( "track", "In the Devil's Territory" ) );
	album.push_back( XmlTree( "track", "To Be Alone With You" ) );
	library.push_back( album );
	doc.push_back( library );
	console() << doc;
	doc.write( writeFile( getHomeDirectory() / "testoutput.xml" ), false );
}
Ejemplo n.º 3
0
void DataManager::generateXmlFile(){
    XmlTree dataTree;
    dataTree.setTag("QLT_Genome_Data");

    dataTree.push_back(XmlTree("datapath","./data/exons/"));
    
    XmlTree datas("datasets","");
    for(int i=0;i<23;i++){
        XmlTree dataset("dataset","");
        dataset.setAttribute("id", i);
        dataset.push_back( XmlTree("title","Chromosome "+toString(i+1)) );
        dataset.push_back( XmlTree("map","exons."+toString(i+1)+".locations") );
        dataset.push_back( XmlTree("bases","exons."+toString(i+1)+".bases") );
        datas.push_back( dataset );
    }
    dataTree.push_back( datas );

    DataTargetPathRef f = writeFile( getAssetPath( "QLT_Genome_Data.xml" ), true );
    dataTree.write( f );
    
}