33 lines
1.2 KiB
C++
33 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "WingUtils.h"
|
|
// A resolved property: the FProperty descriptor plus a pointer to
|
|
// the value's storage. operator-> forwards to the FProperty.
|
|
struct FWingProperty
|
|
{
|
|
|
|
FProperty* Prop = nullptr;
|
|
void* Container = nullptr;
|
|
|
|
FWingProperty() = default;
|
|
FWingProperty(FProperty* InProp, void* InContainer);
|
|
FWingProperty(FProperty* InProp, UObject* InContainer);
|
|
|
|
FString GetText() const;
|
|
bool SetText(const FString& Value);
|
|
|
|
explicit operator bool() const { return Prop != nullptr; }
|
|
FProperty* operator->() const { return Prop; }
|
|
|
|
static void Remove(TArray<FWingProperty>& Props, const FString& Name);
|
|
static TArray<FWingProperty> GetAll(UObject* Obj, EPropertyFlags Flags);
|
|
static TArray<FWingProperty> GetAll(UStruct* StructType, void* Container, EPropertyFlags Flags);
|
|
static TArray<FWingProperty> FindAllSubstring(const TArray<FWingProperty>& Props, const FString& Substring);
|
|
static FWingProperty FindOneExactMatch(const TArray<FWingProperty>& Props, const FString& Name);
|
|
|
|
private:
|
|
static void Collect(UStruct* StructType, void* Container, TArray<FWingProperty> &Props, EPropertyFlags Flags);
|
|
static void Collect(UObject* Container, TArray<FWingProperty> &Props, EPropertyFlags Flags);
|
|
};
|