name_is_json Function

public function name_is_json(filename)

Choose between JSON or TOML based on a file name

Arguments

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

Return Value logical


Source Code

    logical function name_is_json(filename)
        character(*), intent(in) :: filename

        character(*), parameter :: json_identifier = ".json"

        name_is_json = .false.

        if (len_trim(filename)<len(json_identifier)) return

        name_is_json = str_ends_with(lower(filename),json_identifier)

    end function name_is_json