GSOC2025: Json Library for D, weekly update #5
Gaofei Qiu
qiugaofei53391 at gmail.com
Mon Jul 21 18:02:11 UTC 2025
Clean up the codes of static array desirialization.
The codes of dynamic array still need revisions, because the
current code is deserializing to an appender, not deserializing
to the array.
```d
size_t elementCount = 0;
while(true) {
// Add a default element to the array so we can
deserialize into it
app ~= typeof(item[0]).init;
// Create a temporary array that includes this new element
auto tempArray = app.data;
policy.onArrayElement(tokenizer, tempArray, elementCount,
context);
// Update our appender with the modified last element
app.data[elementCount] = tempArray[elementCount];
elementCount++;
//get the next token
}
```
(https://github.com/schveiguy/jsoniopipe/pull/43)
More information about the Digitalmars-d
mailing list