| 69 | static Value SerializeInternal(const Value& value, int attributeTypes, SerializeStack& stack, bool dryRun); |
| 70 | |
| 71 | static Array::Ptr SerializeArray(const Array::Ptr& input, int attributeTypes, SerializeStack& stack, bool dryRun) |
| 72 | { |
| 73 | ArrayData result; |
| 74 | |
| 75 | if (!dryRun) { |
| 76 | result.reserve(input->GetLength()); |
| 77 | } |
| 78 | |
| 79 | ObjectLock olock(input); |
| 80 | |
| 81 | int index = 0; |
| 82 | |
| 83 | for (const Value& value : input) { |
| 84 | stack.Push(Convert::ToString(index), value); |
| 85 | |
| 86 | auto serialized (SerializeInternal(value, attributeTypes, stack, dryRun)); |
| 87 | |
| 88 | if (!dryRun) { |
| 89 | result.emplace_back(std::move(serialized)); |
| 90 | } |
| 91 | |
| 92 | stack.Pop(); |
| 93 | index++; |
| 94 | } |
| 95 | |
| 96 | return dryRun ? nullptr : new Array(std::move(result)); |
| 97 | } |
| 98 | |
| 99 | static Dictionary::Ptr SerializeDictionary(const Dictionary::Ptr& input, int attributeTypes, SerializeStack& stack, bool dryRun) |
| 100 | { |
no test coverage detected