- Backend update.

This commit is contained in:
Christoph Oelckers 2020-10-16 23:25:18 +02:00
commit 65c52b9825
8 changed files with 89 additions and 6 deletions

View file

@ -125,6 +125,12 @@ public:
return Serialize(*this, key, obj, save_full? nullptr : &def);
}
template<class T>
FSerializer& operator()(const char* key, T& obj, T* def)
{
return Serialize(*this, key, obj, !def || save_full ? nullptr : def);
}
template<class T>
FSerializer &Array(const char *key, T *obj, int count, bool fullcompare = false)
{
@ -172,6 +178,29 @@ public:
return *this;
}
template<class T, class Map>
FSerializer &SparseArray(const char *key, T *obj, int count, const Map &map, bool fullcompare = false)
{
if (BeginArray(key))
{
int max = count;
if (isReading())
{
max = ArraySize();
}
for (int i = 0; i < count; i++)
{
if (map[i])
{
Serialize(*this, nullptr, obj[i], (T*)nullptr);
if (--max < 0) break;
}
}
EndArray();
}
return *this;
}
template<class T>
FSerializer &Enum(const char *key, T &obj)
{