Files
UnrealEngineUWP/Engine/Source/Editor/PropertyEditor/Private/PropertyTextUtilities.cpp
bryan sefcik 8cc129f2b6 IWYU Pass 1 - Engine/Source/Editor/...
#jira
#preflight 6306736ac85b7fef22be7751

[CL 21558583 by bryan sefcik in ue5-main branch]
2022-08-24 22:45:13 -04:00

46 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "PropertyTextUtilities.h"
#include "CoreTypes.h"
#include "PropertyHandleImpl.h"
#include "PropertyNode.h"
#include "UObject/UnrealType.h"
class FString;
class UObject;
void FPropertyTextUtilities::PropertyToTextHelper(FString& OutString, const FPropertyNode* InPropertyNode, const FProperty* Property, const uint8* ValueAddress, UObject* Object, EPropertyPortFlags PortFlags)
{
if (InPropertyNode->GetArrayIndex() != INDEX_NONE || Property->ArrayDim == 1)
{
Property->ExportText_Direct(OutString, ValueAddress, ValueAddress, Object, PortFlags);
}
else
{
FArrayProperty::ExportTextInnerItem(OutString, Property, ValueAddress, Property->ArrayDim, ValueAddress, Property->ArrayDim, Object, PortFlags);
}
}
void FPropertyTextUtilities::PropertyToTextHelper(FString& OutString, const FPropertyNode* InPropertyNode, const FProperty* Property, const FObjectBaseAddress& ObjectAddress, EPropertyPortFlags PortFlags)
{
PropertyToTextHelper(OutString, InPropertyNode, Property, ObjectAddress.BaseAddress, ObjectAddress.Object, PortFlags);
}
void FPropertyTextUtilities::TextToPropertyHelper(const TCHAR* Buffer, const FPropertyNode* InPropertyNode, const FProperty* Property, uint8* ValueAddress, UObject* Object, EPropertyPortFlags PortFlags)
{
if (InPropertyNode->GetArrayIndex() != INDEX_NONE || Property->ArrayDim == 1)
{
Property->ImportText_Direct(Buffer, ValueAddress, Object, PortFlags);
}
else
{
FArrayProperty::ImportTextInnerItem(Buffer, Property, ValueAddress, PortFlags, Object);
}
}
void FPropertyTextUtilities::TextToPropertyHelper(const TCHAR* Buffer, const FPropertyNode* InPropertyNode, const FProperty* Property, const FObjectBaseAddress& ObjectAddress, EPropertyPortFlags PortFlags)
{
TextToPropertyHelper(Buffer, InPropertyNode, Property, ObjectAddress.BaseAddress, ObjectAddress.Object, PortFlags);
}