Detects a "key" field of the type string.
| 156 | |
| 157 | // Detects a "key" field of the type string. |
| 158 | const reflection::Field* findStringKeyField(const reflection::Object& object) { |
| 159 | for (const auto field : *object.fields()) { |
| 160 | if (field->key() && field->type()->base_type() == reflection::String) { |
| 161 | return field; |
| 162 | } |
| 163 | } |
| 164 | return nullptr; |
| 165 | } |
| 166 | |
| 167 | } // namespace |
| 168 |
no test coverage detected