UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DefaultValueHelper.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "CoreTypes.h"
7#include "Math/MathFwd.h"
8#include "Misc/Timespan.h"
9
10struct FColor;
11struct FLinearColor;
12
13//
14// FDefaultValueHelper
15//
16
18{
20 static TCHAR TS(const TCHAR* Sign);
21
22 static bool IsWhitespace(TCHAR Char);
23
28 static bool Trim(int32& Pos, const FString& Source);
29
31 static const TCHAR* StartOf(const FString& Source);
32
34 static const TCHAR* EndOf(const FString& Source);
35
40 static bool Trim(const TCHAR* & Start, const TCHAR* End );
41
46 static bool IsStringValidFloat(const TCHAR* Start, const TCHAR* End);
47
49 static bool IsStringValidInteger(const TCHAR* Start, const TCHAR* End, int32& OutBase);
50 static bool IsStringValidInteger(const TCHAR* Start, const TCHAR* End);
51
52public:
53
54 static CORE_API FString GetUnqualifiedEnumValue(const FString& Source);
55
56 static CORE_API bool HasWhitespaces(const FString& Source);
57
58 static CORE_API FString RemoveWhitespaces(const FString& Source);
59
61 static CORE_API bool GetParameters(const FString& Source, const FString& TypeName, FString& OutForm);
62
64 static CORE_API bool Is(const FString& Source, const TCHAR* CompareStr);
65
70 static CORE_API bool StringFromCppString(const FString& Source, const FString& TypeName, FString& OutForm);
71
72 /*
73 * Following functions accept c++ style representations of numbers.
74 * e.g. 13.5e-2f for float or -0x123 for int
75 */
76 static CORE_API bool IsStringValidInteger(const FString& Source);
77
78 static CORE_API bool IsStringValidFloat(const FString& Source);
79
81 static CORE_API bool IsStringValidVector(const FString& Source);
82
84 static CORE_API bool IsStringValidRotator(const FString& Source);
85
87 static CORE_API bool IsStringValidLinearColor(const FString& Source);
88
89
98 static CORE_API bool ParseInt(const FString& Source, int32& OutVal);
99
109 static CORE_API bool ParseBool(const FString& Source, bool& OutVal);
110
119 static CORE_API bool ParseInt64(const FString& Source, int64& OutVal);
120
129 static CORE_API bool ParseFloat(const FString& Source, float& OutVal);
130
139 static CORE_API bool ParseDouble(const FString& Source, double& OutVal);
140
149 static CORE_API bool ParseVector(const FString& Source, FVector3f& OutVal);
150 static CORE_API bool ParseVector(const FString& Source, FVector3d& OutVal);
151
160 static CORE_API bool ParseVector2D(const FString& Source, FVector2f& OutVal);
161 static CORE_API bool ParseVector2D(const FString& Source, FVector2d& OutVal);
162
171 static CORE_API bool ParseVector4(const FString& Source, FVector4f& OutVal);
172 static CORE_API bool ParseVector4(const FString& Source, FVector4d& OutVal);
173
182 static CORE_API bool ParseRotator(const FString& Source, FRotator3f& OutVal);
183 static CORE_API bool ParseRotator(const FString& Source, FRotator3d& OutVal);
184
194 static CORE_API bool ParseLinearColor(const FString& Source, FLinearColor& OutVal);
195
205 static CORE_API bool ParseColor(const FString& Source, FColor& OutVal);
206};
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Char
Character type.
Definition DefaultValueHelper.h:18
static CORE_API bool ParseVector(const FString &Source, FVector3f &OutVal)
Definition DefaultValueHelper.cpp:432
static CORE_API bool ParseVector2D(const FString &Source, FVector2f &OutVal)
Definition DefaultValueHelper.cpp:491
static CORE_API bool ParseRotator(const FString &Source, FRotator3f &OutVal)
Definition DefaultValueHelper.cpp:567
static CORE_API bool GetParameters(const FString &Source, const FString &TypeName, FString &OutForm)
Definition DefaultValueHelper.cpp:130
static CORE_API bool ParseVector4(const FString &Source, FVector4f &OutVal)
Definition DefaultValueHelper.cpp:535
static CORE_API bool IsStringValidVector(const FString &Source)
Definition DefaultValueHelper.cpp:320
static CORE_API bool HasWhitespaces(const FString &Source)
Definition DefaultValueHelper.cpp:117
static CORE_API bool StringFromCppString(const FString &Source, const FString &TypeName, FString &OutForm)
Definition DefaultValueHelper.cpp:340
static CORE_API bool IsStringValidRotator(const FString &Source)
Definition DefaultValueHelper.cpp:327
static CORE_API bool ParseLinearColor(const FString &Source, FLinearColor &OutVal)
Definition DefaultValueHelper.cpp:697
static CORE_API bool ParseDouble(const FString &Source, double &OutVal)
Definition DefaultValueHelper.cpp:684
static CORE_API bool Is(const FString &Source, const TCHAR *CompareStr)
Definition DefaultValueHelper.cpp:16
static CORE_API bool ParseColor(const FString &Source, FColor &OutVal)
Definition DefaultValueHelper.cpp:745
static CORE_API bool IsStringValidLinearColor(const FString &Source)
Definition DefaultValueHelper.cpp:333
static CORE_API bool ParseFloat(const FString &Source, float &OutVal)
Definition DefaultValueHelper.cpp:671
static CORE_API bool ParseInt64(const FString &Source, int64 &OutVal)
Definition DefaultValueHelper.cpp:657
static CORE_API FString GetUnqualifiedEnumValue(const FString &Source)
Definition DefaultValueHelper.cpp:105
static CORE_API bool ParseInt(const FString &Source, int32 &OutVal)
Definition DefaultValueHelper.cpp:609
static CORE_API bool ParseBool(const FString &Source, bool &OutVal)
Definition DefaultValueHelper.cpp:622
static CORE_API FString RemoveWhitespaces(const FString &Source)
Definition DefaultValueHelper.cpp:41
Definition Color.h:486
Definition Color.h:48