diff --git a/src/Entity.jl b/src/Entity.jl index cb63ebf8bd999a575a43fad80c8054055869b35f..da6045a720c4cfe1753bcb974a282b8534e7e01a 100644 --- a/src/Entity.jl +++ b/src/Entity.jl @@ -863,13 +863,35 @@ function get_property_list_length(property::Ref{_Property}) return length[] end +""" + function get_property_list_length(entity::Ref{_Entity}) + +Return the length of the list of the given `entity` +""" +function get_property_list_length(entity::Ref{_Entity}) + + length = Ref{Cint}(0) + + err_code = ccall( + (:caosdb_entity_property_get_value_list_length, CaosDB.library_name), + Cint, + (Ref{_Entity}, Ref{Cint}), + entity, + length, + ) + + CaosDB.Exceptions.evaluate_return_code(err_code) + + return length[] +end + """ function get_int_list_value_at(property::Ref{_Property}, index::Cint) Return the value of the INTEGER list of the given `property` at the position `index`. """ function get_int_list_value_at(property::Ref{_Property}, index::Cint) - + out = Ref{Cint}(0) err_code = ccall( (:caosdb_entity_property_get_int_list_value_at, CaosDB.library_name), Cint, @@ -883,6 +905,26 @@ function get_int_list_value_at(property::Ref{_Property}, index::Cint) return out[] end +""" + function get_int_list_value_at(entity::Ref{_Entity}, index::Cint) + +Return the value of the INTEGER list of the given `entity` at the position `index`. +""" +function get_int_list_value_at(entity::Ref{_Entity}, index::Cint) + out = Ref{Cint}(0) + err_code = ccall( + (:caosdb_entity_entity_get_int_list_value_at, CaosDB.library_name), + Cint, + (Ref{_Entity}, Ref{Cint}, Cint), + entity, + out, + index - Cint(1), + ) + + CaosDB.Exceptions.evaluate_return_code(err_code) + return out[] +end + """ function get_double_list_value_at(property::Ref{_Property}, index::Cint) @@ -903,6 +945,26 @@ function get_double_list_value_at(property::Ref{_Property}, index::Cint) return out[] end +""" + function get_double_list_value_at(entity::Ref{_Entity}, index::Cint) + +Return the value of the DOUBLE list of the given `entity` at the position `index`. +""" +function get_double_list_value_at(entity::Ref{_Entity}, index::Cint) + out = Ref{Cdouble}(0) + err_code = ccall( + (:caosdb_entity_entity_get_double_list_value_at, CaosDB.library_name), + Cint, + (Ref{_Entity}, Ref{Cdouble}, Cint), + entity, + out, + index - Cint(1), + ) + + CaosDB.Exceptions.evaluate_return_code(err_code) + return out[] +end + """ function get_bool_list_value_at(property::Ref{_Property}, index::Cint) @@ -924,6 +986,27 @@ function get_bool_list_value_at(property::Ref{_Property}, index::Cint) return out end +""" + function get_bool_list_value_at(entity::Ref{_Entity}, index::Cint) + +Return the value of the BOOLEAN list of the given `entity` at the position `index`. +""" +function get_bool_list_value_at(entity::Ref{_Entity}, index::Cint) + out = Ref{Cint}(0) + err_code = ccall( + (:caosdb_entity_entity_get_boolean_list_value_at, CaosDB.library_name), + Cint, + (Ref{_Entity}, Ref{Cint}, Cint), + entity, + out, + index - Cint(1), + ) + + CaosDB.Exceptions.evaluate_return_code(err_code) + out = convert(Bool, out[]) + return out +end + """ function get_string_list_value_at(property::Ref{_Property}, index::Cint) @@ -945,6 +1028,27 @@ function get_string_list_value_at(property::Ref{_Property}, index::Cint) return out end +""" + function get_string_list_value_at(entity::Ref{_Entity}, index::Cint) + +Return the value of the TEXT list of the given `entity` at the position `index`. +""" +function get_string_list_value_at(entity::Ref{_Entity}, index::Cint) + out = Ref{Ptr{UInt8}}(Ptr{UInt8}()) + err_code = ccall( + (:caosdb_entity_entity_get_string_list_value_at, CaosDB.library_name), + Cint, + (Ref{_Entity}, Ref{Ptr{UInt8}}, Cint), + entity, + out, + index - Cint(1), + ) + + CaosDB.Exceptions.evaluate_return_code(err_code) + out = unsafe_string(out[]) + return out +end + """ function get_version_id(entity::Ref{_Entity})