Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(fson_value), | pointer | :: | this | |||
type(fson_string), | pointer | :: | name |
function get_by_name_string(this, name) result(p)
use fson_string_m, only: fson_string, fson_string_equals
implicit none
type(fson_value), pointer :: this, p
type(fson_string), pointer :: name
integer :: i
if (this % value_type /= TYPE_OBJECT) then
nullify(p)
return
end if
do i=1, fson_value_count(this)
p => fson_value_get(this, i)
if (fson_string_equals(p%name, name)) then
return
end if
end do
! didn't find anything
nullify(p)
end function get_by_name_string