MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SerializeArray

Method SerializeArray

engine/Poseidon/IO/Serialization/ParamArchive.cpp:449–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449LSError ParamArchive::SerializeArray(const RStringB& name, AutoArray<Vector3>& value, int minVersion)
450{
451 if (_version < minVersion)
452 {
453 return LSOK;
454 }
455 if (!_saving && _pass != PassFirst)
456 {
457 return LSOK;
458 }
459 ParamArchive arCls;
460 if (!OpenSubclass(name, arCls))
461 ON_ERROR(LSNoEntry, name);
462 int n;
463 if (_saving)
464 {
465 n = value.Size();
466 PARAM_CHECK(arCls.Serialize("items", n, minVersion))
467 }
468 else
469 {
470 PARAM_CHECK(arCls.Serialize("items", n, minVersion))
471 value.Realloc(n);
472 value.Resize(n);
473 }
474 for (int i = 0; i < n; i++)
475 {
476 char buffer[256];
477 snprintf(buffer, sizeof(buffer), "vector%d", i);
478 PARAM_CHECK(arCls.Serialize(buffer, value[i], minVersion))
479 }
480 CloseSubclass(arCls);
481 return LSOK;
482}
483
484LSError ParamArchive::SerializeEnumValue(const RStringB& name, int& value, int minVersion, const EnumName* names)
485{

Callers 8

SerializeMethod · 0.45
SerializeMethod · 0.45
SerializeMethod · 0.45
SerializeMethod · 0.45
SerializeMethod · 0.45
CampaignSerializeMethod · 0.45
SerializeMethod · 0.45
SerializeMethod · 0.45

Calls 4

SizeMethod · 0.45
SerializeMethod · 0.45
ReallocMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected