Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(in) | :: | up | Unlimited polymorphic variable to be encoded. |
||
character(len=:), | intent(out), | allocatable | :: | code | Encoded scalar. |
Encode an unlimited polymorphic scalar to base64.
subroutine b64_encode_up(up, code)
!---------------------------------------------------------------------------------------------------------------------------------
!< Encode an unlimited polymorphic scalar to base64.
!---------------------------------------------------------------------------------------------------------------------------------
class(*), intent(in) :: up !< Unlimited polymorphic variable to be encoded.
character(len=:), allocatable, intent(out) :: code !< Encoded scalar.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
select type(up)
type is(real(R8P))
call b64_encode_R8(n=up,code=code)
type is(real(R4P))
call b64_encode_R4(n=up,code=code)
type is(integer(I8P))
call b64_encode_I8(n=up,code=code)
type is(integer(I4P))
call b64_encode_I4(n=up,code=code)
type is(integer(I2P))
call b64_encode_I2(n=up,code=code)
type is(integer(I1P))
call b64_encode_I1(n=up,code=code)
type is(character(*))
call b64_encode_string(s=up,code=code)
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine b64_encode_up