Skip to content

Commit 100e6dd

Browse files
committed
release 1.3.0
1 parent 1b5793b commit 100e6dd

169 files changed

Lines changed: 6807 additions & 2858 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DataConfig/DataConfig.uplugin

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
{
3737
"Name": "GameplayAbilities",
3838
"Enabled": true
39+
},
40+
{
41+
"Name": "SQLiteCore",
42+
"Enabled": true
3943
}
4044
]
4145
}

DataConfig/Source/DataConfigCore/Private/DataConfig/Automation/DcAutomation.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ struct FDcAutomationFeedbackContext : public FFeedbackContextAnsi
2525
}
2626
};
2727

28+
FString FDcAutomationBase::CheckUniqueName(const FString& InName)
29+
{
30+
check(!FAutomationTestFramework::Get().ContainsTest(InName));
31+
return InName;
32+
}
33+
2834
uint32 FDcAutomationBase::GetTestFlags() const
2935
{
3036
return FLAGS;
@@ -157,7 +163,7 @@ void FDcAutomationConsoleRunner::Prepare(const FArgs& Args)
157163
TArray<FAutomationTestInfo> TestInfos;
158164
Framework.GetValidTestNames(TestInfos);
159165

160-
TestInfos.RemoveAll([&Args](FAutomationTestInfo& TestInfo) {
166+
TestInfos.RemoveAllSwap([&Args](FAutomationTestInfo& TestInfo) {
161167
for (const FString& Filter : Args.Filters)
162168
if (!TestInfo.GetDisplayName().Contains(Filter, ESearchCase::IgnoreCase))
163169
return true;

DataConfig/Source/DataConfigCore/Private/DataConfig/Automation/DcAutomationUtils.cpp

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "DataConfig/Misc/DcPipeVisitor.h"
88
#include "DataConfig/Diagnostic/DcDiagnosticReadWrite.h"
99
#include "DataConfig/DcCorePrivate.h"
10+
#include "DataConfig/Source/DcSourceUtils.h"
1011

1112
namespace DcAutomationUtils
1213
{
@@ -690,8 +691,8 @@ int DebugGetEnumPropertyIndex(const FDcPropertyDatum& Datum, const FName& Name)
690691
FFieldVariant EnumProperty = PropertyAccessUtil::FindPropertyByName(Name, Struct);
691692
UEnum* Enum = nullptr;
692693
FNumericProperty* UnderlyingProperty = nullptr;
693-
FDcResult Result = DcPropertyUtils::GetEnumProperty(EnumProperty, Enum, UnderlyingProperty);
694-
if (!Result.Ok()
694+
bool bIsEnum = DcPropertyUtils::IsEnumAndTryUnwrapEnum(EnumProperty, Enum, UnderlyingProperty);
695+
if (!bIsEnum
695696
|| Enum == nullptr
696697
|| UnderlyingProperty == nullptr)
697698
return INDEX_NONE;
@@ -745,6 +746,7 @@ FDcResult DeserializeFrom(FDcReader* Reader, FDcPropertyDatum Datum,
745746
Ctx.Reader = Reader;
746747
Ctx.Writer = &Writer;
747748
Ctx.Deserializer = &Deserializer;
749+
Ctx.Properties.Add(Datum.Property);
748750
Func(Ctx);
749751
DC_TRY(Ctx.Prepare());
750752

@@ -753,7 +755,6 @@ FDcResult DeserializeFrom(FDcReader* Reader, FDcPropertyDatum Datum,
753755

754756
FDcResult SerializeInto(FDcWriter* Writer, FDcPropertyDatum Datum,
755757
TFunctionRef<void(FDcSerializeContext&)> Func, EDefaultSetupType SetupType)
756-
{
757758
{
758759
FDcSerializer Serializer;
759760
if (SetupType == EDefaultSetupType::SetupJSONHandlers)
@@ -770,14 +771,89 @@ FDcResult SerializeInto(FDcWriter* Writer, FDcPropertyDatum Datum,
770771
Ctx.Reader = &Reader;
771772
Ctx.Writer = Writer;
772773
Ctx.Serializer = &Serializer;
774+
Ctx.Properties.Add(Datum.Property);
773775
Func(Ctx);
774776
DC_TRY(Ctx.Prepare());
775777

776778
return Serializer.Serialize(Ctx);
777779
}
778780

779-
}
781+
// Trim and reindent a string literal to the first non empty indent level
782+
FString DcReindentStringLiteral(FString Str, FString* Prefix)
783+
{
784+
TArray<FString> Lines;
785+
Str.ParseIntoArrayLines(Lines);
786+
787+
int MinIndent = TNumericLimits<int>::Max();
788+
789+
auto _IsWhitespaceLine = [](const FString& Str)
790+
{
791+
for (TCHAR Ch : Str)
792+
{
793+
if (!FChar::IsWhitespace(Ch))
794+
return false;
795+
}
796+
797+
return true;
798+
};
780799

800+
int LineCount = Lines.Num();
801+
int FirstNonEmptyIx = 0;
802+
int LastNonEmptyIx = LineCount;
803+
{
804+
for (int Ix = 0; Ix < LineCount; Ix++)
805+
{
806+
if (!_IsWhitespaceLine(Lines[Ix]))
807+
{
808+
FirstNonEmptyIx = Ix;
809+
break;
810+
}
811+
}
812+
813+
for (int Ix = 0; Ix < LineCount; Ix++)
814+
{
815+
if (!_IsWhitespaceLine(Lines[LineCount- Ix - 1]))
816+
{
817+
LastNonEmptyIx = LineCount-Ix;
818+
break;
819+
}
820+
}
821+
}
822+
823+
TDcCSourceUtils<TCHAR>::StringBuilder Sb;
824+
{
825+
for (int Ix = FirstNonEmptyIx; Ix < LastNonEmptyIx; Ix++)
826+
{
827+
FString& Line = Lines[Ix];
828+
829+
Line.ConvertTabsToSpacesInline(4);
830+
Line.TrimEndInline();
831+
int Spaces = 0;
832+
for (TCHAR Char : Line)
833+
{
834+
if (Char == ' ')
835+
Spaces++;
836+
else
837+
break;
838+
}
839+
840+
if (Spaces < MinIndent)
841+
MinIndent = Spaces;
842+
}
843+
844+
for (int Ix = FirstNonEmptyIx; Ix < LastNonEmptyIx; Ix++)
845+
{
846+
FString& Line = Lines[Ix];
847+
848+
Line.RightChopInline(MinIndent);
849+
if (Prefix) Sb.Append(*Prefix);
850+
Sb.Append(Line);
851+
Sb << TCHAR('\n');
852+
}
853+
}
854+
855+
return Sb.ToString();
856+
}
781857

782858
} // namespace DcAutomationUtils
783859

DataConfig/Source/DataConfigCore/Private/DataConfig/Deserialize/DcDeserializeUtils.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,6 @@ FDcResult RecursiveDeserialize(FDcDeserializeContext& Ctx)
2222
return DcOk();
2323
}
2424

25-
EDcDeserializePredicateResult PredicateIsEnumProperty(FDcDeserializeContext& Ctx)
26-
{
27-
UEnum* Enum;
28-
FNumericProperty* UnderlyingProperty;
29-
bool bFoundEnum = DcPropertyUtils::TryGetEnumPropertyOut(Ctx.TopProperty(), Enum, UnderlyingProperty);
30-
31-
return bFoundEnum
32-
? EDcDeserializePredicateResult::Process
33-
: EDcDeserializePredicateResult::Pass;
34-
}
35-
36-
EDcDeserializePredicateResult PredicateIsSubObjectProperty(FDcDeserializeContext& Ctx)
37-
{
38-
if (Ctx.TopProperty().IsUObject())
39-
return EDcDeserializePredicateResult::Pass;
40-
41-
FObjectProperty* ObjectProperty = CastField<FObjectProperty>(Ctx.TopProperty().ToFieldUnsafe());
42-
return ObjectProperty && DcPropertyUtils::IsSubObjectProperty(ObjectProperty)
43-
? EDcDeserializePredicateResult::Process
44-
: EDcDeserializePredicateResult::Pass;
45-
}
46-
4725
} // namespace DcDeserializeUtils
4826

4927

0 commit comments

Comments
 (0)