示例#1
0
//======================================================================
//
// Do the command in query mode. It only does one thing, print the Stream,
// Channel, Associations, and Structure formats available.
//
MStatus exportMetadataCmd::doQuery()
{
	assert( fSerializer );
	MStatus status = MS::kSuccess;

	std::set<const adsk::Data::StreamSerializer*>::iterator sFmtIt;
	for( sFmtIt = adsk::Data::StreamSerializer::allFormats().begin();
		 sFmtIt != adsk::Data::StreamSerializer::allFormats().end(); sFmtIt++ )
	{
		const adsk::Data::StreamSerializer* fmt = *sFmtIt;
		MString fmtMsg( MStringResource::getString(kExportMetadataFormatType, status) );
		MString fmtType( "Stream" );
		MString fmtName( fmt->formatType() );
		MString msg;
		msg.format( fmtMsg, fmtType, fmtName );
		appendToResult( msg );
	}

	std::set<const adsk::Data::ChannelSerializer*>::iterator cFmtIt;
	for( cFmtIt = adsk::Data::ChannelSerializer::allFormats().begin();
		 cFmtIt != adsk::Data::ChannelSerializer::allFormats().end(); cFmtIt++ )
	{
		const adsk::Data::ChannelSerializer* fmt = *cFmtIt;
		MString fmtMsg( MStringResource::getString(kExportMetadataFormatType, status) );
		MString fmtType( "Channel" );
		MString fmtName( fmt->formatType() );
		MString msg;
		msg.format( fmtMsg, fmtType, fmtName );
		appendToResult( msg );
	}

	std::set<const adsk::Data::AssociationsSerializer*>::iterator aFmtIt;
	for( aFmtIt = adsk::Data::AssociationsSerializer::allFormats().begin();
		 aFmtIt != adsk::Data::AssociationsSerializer::allFormats().end(); aFmtIt++ )
	{
		const adsk::Data::AssociationsSerializer* fmt = *aFmtIt;
		MString fmtMsg( MStringResource::getString(kExportMetadataFormatType, status) );
		MString fmtType( "Associations" );
		MString fmtName( fmt->formatType() );
		MString msg;
		msg.format( fmtMsg, fmtType, fmtName );
		appendToResult( msg );
	}

	std::set<const adsk::Data::StructureSerializer*>::iterator fmtIt;
	for( fmtIt = adsk::Data::StructureSerializer::allFormats().begin();
		 fmtIt != adsk::Data::StructureSerializer::allFormats().end(); fmtIt++ )
	{
		const adsk::Data::StructureSerializer* fmt = *fmtIt;
		MString fmtMsg( MStringResource::getString(kExportMetadataFormatType, status) );
		MString fmtType( "Structure" );
		MString fmtName( fmt->formatType() );
		MString msg;
		msg.format( fmtMsg, fmtType, fmtName );
		appendToResult( msg );
	}

	return status;
}
示例#2
0
static void printRecord(const char* tag, const hlt_profiler_record* rec)
{
    printf("%" PRIu64 " %" PRIu64 " %s %s %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 "\n",
           rec->ctime, rec->cwall, tag, fmtType(rec->type), rec->time, rec->wall, rec->updates, rec->cycles, rec->misses, rec->alloced, rec->heap, rec->user);
}