Load the JSON data from a string.
Load JSON from a string:
type(json_file) :: f
call f%deserialize('{ "name": "Leonidas" }')
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK, len=*), | intent(in) | :: | str |
string to load JSON data from |
||
logical(kind=LK), | intent(in), | optional | :: | destroy_pointer |
destroy the pointer before loading (default is True) |
subroutine json_file_load_from_string(me, str, destroy_pointer) implicit none class(json_file),intent(inout) :: me character(kind=CK,len=*),intent(in) :: str !! string to load JSON data from logical(LK),intent(in),optional :: destroy_pointer !! destroy the pointer before !! loading (default is True) if (present(destroy_pointer)) then if (destroy_pointer) call me%destroy() else ! by default it is destroyed call me%destroy() end if call me%core%deserialize(me%p, str) end subroutine json_file_load_from_string