Skip to content

Commit d7a7a85

Browse files
committed
release 1.7.0
1 parent 4607762 commit d7a7a85

File tree

31 files changed

+266
-59
lines changed

31 files changed

+266
-59
lines changed

DataConfig/DataConfig.uplugin

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@
5555
{
5656
"Name": "SQLiteCore",
5757
"Enabled": true
58-
},
59-
{
60-
"Name": "StructUtils",
61-
"Enabled": true
6258
}
6359
]
6460
}

DataConfig/DataConfig54.uplugin

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"FileVersion" : 3,
3+
"Version" : 1,
4+
"VersionName" : "1.0",
5+
"FriendlyName" : "Data Config",
6+
"Description" : "Serialization framework for Unreal Engine that just works!",
7+
"Category" : "Editor",
8+
"SupportURL" : "",
9+
"EnabledByDefault" : true,
10+
"CanContainContent" : true,
11+
"IsBetaVersion" : false,
12+
"Installed" : false,
13+
"Modules": [
14+
{
15+
"Name": "DataConfigCore",
16+
"Type": "Runtime",
17+
"LoadingPhase": "None"
18+
},
19+
{
20+
"Name": "DataConfigExtra",
21+
"Type": "Runtime",
22+
"LoadingPhase": "Default"
23+
},
24+
{
25+
"Name": "DataConfigEngineExtra",
26+
"Type": "Runtime",
27+
"LoadingPhase": "Default"
28+
},
29+
{
30+
"Name": "DataConfigEngineExtra5",
31+
"Type": "Editor",
32+
"LoadingPhase": "Default"
33+
},
34+
{
35+
"Name": "DataConfigTests",
36+
"Type": "Editor",
37+
"LoadingPhase": "Default"
38+
},
39+
{
40+
"Name": "DataConfigEditorExtra",
41+
"Type": "Editor",
42+
"LoadingPhase": "Default"
43+
},
44+
{
45+
"Name": "DataConfigTests5",
46+
"Type": "Editor",
47+
"LoadingPhase": "Default"
48+
}
49+
],
50+
"Plugins": [
51+
{
52+
"Name": "GameplayAbilities",
53+
"Enabled": true
54+
},
55+
{
56+
"Name": "SQLiteCore",
57+
"Enabled": true
58+
},
59+
{
60+
"Name": "StructUtils",
61+
"Enabled": true
62+
}
63+
]
64+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ FString FDcAutomationBase::CheckUniqueName(const FString& InName)
3131
return InName;
3232
}
3333

34-
uint32 FDcAutomationBase::GetTestFlags() const
34+
FDcAutomationBase::FlagsType FDcAutomationBase::GetTestFlags() const
3535
{
3636
return FLAGS;
3737
}

DataConfig/Source/DataConfigCore/Private/DataConfig/DcCorePrivate.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#include "DcCorePrivate.h"
2+
#include "Misc/EngineVersionComparison.h"
3+
4+
#if UE_VERSION_OLDER_THAN(5, 5, 0)
5+
// 5.5 get rids of this boilerplate
26

37
#if !IS_MONOLITHIC
48

@@ -7,6 +11,7 @@ PER_MODULE_BOILERPLATE
711

812
#endif
913

14+
#endif // !UE_VERSION_OLDER_THAN(5, 5, 0)
1015

1116
namespace DcCorePrivate {
1217

DataConfig/Source/DataConfigCore/Private/DataConfig/Property/DcPropertyReadStates.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ FDcResult FDcReadStateScalar::ReadDataEntry(FDcPropertyReader* Parent, FFieldCla
13041304
else
13051305
{
13061306
OutDatum.Property = ScalarField;
1307-
OutDatum.DataPtr = (uint8*)ScalarPtr + (PTRINT)(ScalarField->ElementSize * Index);
1307+
OutDatum.DataPtr = (uint8*)ScalarPtr + (PTRINT)(DcPropertyUtils::ElementSize(ScalarField) * Index);
13081308

13091309
++Index;
13101310
if (Index == ScalarField->ArrayDim)
@@ -1356,7 +1356,7 @@ FDcResult FDcReadStateScalar::PeekReadDataPtr(FDcPropertyReader* Parent, void**
13561356
<< EState::ExpectScalar << EState::ExpectArrayItem << State
13571357
<< Parent->FormatHighlight();
13581358

1359-
return ReadOutOk(OutDataPtr, (uint8*)ScalarPtr + (PTRINT)(ScalarField->ElementSize * Index));
1359+
return ReadOutOk(OutDataPtr, (uint8*)ScalarPtr + (PTRINT)(DcPropertyUtils::ElementSize(ScalarField) * Index));
13601360
}
13611361

13621362
FDcResult FDcReadStateScalar::ReadArrayRoot(FDcPropertyReader* Parent)

DataConfig/Source/DataConfigCore/Private/DataConfig/Property/DcPropertyReadStates.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "DataConfig/DcTypes.h"
44
#include "DataConfig/Property/DcPropertyUtils.h"
55
#include "DataConfig/Property/DcPropertyStatesCommon.h"
6+
#include "DataConfig/Misc/DcTypeUtils.h"
67
#include "Misc/EngineVersionComparison.h"
78

89
enum class EDcPropertyReadType
@@ -399,16 +400,16 @@ struct FDcReadStateOptional : public FDcBaseReadState
399400

400401
void FormatHighlightSegment(TArray<FString>& OutSegments, DcPropertyHighlight::EFormatSeg SegType) override;
401402
};
402-
static_assert(TIsTriviallyDestructible<FDcReadStateOptional>::Value, "need trivial destructible");
403+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcReadStateOptional>::Value, "need trivial destructible");
403404
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)
404405

405406
// storage is already POD type, and TArray<> do only bitwise relocate anyway
406407
// we'll just needs to assume these types are trivially destructable
407-
static_assert(TIsTriviallyDestructible<FDcReadStateClass>::Value, "need trivial destructible");
408-
static_assert(TIsTriviallyDestructible<FDcReadStateStruct>::Value, "need trivial destructible");
409-
static_assert(TIsTriviallyDestructible<FDcReadStateMap>::Value, "need trivial destructible");
410-
static_assert(TIsTriviallyDestructible<FDcReadStateArray>::Value, "need trivial destructible");
411-
static_assert(TIsTriviallyDestructible<FDcReadStateSet>::Value, "need trivial destructible");
412-
static_assert(TIsTriviallyDestructible<FDcReadStateScalar>::Value, "need trivial destructible");
408+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcReadStateClass>::Value, "need trivial destructible");
409+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcReadStateStruct>::Value, "need trivial destructible");
410+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcReadStateMap>::Value, "need trivial destructible");
411+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcReadStateArray>::Value, "need trivial destructible");
412+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcReadStateSet>::Value, "need trivial destructible");
413+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcReadStateScalar>::Value, "need trivial destructible");
413414

414415

DataConfig/Source/DataConfigCore/Private/DataConfig/Property/DcPropertyReader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ FDcResult FDcPropertyReader::ReadBlob(FDcBlobViewData* OutPtr)
717717
{
718718
*OutPtr = {
719719
(uint8*)ScriptArray.GetRawPtr(),
720-
ScriptArray.Num() * ArrayProperty->Inner->ElementSize
720+
ScriptArray.Num() * DcPropertyUtils::ElementSize(ArrayProperty->Inner)
721721
};
722722
}
723723

@@ -732,7 +732,7 @@ FDcResult FDcPropertyReader::ReadBlob(FDcBlobViewData* OutPtr)
732732
{
733733
*OutPtr = {
734734
(uint8*)Datum.DataPtr,
735-
Prop->ArrayDim * Prop->ElementSize
735+
Prop->ArrayDim * DcPropertyUtils::ElementSize(Prop)
736736
};
737737
}
738738

@@ -748,7 +748,7 @@ FDcResult FDcPropertyReader::ReadBlob(FDcBlobViewData* OutPtr)
748748
{
749749
*OutPtr = {
750750
(uint8*)Datum.DataPtr,
751-
StructProperty->ElementSize
751+
DcPropertyUtils::ElementSize(StructProperty)
752752
};
753753
}
754754

DataConfig/Source/DataConfigCore/Private/DataConfig/Property/DcPropertyWriteStates.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ FDcResult FDcWriteStateScalar::WriteDataEntry(FDcPropertyWriter* Parent, FFieldC
11181118
else
11191119
{
11201120
OutDatum.Property = ScalarField;
1121-
OutDatum.DataPtr = (uint8*)ScalarPtr + (PTRINT)(ScalarField->ElementSize * Index);
1121+
OutDatum.DataPtr = (uint8*)ScalarPtr + (PTRINT)(DcPropertyUtils::ElementSize(ScalarField) * Index);
11221122

11231123
++Index;
11241124
if (Index == ScalarField->ArrayDim)

DataConfig/Source/DataConfigCore/Private/DataConfig/Property/DcPropertyWriteStates.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "DataConfig/Property/DcPropertyStatesCommon.h"
55
#include "DataConfig/Property/DcPropertyDatum.h"
66
#include "DataConfig/Property/DcPropertyUtils.h"
7+
#include "DataConfig/Misc/DcTypeUtils.h"
78
#include "UObject/UnrealType.h"
89
#include "Misc/EngineVersionComparison.h"
910

@@ -347,7 +348,7 @@ struct FDcWriteStateOptional : public FDcBaseWriteState
347348

348349
void FormatHighlightSegment(TArray<FString>& OutSegments, DcPropertyHighlight::EFormatSeg SegType) override;
349350
};
350-
static_assert(TIsTriviallyDestructible<FDcWriteStateOptional>::Value, "need trivial destructible");
351+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcWriteStateOptional>::Value, "need trivial destructible");
351352
#endif // !UE_VERSION_OLDER_THAN(5, 4, 0)
352353

353354
struct FDcWriteStateScalar : public FDcBaseWriteState
@@ -424,9 +425,9 @@ FDcResult WriteValue(FDcPropertyWriter* Parent, FDcBaseWriteState& State, const
424425
return DcOk();
425426
}
426427

427-
static_assert(TIsTriviallyDestructible<FDcWriteStateClass>::Value, "need trivial destructible");
428-
static_assert(TIsTriviallyDestructible<FDcWriteStateStruct>::Value, "need trivial destructible");
429-
static_assert(TIsTriviallyDestructible<FDcWriteStateMap>::Value, "need trivial destructible");
430-
static_assert(TIsTriviallyDestructible<FDcWriteStateArray>::Value, "need trivial destructible");
431-
static_assert(TIsTriviallyDestructible<FDcWriteStateSet>::Value, "need trivial destructible");
428+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcWriteStateClass>::Value, "need trivial destructible");
429+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcWriteStateStruct>::Value, "need trivial destructible");
430+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcWriteStateMap>::Value, "need trivial destructible");
431+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcWriteStateArray>::Value, "need trivial destructible");
432+
static_assert(DcTypeUtils::TIsTriviallyDestructible<FDcWriteStateSet>::Value, "need trivial destructible");
432433

DataConfig/Source/DataConfigCore/Private/DataConfig/Property/DcPropertyWriter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ FDcResult FDcPropertyWriter::WriteBlob(const FDcBlobViewData& Value)
734734
FArrayProperty* ArrayProperty = Datum.CastFieldChecked<FArrayProperty>();
735735
FScriptArrayHelper ScriptArray(ArrayProperty, Datum.DataPtr);
736736

737-
int32 ElementSize = ArrayProperty->Inner->ElementSize;
737+
int32 ElementSize = DcPropertyUtils::ElementSize(ArrayProperty->Inner);
738738
int32 NewCount = Value.Num / ElementSize;
739739
if (Value.Num % ElementSize != 0)
740740
NewCount += 1;
@@ -749,7 +749,7 @@ FDcResult FDcPropertyWriter::WriteBlob(const FDcBlobViewData& Value)
749749
DC_TRY(GetTopState(this).WriteDataEntry(this, FProperty::StaticClass(), Datum));
750750
DC_TRY(DcPropertyUtils::HeuristicVerifyPointer(Value.DataPtr));
751751

752-
int FullSize = Prop->ArrayDim * Prop->ElementSize;
752+
int FullSize = Prop->ArrayDim * DcPropertyUtils::ElementSize(Prop);
753753
if (Value.Num > FullSize)
754754
return DC_FAIL(DcDReadWrite, WriteBlobOverrun) << FullSize << Value.Num;
755755

@@ -764,8 +764,9 @@ FDcResult FDcPropertyWriter::WriteBlob(const FDcBlobViewData& Value)
764764

765765
FStructProperty* StructProperty = Datum.CastFieldChecked<FStructProperty>();
766766

767-
if (Value.Num > StructProperty->ElementSize)
768-
return DC_FAIL(DcDReadWrite, WriteBlobOverrun) << StructProperty->ElementSize << Value.Num;
767+
int32 StructSize = DcPropertyUtils::ElementSize(StructProperty);
768+
if (Value.Num > StructSize)
769+
return DC_FAIL(DcDReadWrite, WriteBlobOverrun) << StructSize << Value.Num;
769770

770771
StructProperty->CopySingleValue(Datum.DataPtr, Value.DataPtr);
771772
return DcOk();

0 commit comments

Comments
 (0)