本文整理汇总了C++中MoveTemp函数的典型用法代码示例。如果您正苦于以下问题:C++ MoveTemp函数的具体用法?C++ MoveTemp怎么用?C++ MoveTemp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MoveTemp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ExtractAssetsToDelete
void FContentDirectoryMonitor::ExtractAssetsToDelete(TArray<FAssetData>& OutAssetsToDelete)
{
for (auto& Deletion : DeletedFiles)
{
for (const auto& AssetData : Utils::FindAssetsPertainingToFile(*Registry, Cache.GetDirectory() + Deletion.Filename.Get()))
{
OutAssetsToDelete.Add(AssetData);
}
// Let the cache know that we've dealt with this change (it will be imported in due course)
Cache.CompleteTransaction(MoveTemp(Deletion));
}
DeletedFiles.Empty();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:15,代码来源:ContentDirectoryMonitor.cpp
示例2:
virtual FArchive& operator<<(FStringAssetReference& Value) override
{
FArchive& Ar = *this;
FString Path = Value.ToString();
Ar << Path;
if (IsLoading())
{
Value.SetPath(MoveTemp(Path));
}
return Ar;
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:15,代码来源:HotReloadClassReinstancer.cpp
示例3: CreateTextTokenFromUnquotedString
/** Given a potential string, we produce a final FTextToken for it using the correct comparison mode (as inferred from the given string) */
FTextToken CreateTextTokenFromUnquotedString(FString InString)
{
ETextFilterTextComparisonMode TextComparisonMode = ETextFilterTextComparisonMode::Partial;
// The final string may embed the TextCmpExact (+) operator, or the TextCmpAnchor operators (...) - test for those now so we can use the correct comparison mode
if (InString.Len() > 0 && InString[0] == '+')
{
// Matched TextCmpExact - update the comparison mode and remove the + token from the start of the string
TextComparisonMode = ETextFilterTextComparisonMode::Exact;
InString.RemoveAt(0, 1, false);
}
else if (InString.Len() > 2 && InString.StartsWith(TEXT("..."), ESearchCase::CaseSensitive))
{
// Matched TextCmpAnchor (pre-unary) - update the comparison mode and remove the ... token from the start of the string
TextComparisonMode = ETextFilterTextComparisonMode::EndsWith;
InString.RemoveAt(0, 3, false);
}
else if (InString.Len() > 2 && InString.EndsWith(TEXT("..."), ESearchCase::CaseSensitive))
{
// Matched TextCmpAnchor (post-unary) - update the comparison mode and remove the ... token from the end of the string
TextComparisonMode = ETextFilterTextComparisonMode::StartsWith;
InString.RemoveAt(InString.Len() - 3, 3, false);
}
// To preserve behavior with the old text filter, the final string may also contain a TextCmpInvert (-) operator (after stripping the TextCmpExact or TextCmpAnchor tokens from the start)
FTextToken::EInvertResult InvertResult = FTextToken::EInvertResult::No;
if (InString.Len() > 0 && InString[0] == '-')
{
// Matched TextCmpInvert - remove the - token from the start of the string
InvertResult = FTextToken::EInvertResult::Yes;
InString.RemoveAt(0, 1, false);
}
// Finally, if our string starts and ends with a quote, we need to strip those off now
if (InString.Len() > 1 && (InString[0] == '"' || InString[0] == '\''))
{
const TCHAR QuoteChar = InString[0];
if (InString[InString.Len() - 1] == QuoteChar)
{
// Remove the quotes
InString.RemoveAt(0, 1, false);
InString.RemoveAt(InString.Len() - 1, 1, false);
}
}
return FTextToken(MoveTemp(InString), TextComparisonMode, InvertResult);
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:48,代码来源:TextFilterExpressionEvaluator.cpp
示例4: GET_MEMBER_NAME_CHECKED
TSharedRef<IToolTip> FWidgetTemplateBlueprintClass::GetToolTip() const
{
FText Description;
FString DescriptionStr = WidgetAssetData.GetTagValueRef<FString>( GET_MEMBER_NAME_CHECKED( UBlueprint, BlueprintDescription ) );
if ( !DescriptionStr.IsEmpty() )
{
DescriptionStr.ReplaceInline( TEXT( "\\n" ), TEXT( "\n" ) );
Description = FText::FromString( MoveTemp(DescriptionStr) );
}
else
{
Description = Name;
}
return IDocumentation::Get()->CreateToolTip( Description, nullptr, FString( TEXT( "Shared/Types/" ) ) + Name.ToString(), TEXT( "Class" ) );
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:17,代码来源:WidgetTemplateBlueprintClass.cpp
示例5: MoveTemp
void UCreatureAnimationAsset::PostLoad()
{
Super::PostLoad();
if (!creature_filename.IsEmpty() && AssetImportData && AssetImportData->GetSourceData().SourceFiles.Num() == 0)
{
// convert old source file path to proper UE4 Asset data system
FAssetImportInfo Info;
Info.Insert(FAssetImportInfo::FSourceFile(creature_filename));
AssetImportData->SourceData = MoveTemp(Info);
}
if (CreatureZipBinary.Num() != 0 || CreatureFileJSonData.IsEmpty() == false)
{
// load the animation data caches from the json data
GatherAnimationData();
}
}
开发者ID:amyvmiwei,项目名称:Creature_UE4,代码行数:18,代码来源:CreatureAnimationAsset.cpp
示例6: UE_LOG_ONLINE
bool FOnlineUserCloudOculus::ReadUserFile(const FUniqueNetId& UserId, const FString& FileName)
{
auto LoggedInPlayerId = OculusSubsystem.GetIdentityInterface()->GetUniquePlayerId(0);
if (!LoggedInPlayerId.IsValid() || UserId != *LoggedInPlayerId)
{
UE_LOG_ONLINE(Warning, TEXT("Can only read data for logged in player"));
return false;
}
FString BucketName;
FString Key;
if (!(FileName.Split(SEPARATOR, &BucketName, &Key)))
{
BucketName = DefaultBucket;
Key = FileName;
}
OculusSubsystem.AddRequestDelegate(
ovr_CloudStorage_Load(TCHAR_TO_UTF8(*BucketName), TCHAR_TO_UTF8(*Key)),
FOculusMessageOnCompleteDelegate::CreateLambda([this, BucketName, Key, LoggedInPlayerId, FileName](ovrMessageHandle Message, bool bIsError)
{
ovrCloudStorageDataHandle response = ovr_Message_GetCloudStorageData(Message);
check(BucketName == UTF8_TO_TCHAR(ovr_CloudStorageData_GetBucket(response)));
check(Key == UTF8_TO_TCHAR(ovr_CloudStorageData_GetKey(response)));
if (bIsError)
{
UE_LOG_ONLINE(Warning, TEXT("Failed to Load: %s%s%s"), *BucketName, *SEPARATOR, *Key);
}
else
{
int64 BlobSize = ovr_CloudStorageData_GetDataSize(response);
const void* RawBlob = ovr_CloudStorageData_GetData(response);
TArray<uint8> Blob;
Blob.Insert(static_cast<const uint8 *>(RawBlob), BlobSize, 0);
ReadCache.Add(FileName, MoveTemp(Blob));
}
TriggerOnReadUserFileCompleteDelegates(!bIsError, *LoggedInPlayerId, FileName);
}));
return true;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:44,代码来源:OnlineUserCloudOculus.cpp
示例7: MoveTemp
void FVideoCaptureProtocol::ProcessFrame(FCapturedFrameData Frame)
{
FVideoFrameData* Payload = Frame.GetPayload<FVideoFrameData>();
const int32 WriterIndex = Payload->WriterIndex;
AVIWriters[WriterIndex]->DropFrames(Payload->Metrics.NumDroppedFrames);
AVIWriters[WriterIndex]->Update(Payload->Metrics.TotalElapsedTime, MoveTemp(Frame.ColorBuffer));
// Finalize previous writers if necessary
for (int32 Index = 0; Index < Payload->WriterIndex; ++Index)
{
TUniquePtr<FAVIWriter>& Writer = AVIWriters[Index];
if (Writer->IsCapturing())
{
Writer->Finalize();
}
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:19,代码来源:VideoCaptureProtocol.cpp
示例8: TEXT
void FVideoCaptureProtocol::ConditionallyCreateWriter(const ICaptureProtocolHost& Host)
{
#if PLATFORM_MAC
static const TCHAR* Extension = TEXT(".mov");
#else
static const TCHAR* Extension = TEXT(".avi");
#endif
FString VideoFilename = Host.GenerateFilename(FFrameMetrics(), Extension);
if (AVIWriters.Num() && VideoFilename == AVIWriters.Last()->Options.OutputFilename)
{
return;
}
Host.EnsureFileWritable(VideoFilename);
UVideoCaptureSettings* CaptureSettings = CastChecked<UVideoCaptureSettings>(InitSettings->ProtocolSettings);
FAVIWriterOptions Options;
Options.OutputFilename = MoveTemp(VideoFilename);
Options.CaptureFPS = Host.GetCaptureFrequency();
Options.CodecName = CaptureSettings->VideoCodec;
Options.bSynchronizeFrames = Host.GetCaptureStrategy().ShouldSynchronizeFrames();
Options.Width = InitSettings->DesiredSize.X;
Options.Height = InitSettings->DesiredSize.Y;
if (CaptureSettings->bUseCompression)
{
Options.CompressionQuality = CaptureSettings->CompressionQuality / 100.f;
float QualityOverride = 100.f;
if (FParse::Value( FCommandLine::Get(), TEXT( "-MovieQuality=" ), QualityOverride ))
{
Options.CompressionQuality = FMath::Clamp(QualityOverride, 1.f, 100.f) / 100.f;
}
Options.CompressionQuality = FMath::Clamp<float>(Options.CompressionQuality.GetValue(), 0.f, 1.f);
}
AVIWriters.Emplace(FAVIWriter::CreateInstance(Options));
AVIWriters.Last()->Initialize();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:43,代码来源:VideoCaptureProtocol.cpp
示例9: GetTypeName
bool FStringAssetReference::SerializeFromMismatchedTag(struct FPropertyTag const& Tag, FArchive& Ar)
{
struct UObjectTypePolicy
{
typedef UObject Type;
static const FName FORCEINLINE GetTypeName() { return NAME_ObjectProperty; }
};
FString Path = ToString();
bool bReturn = SerializeFromMismatchedTagTemplate<UObjectTypePolicy>(Path, Tag, Ar);
if (Ar.IsLoading())
{
SetPath(MoveTemp(Path));
}
return bReturn;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:19,代码来源:StringAssetReference.cpp
示例10: AddDirectoriesToCommit
/**
* Helper function for FCheckInWorker::Execute.
* Makes sure directories are committed with files that are also marked for add.
* If we don't do this, the commit will fail.
*/
static void AddDirectoriesToCommit(const FSubversionSourceControlCommand& InCommand, TArray<FString>& InOutFiles)
{
// because of the use of "--parents" when we mark for add, we can just traverse up
// the directory tree until we meet a directory that isn't already marked for add
TArray<FString> Directories;
FString WorkingCopyRoot = InCommand.WorkingCopyRoot;
FPaths::NormalizeDirectoryName(WorkingCopyRoot);
for(const auto& Filename : InOutFiles)
{
FString Directory = FPaths::GetPath(Filename);
FPaths::NormalizeDirectoryName(Directory);
// Stop once we leave our working copy, or find a directory that isn't marked for add
while(Directory.StartsWith(WorkingCopyRoot))
{
// Stop if we've already processed this directory, or if this directory isn't marked for add
if(Directories.Contains(Directory) || !IsDirectoryAdded(InCommand, Directory))
{
break;
}
Directories.Add(Directory);
// Chop off the end of this directory to move up to our parent directory
// This is safe to do since we called NormalizeDirectoryName on it, and we're testing to make sure we stay within the working copy
int32 ChopPoint = INDEX_NONE;
if(Directory.FindLastChar('/', ChopPoint))
{
Directory = Directory.Left(ChopPoint);
}
else
{
// No more path to process
break;
}
}
}
InOutFiles.Append(MoveTemp(Directories));
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:48,代码来源:SubversionSourceControlOperations.cpp
示例11: SetupView
virtual void SetupView(FSceneViewFamily& InViewFamily, FSceneView& InView)
{
if (!bNeedsCapture)
{
return;
}
InView.FinalPostProcessSettings.bBufferVisualizationDumpRequired = true;
InView.FinalPostProcessSettings.BufferVisualizationOverviewMaterials.Empty();
InView.FinalPostProcessSettings.BufferVisualizationDumpBaseFilename = MoveTemp(OutputFilename);
struct FIterator
{
FFinalPostProcessSettings& FinalPostProcessSettings;
const TArray<FString>& RenderPasses;
FIterator(FFinalPostProcessSettings& InFinalPostProcessSettings, const TArray<FString>& InRenderPasses)
: FinalPostProcessSettings(InFinalPostProcessSettings), RenderPasses(InRenderPasses)
{}
void ProcessValue(const FString& InName, UMaterial* Material, const FText& InText)
{
if (!RenderPasses.Num() || RenderPasses.Contains(InName) || RenderPasses.Contains(InText.ToString()))
{
FinalPostProcessSettings.BufferVisualizationOverviewMaterials.Add(Material);
}
}
} Iterator(InView.FinalPostProcessSettings, RenderPasses);
GetBufferVisualizationData().IterateOverAvailableMaterials(Iterator);
if (PostProcessingMaterial)
{
FWeightedBlendable Blendable(1.f, PostProcessingMaterial);
PostProcessingMaterial->OverrideBlendableSettings(InView, 1.f);
}
// Ensure we're rendering at full size
InView.ViewRect = InView.UnscaledViewRect;
bNeedsCapture = false;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:42,代码来源:CompositionGraphCaptureProtocol.cpp
示例12: TEXT
bool FStringAssetReference::ImportTextItem(const TCHAR*& Buffer, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText)
{
FString ImportedPath = TEXT("");
const TCHAR* NewBuffer = UPropertyHelpers::ReadToken(Buffer, ImportedPath, 1);
if (!NewBuffer)
{
return false;
}
Buffer = NewBuffer;
if (ImportedPath == TEXT("None"))
{
ImportedPath = TEXT("");
}
else
{
if (*Buffer == TCHAR('\''))
{
NewBuffer = UPropertyHelpers::ReadToken(Buffer, ImportedPath, 1);
if (!NewBuffer)
{
return false;
}
Buffer = NewBuffer;
if (*Buffer++ != TCHAR('\''))
{
return false;
}
}
}
SetPath(MoveTemp(ImportedPath));
#if WITH_EDITOR
// Consider this a load, so Config string asset references get cooked
if (FCoreUObjectDelegates::StringAssetReferenceLoaded.IsBound())
{
FCoreUObjectDelegates::StringAssetReferenceLoaded.Execute(ToString());
}
#endif // WITH_EDITOR
return true;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:42,代码来源:StringAssetReference.cpp
示例13: Finalize
void Finalize()
{
TArray<uint8> FinalData;
FMemoryWriter NameTableWriter(FinalData);
int32 NumNames = FNameIndexLookup.Num();
check(NumNames <= MANIFEST_MAX_NAMES);
NameTableWriter << NumNames;
for (auto& MapEntry : FNameIndexLookup)
{
FName& Name = MapEntry.Key;
int32& Index = MapEntry.Value;
NameTableWriter << Name;
NameTableWriter << Index;
}
FinalData.Append(Bytes);
Bytes = MoveTemp(FinalData);
}
开发者ID:johndpope,项目名称:UE4,代码行数:20,代码来源:BuildPatchManifest.cpp
示例14: FTimespan
void FContentDirectoryMonitor::Tick()
{
Cache.Tick();
// Immediately resolve any changes that we should not consider
const FDateTime Threshold = FDateTime::UtcNow() - FTimespan(0, 0, GetDefault<UEditorLoadingSavingSettings>()->AutoReimportThreshold);
TArray<DirectoryWatcher::FUpdateCacheTransaction> InsignificantTransactions = Cache.FilterOutstandingChanges([=](const DirectoryWatcher::FUpdateCacheTransaction& Transaction, const FDateTime& TimeOfChange){
return TimeOfChange <= Threshold && !ShouldConsiderChange(Transaction);
});
for (DirectoryWatcher::FUpdateCacheTransaction& Transaction : InsignificantTransactions)
{
Cache.CompleteTransaction(MoveTemp(Transaction));
}
const double Now = FPlatformTime::Seconds();
if (Now - LastSaveTime > ResaveIntervalS)
{
LastSaveTime = Now;
Cache.WriteCache();
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:23,代码来源:ContentDirectoryMonitor.cpp
示例15: FromJson
void UAssetImportData::Serialize(FArchive& Ar)
{
if (Ar.UE4Ver() >= VER_UE4_ASSET_IMPORT_DATA_AS_JSON)
{
FString Json;
if (Ar.IsLoading())
{
Ar << Json;
TOptional<FAssetImportInfo> Copy = FromJson(MoveTemp(Json));
if (Copy.IsSet())
{
CopyFrom(Copy.GetValue());
}
}
else if (Ar.IsSaving())
{
Json = ToJson();
Ar << Json;
}
}
Super::Serialize(Ar);
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:23,代码来源:AssetImportData.cpp
示例16:
FArchive& FArchiveUObject::operator<<(struct FStringAssetReference& Value)
{
FString Path = Value.ToString();
*this << Path;
if (IsLoading())
{
if (UE4Ver() < VER_UE4_KEEP_ONLY_PACKAGE_NAMES_IN_STRING_ASSET_REFERENCES_MAP)
{
FString NormalizedPath = FPackageName::GetNormalizedObjectPath(Path);
if (Value.ToString() != NormalizedPath)
{
Value.SetPath(NormalizedPath);
}
}
else
{
Value.SetPath(MoveTemp(Path));
}
}
return *this;
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:24,代码来源:ArchiveUObject.cpp
示例17: TestWithType
bool TestWithType(FAutomationTestBase* Test)
{
int32 NumLeaks = 0;
// Test that move-assigning the expression node correctly assigns the data, and calls the destructors successfully
{
TGuardValue<int32*> LeakCounter(T::LeakCount, &NumLeaks);
FExpressionNode Original(T(1));
FExpressionNode New = MoveTemp(Original);
int32 ResultingId = New.Cast<T>()->Id;
if (ResultingId != 1)
{
Test->AddError(FString::Printf(TEXT("Expression node move operator did not operate correctly. Expected moved-to state to be 1, it's actually %d."), ResultingId));
return false;
}
// Try assigning it over the top again
Original = FExpressionNode(T(1));
New = MoveTemp(Original);
ResultingId = New.Cast<T>()->Id;
if (ResultingId != 1)
{
Test->AddError(FString::Printf(TEXT("Expression node move operator did not operate correctly. Expected moved-to state to be 1, it's actually %d."), ResultingId));
return false;
}
// Now try running it all through a parser
FTokenDefinitions TokenDefs;
FExpressionGrammar Grammar;
FOperatorJumpTable JumpTable;
// Only valid tokens are a, b, and +
TokenDefs.DefineToken([](FExpressionTokenConsumer& Consumer){
auto Token = Consumer.GetStream().GenerateToken(1);
if (Token.IsSet())
{
switch(Consumer.GetStream().PeekChar())
{
case 'a': Consumer.Add(Token.GetValue(), T(1)); break;
case '+': Consumer.Add(Token.GetValue(), FOperator()); break;
}
}
return TOptional<FExpressionError>();
});
Grammar.DefinePreUnaryOperator<FOperator>();
Grammar.DefineBinaryOperator<FOperator>(1);
JumpTable.MapPreUnary<FOperator>([](const T& A) { return T(A.Id); });
JumpTable.MapBinary<FOperator>([](const T& A, const T& B) { return T(A.Id); });
ExpressionParser::Evaluate(TEXT("+a"), TokenDefs, Grammar, JumpTable);
ExpressionParser::Evaluate(TEXT("a+a"), TokenDefs, Grammar, JumpTable);
ExpressionParser::Evaluate(TEXT("+a++a"), TokenDefs, Grammar, JumpTable);
}
if (NumLeaks != 0)
{
Test->AddError(FString::Printf(TEXT("Expression node did not call wrapped type's destructors correctly. Potentially resulted in %d leaks."), NumLeaks));
return false;
}
return true;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:67,代码来源:ExpressionParser.cpp
示例18: check
bool FPackageReader::ReadAssetRegistryData (TArray<FBackgroundAssetData*>& AssetDataList)
{
check(Loader);
// Does the package contain asset registry tags
if( PackageFileSummary.AssetRegistryDataOffset == 0 )
{
// No Tag Table!
return false;
}
// Seek the the part of the file where the asset registry tags live
Seek( PackageFileSummary.AssetRegistryDataOffset );
// Determine the package name and path
FString PackageName = FPackageName::FilenameToLongPackageName(PackageFilename);
FString PackagePath = FPackageName::GetLongPackagePath(PackageName);
const bool bIsMapPackage = (PackageFileSummary.PackageFlags & PKG_ContainsMap) != 0;
// Assets do not show up in map packages unless we launch with -WorldAssets
static const bool bUsingWorldAssets = FAssetRegistry::IsUsingWorldAssets();
if ( bIsMapPackage && !bUsingWorldAssets )
{
return true;
}
// Load the object count
int32 ObjectCount = 0;
*this << ObjectCount;
// Worlds that were saved before they were marked public do not have asset data so we will synthesize it here to make sure we see all legacy umaps
// We will also do this for maps saved after they were marked public but no asset data was saved for some reason. A bug caused this to happen for some maps.
if (bUsingWorldAssets && bIsMapPackage)
{
const bool bLegacyPackage = PackageFileSummary.GetFileVersionUE4() < VER_UE4_PUBLIC_WORLDS;
const bool bNoMapAsset = (ObjectCount == 0);
if (bLegacyPackage || bNoMapAsset)
{
FString AssetName = FPackageName::GetLongPackageAssetName(PackageName);
AssetDataList.Add(new FBackgroundAssetData(PackageName, PackagePath, FString(), MoveTemp(AssetName), TEXT("World"), TMap<FString, FString>(), PackageFileSummary.ChunkIDs, PackageFileSummary.PackageFlags));
}
}
// UAsset files only have one object, but legacy or map packages may have more.
for(int32 ObjectIdx = 0; ObjectIdx < ObjectCount; ++ObjectIdx)
{
FString ObjectPath;
FString ObjectClassName;
int32 TagCount = 0;
*this << ObjectPath;
*this << ObjectClassName;
*this << TagCount;
TMap<FString, FString> TagsAndValues;
for(int32 TagIdx = 0; TagIdx < TagCount; ++TagIdx)
{
FString Key;
FString Value;
*this << Key;
*this << Value;
TagsAndValues.Add(Key, Value);
}
FString GroupNames;
FString AssetName;
if ( ObjectPath.Contains(TEXT("."), ESearchCase::CaseSensitive))
{
ObjectPath.Split(TEXT("."), &GroupNames, &AssetName, ESearchCase::CaseSensitive, ESearchDir::FromEnd);
}
else
{
AssetName = ObjectPath;
}
// Before world were RF_Public, other non-public assets were added to the asset data table in map packages.
// Here we simply skip over them
if ( bIsMapPackage && PackageFileSummary.GetFileVersionUE4() < VER_UE4_PUBLIC_WORLDS )
{
if ( AssetName != FPackageName::GetLongPackageAssetName(PackageName) )
{
continue;
}
}
// Create a new FBackgroundAssetData for this asset and update it with the gathered data
AssetDataList.Add(new FBackgroundAssetData(PackageName, PackagePath, MoveTemp(GroupNames), MoveTemp(AssetName), MoveTemp(ObjectClassName), MoveTemp(TagsAndValues), PackageFileSummary.ChunkIDs, PackageFileSummary.PackageFlags));
}
return true;
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:94,代码来源:PackageReader.cpp
示例19: ConsumeTextImpl
/** Consume the text from the specified consumer's stream */
TOptional<FExpressionError> ConsumeTextImpl(FExpressionTokenConsumer& Consumer, const TFunctionRef<bool(TCHAR)> IsBreakingCharacter)
{
auto& Stream = Consumer.GetStream();
FString FinalString;
FString CurrentQuotedString;
TCHAR QuoteChar = 0;
int32 NumConsecutiveSlashes = 0;
TOptional<FStringToken> TextToken = Stream.ParseToken([&](TCHAR InC)
{
if (QuoteChar == 0) // Parsing a non-quoted string...
{
// Are we starting a quoted sub-string?
if (InC == '"' || InC == '\'')
{
CurrentQuotedString.AppendChar(InC);
QuoteChar = InC;
NumConsecutiveSlashes = 0;
}
else
{
// Consume until we hit a breaking character
if (IsBreakingCharacter(InC))
{
return EParseState::StopBefore;
}
FinalString.AppendChar(InC);
}
}
else // Parsing a quoted sub-string...
{
CurrentQuotedString.AppendChar(InC);
// Are we ending a quoted sub-string?
if (InC == QuoteChar && NumConsecutiveSlashes%2 == 0)
{
UnescapeQuotedString(CurrentQuotedString, QuoteChar);
FinalString.Append(CurrentQuotedString);
CurrentQuotedString.Reset();
QuoteChar = 0;
}
if (InC == '\\')
{
NumConsecutiveSlashes++;
}
else
{
NumConsecutiveSlashes = 0;
}
}
return EParseState::Continue;
});
if (TextToken.IsSet())
{
Consumer.Add(TextToken.GetValue(), CreateTextTokenFromUnquotedString(MoveTemp(FinalString)));
}
return TOptional<FExpressionError>();
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:66,代码来源:TextFilterExpressionEvaluator.cpp
示例20: Evaluate
FExpressionResult Evaluate(const TArray<FCompiledToken>& CompiledTokens, const IOperatorEvaluationEnvironment& InEnvironment)
{
// Evaluation strategy: the supplied compiled tokens are const. To avoid copying the whole array, we store a separate array of
// any tokens that are generated at runtime by the evaluator. The operand stack will consist of indices into either the CompiledTokens
// array, or the RuntimeGeneratedTokens (where Index >= CompiledTokens.Num())
TArray<FExpressionToken> RuntimeGeneratedTokens;
TArray<int32> OperandStack;
/** Get the token pertaining to the specified operand index */
auto GetToken = [&](int32 Index) -> const FExpressionToken& {
if (Index < CompiledTokens.Num())
{
return CompiledTokens[Index];
}
return RuntimeGeneratedTokens[Index - CompiledTokens.Num()];
};
/** Add a new token to the runtime generated array */
auto AddToken = [&](FExpressionToken&& In) -> int32 {
auto Index = CompiledTokens.Num() + RuntimeGeneratedTokens.Num();
RuntimeGeneratedTokens.Emplace(MoveTemp(In));
return Index;
};
for (int32 Index = 0; Index < CompiledTokens.Num(); ++Index)
{
const auto& Token = CompiledTokens[Index];
switch(Token.Type)
{
case FCompiledToken::Benign:
continue;
case FCompiledToken::Operand:
OperandStack.Push(Index);
continue;
case FCompiledToken::BinaryOperator:
if (OperandStack.Num() >= 2)
{
// Binary
const auto& R = GetToken(OperandStack.Pop());
const auto& L = GetToken(OperandStack.Pop());
auto OpResult = InEnvironment.ExecBinary(Token, L, R);
if (OpResult.IsValid())
{
// Inherit the LHS context
OperandStack.Push(AddToken(FExpressionToken(L.Context, MoveTemp(OpResult.GetValue()))));
}
else
{
return MakeError(OpResult.GetError());
}
}
else
{
FFormatOrderedArguments Args;
Args.Add(FText::FromString(Token.Context.GetString()));
return MakeError(FText::Format(LOCTEXT("SyntaxError_NotEnoughOperandsBinary", "Not enough operands for binary operator {0}"), Args));
}
break;
case FCompiledToken::PostUnaryOperator:
case FCompiledToken::PreUnaryOperator:
if (OperandStack.Num() >= 1)
{
const auto& Operand = GetToken(OperandStack.Pop());
FExpressionResult OpResult = (Token.Type == FCompiledToken::PreUnaryOperator) ?
InEnvironment.ExecPreUnary(Token, Operand) :
InEnvironment.ExecPostUnary(Token, Operand);
if (OpResult.IsValid())
{
// Inherit the LHS context
OperandStack.Push(AddToken(FExpressionToken(Operand.Context, MoveTemp(OpResult.GetValue()))));
}
else
{
return MakeError(OpResult.GetError());
}
}
else
{
FFormatOrderedArguments Args;
Args.Add(FText::FromString(Token.Context.GetString()));
return MakeError(FText::Format(LOCTEXT("SyntaxError_NoUnaryOperand", "No operand for unary operator {0}"), Args));
}
break;
}
}
if (OperandStack.Num() == 1)
{
return MakeValue(GetToken(OperandStack[0]).Node.Copy());
}
//.........这里部分代码省略.........
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:101,代码来源:ExpressionParser.cpp
注:本文中的MoveTemp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论