MCPcopy Create free account
hub / github.com/Tencent/UnLua / BuildFromTArray

Method BuildFromTArray

Plugins/UnLua/Source/UnLua/Private/UnLuaDebugBase.cpp:347–366  ·  view source on GitHub ↗

* Build value based on a TArray */

Source from the content-addressed store, hash-verified

345 * Build value based on a TArray
346 */
347 void FLuaDebugValue::BuildFromTArray(FScriptArrayHelper &ArrayHelper, const FProperty *InnerProperty)
348 {
349 check(InnerProperty);
350 FString InnerExtendedTypeText;
351 FString InnerTypeText = InnerProperty->GetCPPType(&InnerExtendedTypeText);
352 ReadableValue = FString::Printf(TEXT("TArray<%s%s> Num=%d"), *InnerTypeText, *InnerExtendedTypeText, ArrayHelper.Num());
353 for (int32 i = 0; i < ArrayHelper.Num(); ++i)
354 {
355 FLuaDebugValue *Key = AddKey();
356 if (Key)
357 {
358 Key->ReadableValue = FString::Printf(TEXT("[%d]"), i + 1);
359 }
360 FLuaDebugValue *Value = AddValue();
361 if (Value)
362 {
363 Value->BuildFromUProperty(InnerProperty, ArrayHelper.GetRawPtr(i));
364 }
365 }
366 }
367
368 /**
369 * Build value based on a TMap

Callers

nothing calls this directly

Calls 3

checkFunction · 0.85
BuildFromUPropertyMethod · 0.80
NumMethod · 0.45

Tested by

no test coverage detected