Get any table field as a string, regardless of what type it is. You may pass nullptr for the schema if you don't care to have fields that are of table type pretty-printed.
| 201 | // You may pass nullptr for the schema if you don't care to have fields that |
| 202 | // are of table type pretty-printed. |
| 203 | inline std::string GetAnyFieldS(const Table &table, |
| 204 | const reflection::Field &field, |
| 205 | const reflection::Schema *schema) { |
| 206 | auto field_ptr = table.GetAddressOf(field.offset()); |
| 207 | return field_ptr ? GetAnyValueS(field.type()->base_type(), field_ptr, schema, |
| 208 | field.type()->index()) |
| 209 | : ""; |
| 210 | } |
| 211 | |
| 212 | // Get any struct field as a 64bit int, regardless of what type it is. |
| 213 | inline int64_t GetAnyFieldI(const Struct &st, const reflection::Field &field) { |
no test coverage detected