| 1281 | } // namespace |
| 1282 | |
| 1283 | Result<std::shared_ptr<KeyValueMetadata>> GetKeyValueMetadata( |
| 1284 | const KVVector* fb_metadata) { |
| 1285 | if (fb_metadata == nullptr) { |
| 1286 | return nullptr; |
| 1287 | } |
| 1288 | |
| 1289 | auto metadata = std::make_shared<KeyValueMetadata>(); |
| 1290 | |
| 1291 | metadata->reserve(fb_metadata->size()); |
| 1292 | for (const auto pair : *fb_metadata) { |
| 1293 | CHECK_FLATBUFFERS_NOT_NULL(pair->key(), "custom_metadata.key"); |
| 1294 | CHECK_FLATBUFFERS_NOT_NULL(pair->value(), "custom_metadata.value"); |
| 1295 | metadata->Append(pair->key()->str(), pair->value()->str()); |
| 1296 | } |
| 1297 | |
| 1298 | return metadata; |
| 1299 | } |
| 1300 | |
| 1301 | Result<std::shared_ptr<Buffer>> WriteSchemaMessage(const Schema& schema, |
| 1302 | const DictionaryFieldMapper& mapper, |
no test coverage detected