function to return plain strings (in case they have a different syntax)

This commit is contained in:
Martin Diehl 2018-06-03 10:43:43 +02:00
parent 4943b30d47
commit e7d27a3991
1 changed files with 32 additions and 0 deletions

View File

@ -19,6 +19,7 @@ module chained_list
procedure :: show => show procedure :: show => show
procedure :: getRaw => getRaw procedure :: getRaw => getRaw
procedure :: getRaws => getRaws procedure :: getRaws => getRaws
procedure :: getStringsRaw => getStringsRaw
procedure :: getFloat => getFloat procedure :: getFloat => getFloat
procedure :: getFloatArray => getFloatArray procedure :: getFloatArray => getFloatArray
@ -157,6 +158,37 @@ subroutine getRaws(this,key,string,stringPos)
end subroutine getRaws end subroutine getRaws
!--------------------------------------------------------------------------------------------------
!> @brief gets raw data
!> @details returns raw string and start/end position of chunks in this string
!--------------------------------------------------------------------------------------------------
function getStringsRaw(this)
use IO, only: &
IO_error, &
IO_stringValue
implicit none
class(tPartitionedStringList), intent(in) :: this
character(len=256), dimension(:),allocatable :: getStringsRaw
character(len=256) :: stringTmp
type(tPartitionedStringList), pointer :: tmp
tmp => this%next
do
if (.not. associated(tmp)) then
if(size(getStringsRaw) < 0_pInt) call IO_error(1_pInt,ext_msg='getallraw empty list')
exit
endif
stringTmp = tmp%string%val
if (.not. allocated(getStringsRaw)) then
allocate(getStringsRaw(1),source=stringTmp)
else
getStringsRaw = [getStringsRaw,stringTmp]
endif
tmp => tmp%next
end do
end function getStringsRaw
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief gets float value for given key !> @brief gets float value for given key
!> @details if key is not found exits with error unless default is given !> @details if key is not found exits with error unless default is given