section_file_ini Function

private pure function section_file_ini(self, section_index) result(sname)

Get section name once an index (valid) is provided.

Arguments

TypeIntentOptionalAttributesName
class(file_ini), intent(in) :: self

File data.

integer(kind=I4P), intent(in) :: section_index

Section index.

Return Value character(len=:),allocatable

Section name.


Contents

Source Code


Source Code

  pure function section_file_ini(self, section_index) result(sname)
  !< Get section name once an index (valid) is provided.
  class(file_ini), intent(in)   :: self          !< File data.
  integer(I4P),    intent(in)   :: section_index !< Section index.
  character(len=:), allocatable :: sname         !< Section name.

  if (allocated(self%sections)) then
    if ((section_index >= lbound(self%sections, dim=1)).and.(section_index <= ubound(self%sections, dim=1))) then
      sname = self%sections(section_index)%name()
    endif
  endif
  endfunction section_file_ini