Module dcstring_base

module dcstring_base

        ! Types
    public type VSTRING

        ! Variables
    integer, public, parameter :: STRING_MAX = 500

        ! Interfaces
    public interface len
    public interface var_str
    public interface vchar
    public interface extract
    public interface split
    public interface get
    public interface put
    public interface put_line
    public interface vscan
    public interface vverify
    public interface vindex
    public interface assignment(=)
    private interface operator(//)
    public interface operator(.cat.)
    public interface operator(==)
    public interface operator(/=)
    public interface operator(<)
    public interface operator(<=)
    public interface operator(>)
    public interface operator(>=)

        ! Subroutines and functions
    private integer function string_len (str)
    private type (VSTRING) function char_to_string (char)
    private function string_to_char_length (str, length) result (result)
    private subroutine string_let_char (str, char)
    private subroutine string_let_char_array (str, char)
    private subroutine char_let_string (char, str)
    private subroutine char_array_let_string (char, str)
    private type (VSTRING) function string_add_string (lhs, rhs)
    private type (VSTRING) function string_add_char (lhs, rhs)
    private function char_add_string (char, str) result (result)
    private logical function string_eq_string (lhs, rhs)
    private logical function string_eq_char (str, char)
    private logical function char_eq_string (char, str)
    private logical function string_ne_string (lhs, rhs)
    private logical function string_ne_char (str, char)
    private logical function char_ne_string (char, str)
    private logical function string_lt_string (lhs, rhs)
    private logical function string_lt_char (str, char)
    private logical function char_lt_string (char, str)
    private logical function string_le_string (lhs, rhs)
    private logical function string_le_char (str, char)
    private logical function char_le_string (char, str)
    private logical function string_gt_string (lhs, rhs)
    private logical function string_gt_char (str, char)
    private logical function char_gt_string (char, str)
    private logical function string_ge_string (lhs, rhs)
    private logical function string_ge_char (str, char)
    private logical function char_ge_string (char, str)
    private subroutine string_get_default (str, maxlen, iostat)
    private subroutine string_get (unit, str, maxlen, iostat)
    private subroutine char_put_default (char, iostat)
    private subroutine char_put (unit, char, iostat)
    private subroutine string_put_default (str, iostat)
    private subroutine string_put (unit, str, iostat)
    private subroutine char_put_line_default (char, iostat)
    private subroutine char_put_line (unit, char, iostat)
    private subroutine string_put_line_default (str, iostat)
    private subroutine string_put_line (unit, str, iostat)
    private function string_index_string (str, substring, back) result (result)
    private function string_index_char (str, substring, back) result (result)
    private function char_index_string (str, substring, back) result (result)
    private function string_scan_string (str, set, back) result (result)
    private function string_scan_char (str, set, back) result (result)
    private function string_verify_string (string, set, back) result (result)
    private function string_verify_char (string, set, back) result (result)
    private type (VSTRING) function extract_string (string, start, finish)
    private subroutine split_c (string, word, set, separator, back)
    private subroutine split_s (string, word, set, separator, back)
    private subroutine shorten (string, newlen)
    private subroutine left_shift (string, width)
    private character function element (string, pos)
    private type (VSTRING) function char_add_char (lhs, rhs)

end module dcstring_base

Description of Types

VSTRING

public type VSTRING
    integer :: len
    character (len=STRING_MAX) :: body
end type VSTRING

Description of Variables

STRING_MAX

integer, public, parameter :: STRING_MAX = 500

Description of Interfaces

len

public interface len
    module procedure string_len
end interface len

var_str

public interface var_str
    module procedure char_to_string
end interface var_str

vchar

public interface vchar
    module procedure string_to_char_length
end interface vchar

extract

public interface extract
    module procedure extract_string
end interface extract

split

public interface split
    module procedure split_c
    module procedure split_s
end interface split

get

public interface get
    module procedure string_get
    module procedure string_get_default
end interface get

put

public interface put
    module procedure string_put
    module procedure string_put_default
    module procedure char_put
    module procedure char_put_default
end interface put

put_line

public interface put_line
    module procedure string_put_line
    module procedure string_put_line_default
    module procedure char_put_line
    module procedure char_put_line_default
end interface put_line

vscan

public interface vscan
    module procedure string_scan_string
    module procedure string_scan_char
end interface vscan

vverify

public interface vverify
    module procedure string_verify_string
    module procedure string_verify_char
end interface vverify

vindex

public interface vindex
    module procedure string_index_string
    module procedure string_index_char
    module procedure char_index_string
end interface vindex

assignment(=)

public interface assignment(=)
    module procedure string_let_char
    module procedure string_let_char_array
    module procedure char_let_string
    module procedure char_array_let_string
end interface assignment(=)

operator(//)

private interface operator(//)
    module procedure string_add_string
    module procedure char_add_string
    module procedure string_add_char
end interface operator(//)

operator(.cat.)

public interface operator(.cat.)
    module procedure string_add_string
    module procedure char_add_string
    module procedure string_add_char
end interface operator(.cat.)

operator(==)

public interface operator(==)
    module procedure string_eq_string
    module procedure string_eq_char
    module procedure char_eq_string
end interface operator(==)

operator(/=)

public interface operator(/=)
    module procedure string_ne_string
    module procedure string_ne_char
    module procedure char_ne_string
end interface operator(/=)

operator(<)

public interface operator(<)
    module procedure string_lt_string
    module procedure string_lt_char
    module procedure char_lt_string
end interface operator(<)

operator(<=)

public interface operator(<=)
    module procedure string_le_string
    module procedure string_le_char
    module procedure char_le_string
end interface operator(<=)

operator(>)

public interface operator(>)
    module procedure string_gt_string
    module procedure string_gt_char
    module procedure char_gt_string
end interface operator(>)

operator(>=)

public interface operator(>=)
    module procedure string_ge_string
    module procedure string_ge_char
    module procedure char_ge_string
end interface operator(>=)

Description of Subroutines and Functions

string_len

private function string_len (str) result (result)
    type (VSTRING), intent(in) :: str
    integer :: result
end function string_len

char_to_string

private function char_to_string (char) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING) :: result
    ! Calls: dcstringbase_warnlim
end function char_to_string

string_to_char_length

private function string_to_char_length (str, length) result (result)
    type (VSTRING), intent(in) :: str
    integer, intent(in) :: length
    character (len=length) :: result
    ! Calls: char_let_string
end function string_to_char_length

string_let_char

private subroutine string_let_char (str, char)
    type (VSTRING), intent(inout) :: str
    character (len=*), intent(in) :: char
end subroutine string_let_char

string_let_char_array

private subroutine string_let_char_array (str, char)
    type (VSTRING), intent(inout) :: str
    character, intent(in), dimension (:) :: char
end subroutine string_let_char_array

char_let_string

private subroutine char_let_string (char, str)
    character (len=*), intent(out) :: char
    type (VSTRING), intent(in) :: str
end subroutine char_let_string

char_array_let_string

private subroutine char_array_let_string (char, str)
    character, intent(out), dimension (:) :: char
    type (VSTRING), intent(in) :: str
end subroutine char_array_let_string

string_add_string

private function string_add_string (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    type (VSTRING), intent(in) :: rhs
    type (VSTRING) :: result
end function string_add_string

string_add_char

private function string_add_char (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    character (len=*), intent(in) :: rhs
    type (VSTRING) :: result
end function string_add_char

char_add_string

private function char_add_string (char, str) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING), intent(in) :: str
    type (VSTRING) :: result
end function char_add_string

string_eq_string

private function string_eq_string (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    type (VSTRING), intent(in) :: rhs
    logical :: result
end function string_eq_string

string_eq_char

private function string_eq_char (str, char) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: char
    logical :: result
end function string_eq_char

char_eq_string

private function char_eq_string (char, str) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING), intent(in) :: str
    logical :: result
end function char_eq_string

string_ne_string

private function string_ne_string (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    type (VSTRING), intent(in) :: rhs
    logical :: result
end function string_ne_string

string_ne_char

private function string_ne_char (str, char) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: char
    logical :: result
end function string_ne_char

char_ne_string

private function char_ne_string (char, str) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING), intent(in) :: str
    logical :: result
end function char_ne_string

string_lt_string

private function string_lt_string (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    type (VSTRING), intent(in) :: rhs
    logical :: result
end function string_lt_string

string_lt_char

private function string_lt_char (str, char) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: char
    logical :: result
end function string_lt_char

char_lt_string

private function char_lt_string (char, str) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING), intent(in) :: str
    logical :: result
end function char_lt_string

string_le_string

private function string_le_string (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    type (VSTRING), intent(in) :: rhs
    logical :: result
end function string_le_string

string_le_char

private function string_le_char (str, char) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: char
    logical :: result
end function string_le_char

char_le_string

private function char_le_string (char, str) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING), intent(in) :: str
    logical :: result
end function char_le_string

string_gt_string

private function string_gt_string (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    type (VSTRING), intent(in) :: rhs
    logical :: result
end function string_gt_string

string_gt_char

private function string_gt_char (str, char) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: char
    logical :: result
end function string_gt_char

char_gt_string

private function char_gt_string (char, str) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING), intent(in) :: str
    logical :: result
end function char_gt_string

string_ge_string

private function string_ge_string (lhs, rhs) result (result)
    type (VSTRING), intent(in) :: lhs
    type (VSTRING), intent(in) :: rhs
    logical :: result
end function string_ge_string

string_ge_char

private function string_ge_char (str, char) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: char
    logical :: result
end function string_ge_char

char_ge_string

private function char_ge_string (char, str) result (result)
    character (len=*), intent(in) :: char
    type (VSTRING), intent(in) :: str
    logical :: result
end function char_ge_string

string_get_default

private subroutine string_get_default (str, maxlen, iostat)
    type (VSTRING), intent(out) :: str
    integer, optional, intent(in) :: maxlen
    integer, optional, intent(out) :: iostat
    ! Calls: string_get
end subroutine string_get_default

string_get

private subroutine string_get (unit, str, maxlen, iostat)
    integer, intent(in) :: unit
    type (VSTRING), intent(out) :: str
    integer, optional, intent(in) :: maxlen
    integer, optional, intent(out) :: iostat
end subroutine string_get

char_put_default

private subroutine char_put_default (char, iostat)
    character (len=*), intent(in) :: char
    integer, optional, intent(out) :: iostat
    ! Calls: char_put
end subroutine char_put_default

char_put

private subroutine char_put (unit, char, iostat)
    integer, intent(in) :: unit
    character (len=*), intent(in) :: char
    integer, optional, intent(out) :: iostat
end subroutine char_put

string_put_default

private subroutine string_put_default (str, iostat)
    type (VSTRING), intent(in) :: str
    integer, optional, intent(out) :: iostat
    ! Calls: string_put
end subroutine string_put_default

string_put

private subroutine string_put (unit, str, iostat)
    integer, intent(in) :: unit
    type (VSTRING), intent(in) :: str
    integer, optional, intent(out) :: iostat
end subroutine string_put

char_put_line_default

private subroutine char_put_line_default (char, iostat)
    character (len=*), intent(in) :: char
    integer, optional, intent(out) :: iostat
    ! Calls: char_put_line
end subroutine char_put_line_default

char_put_line

private subroutine char_put_line (unit, char, iostat)
    integer, intent(in) :: unit
    character (len=*), intent(in) :: char
    integer, optional, intent(out) :: iostat
end subroutine char_put_line

string_put_line_default

private subroutine string_put_line_default (str, iostat)
    type (VSTRING), intent(in) :: str
    integer, optional, intent(out) :: iostat
    ! Calls: string_put_line
end subroutine string_put_line_default

string_put_line

private subroutine string_put_line (unit, str, iostat)
    integer, intent(in) :: unit
    type (VSTRING), intent(in) :: str
    integer, optional, intent(out) :: iostat
end subroutine string_put_line

string_index_string

private function string_index_string (str, substring, back) result (result)
    type (VSTRING), intent(in) :: str
    type (VSTRING), intent(in) :: substring
    logical, optional, intent(in) :: back
    integer :: result
end function string_index_string

string_index_char

private function string_index_char (str, substring, back) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: substring
    logical, optional, intent(in) :: back
    integer :: result
end function string_index_char

char_index_string

private function char_index_string (str, substring, back) result (result)
    character (len=*), intent(in) :: str
    type (VSTRING), intent(in) :: substring
    logical, optional, intent(in) :: back
    integer :: result
end function char_index_string

string_scan_string

private function string_scan_string (str, set, back) result (result)
    type (VSTRING), intent(in) :: str
    type (VSTRING), intent(in) :: set
    logical, optional :: back
    integer :: result
end function string_scan_string

string_scan_char

private function string_scan_char (str, set, back) result (result)
    type (VSTRING), intent(in) :: str
    character (len=*), intent(in) :: set
    logical, optional :: back
    integer :: result
end function string_scan_char

string_verify_string

private function string_verify_string (string, set, back) result (result)
    type (VSTRING), intent(in) :: string
    type (VSTRING), intent(in) :: set
    logical, optional :: back
    integer :: result
end function string_verify_string

string_verify_char

private function string_verify_char (string, set, back) result (result)
    type (VSTRING), intent(in) :: string
    character (len=*), intent(in) :: set
    logical, optional :: back
    integer :: result
end function string_verify_char

extract_string

private type (VSTRING) function extract_string (string, start, finish)
    type (VSTRING), intent(in) :: string
    integer, optional, intent(in) :: start
    integer, optional, intent(in) :: finish
end function extract_string

split_c

private subroutine split_c (string, word, set, separator, back)
    type (VSTRING), intent(inout) :: string
    type (VSTRING), intent(out) :: word
    character (len=*), intent(in) :: set
    type (VSTRING), optional, intent(out) :: separator
    logical, optional, intent(in) :: back
    ! Calls: left_shift, shorten
end subroutine split_c

split_s

private subroutine split_s (string, word, set, separator, back)
    type (VSTRING), intent(inout) :: string
    type (VSTRING), intent(out) :: word
    type (VSTRING), intent(in) :: set
    type (VSTRING), optional, intent(out) :: separator
    logical, optional, intent(in) :: back
    ! Calls: split_c
end subroutine split_s

shorten

private subroutine shorten (string, newlen)
    type (VSTRING), intent(inout) :: string
    integer, intent(in) :: newlen
end subroutine shorten

left_shift

private subroutine left_shift (string, width)
    type (VSTRING), intent(inout) :: string
    integer, intent(in) :: width
end subroutine left_shift

element

private function element (string, pos) result (result)
    type (VSTRING), intent(in) :: string
    integer, intent(in) :: pos
    character :: result
end function element

char_add_char

private function char_add_char (lhs, rhs) result (result)
    character (len=*), intent(in) :: lhs
    character (len=*), intent(in) :: rhs
    type (VSTRING) :: result
    ! Calls: dcstringbase_warnlim
end function char_add_char