当前位置: 首页>>代码示例>>C++>>正文


C++ FOutputDevice::SetSuppressEventTag方法代码示例

本文整理汇总了C++中FOutputDevice::SetSuppressEventTag方法的典型用法代码示例。如果您正苦于以下问题:C++ FOutputDevice::SetSuppressEventTag方法的具体用法?C++ FOutputDevice::SetSuppressEventTag怎么用?C++ FOutputDevice::SetSuppressEventTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FOutputDevice的用法示例。


在下文中一共展示了FOutputDevice::SetSuppressEventTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExportToFileEx

int32 UExporter::ExportToFileEx( FExportToFileParams& ExportParams )
{
#if WITH_EDITOR
    check(ExportParams.Object);

    CurrentFilename = ExportParams.Filename;

    UExporter*	Exporter	= ExportParams.Exporter;
    FString		Extension	= FPaths::GetExtension(ExportParams.Filename);
    int32		Result		= 0;

    if (!Exporter)
    {
        // look for an exporter with all possible extensions, so an exporter can have something like *.xxx.yyy as an extension
        int32 SearchStart = 0;
        int32 DotLocation;
        while (!Exporter && (DotLocation = CurrentFilename.Find(TEXT("."), ESearchCase::CaseSensitive, ESearchDir::FromStart, SearchStart)) != INDEX_NONE)
        {
            // get everything after the current .
            Extension = CurrentFilename.Mid(DotLocation + 1);

            // try to find an exporter with it
            Exporter = FindExporter( ExportParams.Object, *Extension );

            // skip past the dot in case we look again
            SearchStart = DotLocation + 1;
        }
    }

    if( !Exporter )
    {
        UE_LOG(LogExporter, Warning, TEXT("No %s exporter found for %s"), *Extension, *(ExportParams.Object->GetFullName()) );
        CurrentFilename = TEXT("");
        return 0;
    }

    Exporter->bSelectedOnly = ExportParams.InSelectedOnly;

    FOutputDevice* TextBuffer = NULL;
    if( Exporter->bText )
    {
        bool bIsFileDevice = false;
        FString TempFile = FPaths::GetPath(ExportParams.Filename);
        if (Exporter->bForceFileOperations || ExportParams.bUseFileArchive)
        {
            IFileManager::Get().MakeDirectory(*TempFile);

            TempFile += TEXT("/UnrealExportFile.tmp");
            TextBuffer = new FOutputDeviceFile(*TempFile);
            if (TextBuffer)
            {
                TextBuffer->SetSuppressEventTag(true);
                TextBuffer->SetAutoEmitLineTerminator(false);
                bIsFileDevice = true;
            }
        }

        if (TextBuffer == NULL)
        {
            if (ExportParams.bUseFileArchive)
            {
                UE_LOG(LogExporter, Warning, TEXT("Failed to create file output device... defaulting to string buffer"));
            }
            TextBuffer = new FStringOutputDevice();
        }
        const FExportObjectInnerContext Context(ExportParams.IgnoreObjectList);
        ExportToOutputDevice( &Context, ExportParams.Object, Exporter, *TextBuffer, *Extension, 0, PPF_ExportsNotFullyQualified, ExportParams.InSelectedOnly );
        if (bIsFileDevice)
        {
            TextBuffer->TearDown();
            IFileManager::Get().Move(ExportParams.Filename, *TempFile, 1, 1);
        }
        else
        {
            FStringOutputDevice& StringBuffer = *((FStringOutputDevice*)TextBuffer);
            if ( StringBuffer.Len() == 0 )
            {
                Result = -1;
            }
            else
            {
                if( ExportParams.NoReplaceIdentical )
                {
                    FString FileBytes;
                    if
                    (	FFileHelper::LoadFileToString(FileBytes,ExportParams.Filename)
                            &&	FCString::Strcmp(*StringBuffer,*FileBytes)==0 )
                    {
                        UE_LOG(LogExporter, Log,  TEXT("Not replacing %s because identical"), ExportParams.Filename );
                        Result = 1;
                        goto Done;
                    }
                    if( ExportParams.Prompt )
                    {
                        if( !GWarn->YesNof( FText::Format( NSLOCTEXT("Core", "Overwrite", "The file '{0}' needs to be updated.  Do you want to overwrite the existing version?"), FText::FromString(  ExportParams.Filename ) ) ) )
                        {
                            Result = 1;
                            goto Done;
                        }
                    }
//.........这里部分代码省略.........
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:101,代码来源:UnrealExporter.cpp


注:本文中的FOutputDevice::SetSuppressEventTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。