stringtool_obj Derived Type

type, public :: stringtool_obj

A utility to help with parsing and reformating strings.


Type-Bound Procedures

procedure, public, nopass :: ContainsTime => stringtool_obj_ContainsTime

  • private pure function stringtool_obj_ContainsTime(str) result(val)

    Looks for a time token in the ES12.4 format in the input string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    Input string

    Return Value logical

    Logical switch; true if string has time

procedure, public, nopass :: FormatTime => stringtool_obj_FormatTime

  • private pure function stringtool_obj_FormatTime(Time) result(val)

    Returns a string of a time value formatted to ES12.4.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: Time

    Time

    Return Value character(len=:), allocatable

    Returned string with formatted time

procedure, public, nopass :: RemoveExtension => stringtool_obj_RemoveExtension

  • private pure function stringtool_obj_RemoveExtension(filename) result(val)

    Removes file extension from filename while preserving time in scientific notation and dots in paths.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: filename

    File name

    Return Value character(len=:), allocatable

    Returned string with extension removed

procedure, public, nopass :: RemovePath => stringtool_obj_RemovePath

  • private pure function stringtool_obj_RemovePath(filename) result(val)

    Removes path from filename.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: filename

    File name

    Return Value character(len=:), allocatable

    Returned string with path removed

Source Code

  type :: stringtool_obj
    !> A utility to help with parsing and reformating strings.
    contains
      procedure, nopass :: RemoveExtension     => stringtool_obj_RemoveExtension
      procedure, nopass :: RemovePath          => stringtool_obj_RemovePath
      procedure, nopass :: FormatTime          => stringtool_obj_FormatTime
      procedure, nopass :: ContainsTime        => stringtool_obj_ContainsTime
  end type stringtool_obj