diff --git a/include/ki/dml/Record.h b/include/ki/dml/Record.h index cc70dd7..f1e1079 100644 --- a/include/ki/dml/Record.h +++ b/include/ki/dml/Record.h @@ -34,6 +34,8 @@ namespace dml return m_field_map.at(name)->is_type(); } + FieldBase *get_field(std::string name) const; + /** * Returns a previously added field with the specified name * and type. diff --git a/src/dml/Record.cpp b/src/dml/Record.cpp index 9389a48..2085ebf 100644 --- a/src/dml/Record.cpp +++ b/src/dml/Record.cpp @@ -30,6 +30,13 @@ namespace dml return m_field_map.count(name); } + FieldBase *Record::get_field(std::string name) const + { + if (has_field(name)) + return m_field_map.at(name); + return nullptr; + } + size_t Record::get_field_count() const { return m_fields.size();