Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(in) | :: | up(1:) | |||
character(len=:), | intent(out), | allocatable | :: | code |
pure subroutine b64_encode_up_a(up, code)
!< Encode an unlimited polymorphic array to base64.
!<
!<```fortran
!< use befor64
!< use penf
!< character(len=:), allocatable :: code64
!< call b64_encode_up(up=[0._R4P,-32.12_R4P], code=code64)
!< print "(A)", code64
!<```
!=> AAAAAOF6AMI= <<<
class(*), intent(in) :: up(1:) !< Unlimited polymorphic variable to be encoded.
character(len=:), allocatable, intent(out) :: code !< Encoded array.
select type(up)
type is(real(R8P))
call b64_encode_R8_a(n=up,code=code)
type is(real(R4P))
call b64_encode_R4_a(n=up,code=code)
type is(integer(I8P))
call b64_encode_I8_a(n=up,code=code)
type is(integer(I4P))
call b64_encode_I4_a(n=up,code=code)
type is(integer(I2P))
call b64_encode_I2_a(n=up,code=code)
type is(integer(I1P))
call b64_encode_I1_a(n=up,code=code)
type is(character(*))
call b64_encode_string_a(s=up,code=code)
endselect
endsubroutine b64_encode_up_a