iterator_get_next Function

public function iterator_get_next(this) result(cp)

Arguments

TypeIntentOptionalAttributesName
class(utf8_string_iterator), intent(inout) :: this

Return Value character(kind=c_char,len=:),allocatable


Contents

Source Code


Source Code

    function iterator_get_next(this) result(cp)
        class(utf8_string_iterator), intent(inout) :: this
        !character(len=:, kind=c_char), pointer :: cp
        character(len=:, kind=c_char), allocatable :: cp
        integer :: n

        n = codepoint_num_bytes(cast_byte(this%ptr(this%cur:this%cur)))
        cp = this%ptr(this%cur:this%cur + n - 1)
        this%cur = this%cur + n

    end function iterator_get_next