Writes the array to an Encoder as a single Value. */
| 136 | |
| 137 | /** Writes the array to an Encoder as a single Value. */ |
| 138 | void encodeTo(Encoder &enc) const { |
| 139 | if (!MCollection::isMutated()) { |
| 140 | enc << _array; |
| 141 | } else { |
| 142 | enc.beginArray(count()); |
| 143 | uint32_t i = 0; |
| 144 | for (auto &v : _vec) { |
| 145 | if (v.isEmpty()) |
| 146 | enc.writeValue(_array[i]); |
| 147 | else |
| 148 | v.encodeTo(enc); |
| 149 | ++i; |
| 150 | } |
| 151 | enc.endArray(); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | private: |
| 156 | /** Loads the Fleece Values of all items into _array. |
nothing calls this directly
no test coverage detected