Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cube_t), | intent(in) | :: | self |
pure function cube__first_codepoint(self) result(ret) use :: forgex_parameters_m, only: UTF8_CODE_MAX implicit none class(cube_t), intent(in) :: self integer :: i, num, pos, ret, candi if (.not. self%is_switched_to_bmp) then do i = 0, ASCII_SIZE-1 if (self%ascii%a(i) /= 0) then pos = trailz(self%ascii%a(i)) ret = i*bits_64+pos return end if end do ret = INVALID_CODE_POINT return end if do i = 0, BMP_SIZE-1 if (self%bmp%b(i) /= 0) then pos = trailz(self%bmp%b(i)) ret = i*bits_64 + pos return end if end do ret = INVALID_CODE_POINT if (.not. allocated(self%sps)) return candi = UTF8_CODE_MAX do i = 1, size(self%sps) candi = min(candi, self%sps(i)%min) end do if (candi /= UTF8_CODE_MAX) then ret = candi else ret = -1 end if end function cube__first_codepoint