Skip to content
Snippets Groups Projects
Commit 5151d8b6 authored by Alexander Kreft's avatar Alexander Kreft
Browse files

ENH: get_value for string list and bool list

parent 8e57253e
Branches
Tags
1 merge request!11F get value
......@@ -835,6 +835,18 @@ function get_value(property::Ref{_Property})
temp = get_double_list_value_at(property, i)
append!(out, temp)
end
elseif prop_datatype[1] == "BOOLEAN"
out = Vector{Bool}()
for i::Cint in 1:list_length
temp = get_bool_list_value_at(property, i)
append!(out, temp)
end
elseif prop_datatype[1] == "TEXT"
out = Vector{String}()
for i::Cint in 1:list_length
temp = get_string_list_value_at(property, i)
append!(out, [temp])
end
end
end
if @isdefined err_code
......@@ -874,6 +886,38 @@ function get_double_list_value_at(property::Ref{_Property}, index::Cint)
CaosDB.Exceptions.evaluate_return_code(err_code)
return out[]
end
function get_bool_list_value_at(property::Ref{_Property}, index::Cint)
out = Ref{Cint}(0)
err_code = ccall(
(:caosdb_entity_property_get_boolean_list_value_at, CaosDB.library_name),
Cint,
(Ref{_Property}, Ref{Cint}, Cint),
property,
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)
out = Ref{Ptr{UInt8}}(Ptr{UInt8}())
err_code = ccall(
(:caosdb_entity_property_get_string_list_value_at, CaosDB.library_name),
Cint,
(Ref{_Property}, Ref{Ptr{UInt8}}, Cint),
property,
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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment