Serialize a JSON value to a string and return it.
In case of an error this function will invoke an error stop.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_value), | intent(inout) | :: | val |
TOML value to visit |
||
type(toml_ser_config), | intent(in), | optional | :: | config |
Configuration for serializer |
Serialized JSON value
function toml_serialize(val, config) result(string) !> TOML value to visit class(toml_value), intent(inout) :: val !> Configuration for serializer type(toml_ser_config), intent(in), optional :: config !> Serialized JSON value character(len=:), allocatable :: string type(toml_error), allocatable :: error call toml_dumps(val, string, error, config=config) if (allocated(error)) then print '(a)', "Error: " // error%message error stop 1 end if end function toml_serialize