| 97 | } |
| 98 | |
| 99 | static Dictionary::Ptr SerializeDictionary(const Dictionary::Ptr& input, int attributeTypes, SerializeStack& stack, bool dryRun) |
| 100 | { |
| 101 | DictionaryData result; |
| 102 | |
| 103 | if (!dryRun) { |
| 104 | result.reserve(input->GetLength()); |
| 105 | } |
| 106 | |
| 107 | ObjectLock olock(input); |
| 108 | |
| 109 | for (const Dictionary::Pair& kv : input) { |
| 110 | stack.Push(kv.first, kv.second); |
| 111 | |
| 112 | auto serialized (SerializeInternal(kv.second, attributeTypes, stack, dryRun)); |
| 113 | |
| 114 | if (!dryRun) { |
| 115 | result.emplace_back(kv.first, std::move(serialized)); |
| 116 | } |
| 117 | |
| 118 | stack.Pop(); |
| 119 | } |
| 120 | |
| 121 | return dryRun ? nullptr : new Dictionary(std::move(result)); |
| 122 | } |
| 123 | |
| 124 | static Dictionary::Ptr SerializeNamespace(const Namespace::Ptr& input, int attributeTypes, SerializeStack& stack, bool dryRun) |
| 125 | { |
no test coverage detected