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

Method BuildFromTMap

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

* Build value based on a TMap */

Source from the content-addressed store, hash-verified

369 * Build value based on a TMap
370 */
371 void FLuaDebugValue::BuildFromTMap(FScriptMapHelper &MapHelper)
372 {
373 FString KeyExtendedTypeText, ValueExtendedTypeText;
374 FString KeyTypeText = MapHelper.KeyProp->GetCPPType(&KeyExtendedTypeText);
375 FString ValueTypeText = MapHelper.ValueProp->GetCPPType(&ValueExtendedTypeText);
376 ReadableValue = FString::Printf(TEXT("TMap<%s%s,%s%s> Num=%d"), *KeyTypeText, *KeyExtendedTypeText, *ValueTypeText, *ValueExtendedTypeText, MapHelper.Num());
377 int32 i = -1, Size = MapHelper.Num();
378 while (Size > 0)
379 {
380 if (MapHelper.IsValidIndex(++i))
381 {
382 FLuaDebugValue *Key = AddKey();
383 if (Key)
384 {
385 Key->BuildFromUProperty(MapHelper.KeyProp, MapHelper.GetKeyPtr(i));
386 }
387 FLuaDebugValue *Value = AddValue();
388 if (Value)
389 {
390 Value->BuildFromUProperty(MapHelper.ValueProp, MapHelper.GetValuePtr(i));
391 }
392 --Size;
393 }
394 }
395 }
396
397 /**
398 * Build value based on a TSet

Callers

nothing calls this directly

Calls 3

BuildFromUPropertyMethod · 0.80
NumMethod · 0.45
IsValidIndexMethod · 0.45

Tested by

no test coverage detected