json_string_array Function

private pure function json_string_array(arr) result(str)

Render arr(:) as a comma-separated list of JSON-quoted strings (no enclosing brackets – the caller supplies those).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: arr(:)

Return Value character(len=:), allocatable


Calls

proc~~json_string_array~~CallsGraph proc~json_string_array json_string_array proc~json_escape json_escape proc~json_string_array->proc~json_escape

Called by

proc~~json_string_array~~CalledByGraph proc~json_string_array json_string_array proc~write_key_json write_key_json proc~write_key_json->proc~json_string_array proc~schema_render_json nml_schema_t%schema_render_json proc~schema_render_json->proc~write_key_json

Variables

Type Visibility Attributes Name Initial
integer, private :: i

Source Code

   pure function json_string_array(arr) result(str)
      !! Render `arr(:)` as a comma-separated list of JSON-quoted strings
      !! (no enclosing brackets -- the caller supplies those).
      character(len=*), intent(in) :: arr(:)
      character(len=:), allocatable :: str
      integer :: i
      str = ""
      do i = 1, size(arr)
         if (i > 1) str = str//", "
         str = str//'"'//json_escape(trim(arr(i)))//'"'
      end do
   end function json_string_array