|
- program RedisInterface
- use json_module
- use CStringConfigurationVariables
-
- type(json_file) :: jsonfile
- type(json_value),pointer :: jsonvalue,jsonvalue2,child,child2,jsonvalue3
- type(json_core) :: jsoncore
- logical :: is_found
- integer ::n_children,i,j
- type(CStringItem), allocatable :: StringConfigurations(:)
-
- call jsonfile%initialize()
- call jsonfile%load_file('data-witharray.json'); if (jsonfile%failed()) stop
- call jsonfile%json_file_get_root(jsonvalue)
- call jsoncore%get(jsonvalue,'Configuration',jsonvalue2)
- call jsoncore%get(jsonvalue2,'StringConfiguration',jsonvalue)
- call jsoncore%get(jsonvalue,'StringConfigurationItems',jsonvalue2)
- call jsoncore%info(jsonvalue2, n_children=n_children)
- do i=1,n_children
- call jsoncore%get_child(jsonvalue2, i, child, found=is_found)
- if (.not. is_found) print *,"not found"
- call jsoncore%get(child,"BitCodeHundreds",child2)
- call jsoncore%get(child2,j)
- print *,"BitCodeHundreds=",j
- end do
- print *,"n_children=",n_children
- call jsonfile%destroy()
- end program
|