iso_varying_string Module

iso_varying_string.f90

Copyright (C) 2003 Rich Townsend townsend@astro.wisc.edu

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General
Public License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA


Developer : Rich Townsend townsend@astro.wisc.edu

Synopsis : Definition of iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:2000 (varying-length strings for Fortran 95).

Notes : This implementation of iso_varying_string is designed to avoid the possibility of memory leaks. To achieve this, it takes advantage of language extensions specified in ISO/IEC TR 15581 (enhanced data type facilities). Many vendors support these extensions, and they will form a core part of Fortran 2000.

Version : 1.2

Thanks : Lawrie Schonfelder's iso_varying_string module provided me with much insight on how to go about writing this module, for which I am very grateful. Furthermore, Lawrie helped point out some subtle bugs in the module.


Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: GET_BUFFER_LEN = 256

Interfaces

public interface adjustl

  • private elemental function adjustl_(string) result(adjustl_string)

    Adjust the varying string to the left

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string

    Return Value type(varying_string)

public interface adjustr

  • private elemental function adjustr_(string) result(adjustr_string)

    Adjust the varying string to the right

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string

    Return Value type(varying_string)

public interface assignment(=)

  • private elemental subroutine op_assign_CH_VS(var, exp)

    Assign a varying string to a character string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(out) :: var
    type(varying_string), intent(in) :: exp
  • private elemental subroutine op_assign_VS_CH(var, exp)

    Assign a character string to a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(out) :: var
    character(len=*), intent(in) :: exp

public interface char

  • private pure function char_auto(string) result(char_string)

    Convert a varying string into a character string (automatic length)

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string

    Return Value character(len=len)

  • private pure function char_fixed(string, length) result(char_string)

    Convert a varying string into a character string (fixed length)

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: length

    Return Value character(len=length)

public interface extract

  • private elemental function extract_VS(string, start, finish) result(ext_string)

    Extract a varying substring from a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in), optional :: start
    integer, intent(in), optional :: finish

    Return Value type(varying_string)

  • private elemental function extract_CH(string, start, finish) result(ext_string)

    Extract a varying substring from a character string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in), optional :: start
    integer, intent(in), optional :: finish

    Return Value type(varying_string)

public interface get

  • private subroutine get_(string, maxlen, iostat)

    Read from the default unit into a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(out) :: string
    integer, intent(in), optional :: maxlen
    integer, intent(out), optional :: iostat
  • private subroutine get_unit(unit, string, maxlen, iostat)

    Read from the specified unit into a varying string

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(varying_string), intent(out) :: string
    integer, intent(in), optional :: maxlen
    integer, intent(out), optional :: iostat
  • private subroutine get_set_VS(string, set, separator, maxlen, iostat)

    Read from the default unit into a varying string, with a custom varying-string separator

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(out) :: string
    type(varying_string), intent(in) :: set
    type(varying_string), intent(out), optional :: separator
    integer, intent(in), optional :: maxlen
    integer, intent(out), optional :: iostat
  • private subroutine get_set_CH(string, set, separator, maxlen, iostat)

    Read from the default unit into a varying string, with a custom character-string separator

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(out) :: string
    character(len=*), intent(in) :: set
    type(varying_string), intent(out), optional :: separator
    integer, intent(in), optional :: maxlen
    integer, intent(out), optional :: iostat
  • private subroutine get_unit_set_VS(unit, string, set, separator, maxlen, iostat)

    Read from the specified unit into a varying string, with a custom varying-string separator

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(varying_string), intent(out) :: string
    type(varying_string), intent(in) :: set
    type(varying_string), intent(out), optional :: separator
    integer, intent(in), optional :: maxlen
    integer, intent(out), optional :: iostat
  • private subroutine get_unit_set_CH(unit, string, set, separator, maxlen, iostat)

    Read from the default unit into a varying string, with a custom character-string separator

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(varying_string), intent(out) :: string
    character(len=*), intent(in) :: set
    type(varying_string), intent(out), optional :: separator
    integer, intent(in), optional :: maxlen
    integer, intent(out), optional :: iostat

public interface iachar

  • private elemental function iachar_(c) result(i)

    Get the position in the ISO 646 collating sequence of a varying string character

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: c

    Return Value integer

public interface ichar

  • private elemental function ichar_(c) result(i)

    Get the position in the processor collating sequence of a varying string character

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: c

    Return Value integer

public interface index

  • private elemental function index_VS_VS(string, substring, back) result(i_substring)

    Get the index of a varying substring within a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    type(varying_string), intent(in) :: substring
    logical, intent(in), optional :: back

    Return Value integer

  • private elemental function index_CH_VS(string, substring, back) result(i_substring)

    Get the index of a varying substring within a character string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    type(varying_string), intent(in) :: substring
    logical, intent(in), optional :: back

    Return Value integer

  • private elemental function index_VS_CH(string, substring, back) result(i_substring)

    Get the index of a character substring within a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    character(len=*), intent(in) :: substring
    logical, intent(in), optional :: back

    Return Value integer

public interface insert

  • private elemental function insert_VS_VS(string, start, substring) result(ins_string)

    Insert a varying substring into a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: start
    type(varying_string), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function insert_CH_VS(string, start, substring) result(ins_string)

    Insert a varying substring into a character string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in) :: start
    type(varying_string), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function insert_VS_CH(string, start, substring) result(ins_string)

    Insert a character substring into a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: start
    character(len=*), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function insert_CH_CH(string, start, substring) result(ins_string)

    Insert a character substring into a character string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in) :: start
    character(len=*), intent(in) :: substring

    Return Value type(varying_string)

public interface len

  • private elemental function len_(string) result(length)

    Get the length of a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string

    Return Value integer

public interface len_trim

  • private elemental function len_trim_(string) result(length)

    Get the trimmed length of a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string

    Return Value integer

public interface lge

  • private elemental function lge_VS_VS(string_a, string_b) result(comp)

    Compare (LGE) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function lge_CH_VS(string_a, string_b) result(comp)

    Compare (LGE) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function lge_VS_CH(string_a, string_b) result(comp)

    Compare (LGE) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface lgt

  • private elemental function lgt_VS_VS(string_a, string_b) result(comp)

    Compare (LGT) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function lgt_CH_VS(string_a, string_b) result(comp)

    Compare (LGT) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function lgt_VS_CH(string_a, string_b) result(comp)

    Compare (LGT) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface lle

  • private elemental function lle_VS_VS(string_a, string_b) result(comp)

    Compare (LLE) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function lle_CH_VS(string_a, string_b) result(comp)

    Compare (LLE) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function lle_VS_CH(string_a, string_b) result(comp)

    Compare (LLE) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface llt

  • private elemental function llt_VS_VS(string_a, string_b) result(comp)

    Compare (LLT) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function llt_CH_VS(string_a, string_b) result(comp)

    Compare (LLT) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function llt_VS_CH(string_a, string_b) result(comp)

    Compare (LLT) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface operator(//)

  • private elemental function op_concat_VS_VS(string_a, string_b) result(concat_string)

    Concatenate two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value type(varying_string)

  • private elemental function op_concat_CH_VS(string_a, string_b) result(concat_string)

    Concatenate a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value type(varying_string)

  • private elemental function op_concat_VS_CH(string_a, string_b) result(concat_string)

    Concatenate a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value type(varying_string)

public interface operator(/=)

  • private elemental function op_ne_VS_VS(string_a, string_b) result(op_ne)

    Compare (/=) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_ne_CH_VS(string_a, string_b) result(op_ne)

    Compare (/=) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_ne_VS_CH(string_a, string_b) result(op_ne)

    Compare (/=) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface operator(<)

  • private elemental function op_lt_VS_VS(string_a, string_b) result(op_lt)

    Compare (<) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_lt_CH_VS(string_a, string_b) result(op_lt)

    Compare (<) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_lt_VS_CH(string_a, string_b) result(op_lt)

    Compare (<) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface operator(<=)

  • private elemental function op_le_VS_VS(string_a, string_b) result(op_le)

    Compare (<=) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_le_CH_VS(string_a, string_b) result(op_le)

    Compare (<=) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_le_VS_CH(string_a, string_b) result(op_le)

    Compare (<=) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface operator(==)

  • private elemental function op_eq_VS_VS(string_a, string_b) result(op_eq)

    Compare (==) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_eq_CH_VS(string_a, string_b) result(op_eq)

    Compare (==) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_eq_VS_CH(string_a, string_b) result(op_eq)

    Compare (==) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface operator(>)

  • private elemental function op_gt_VS_VS(string_a, string_b) result(op_gt)

    Compare (>) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_gt_CH_VS(string_a, string_b) result(op_gt)

    Compare (>) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_gt_VS_CH(string_a, string_b) result(op_gt)

    Compare (>) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface operator(>=)

  • private elemental function op_ge_VS_VS(string_a, string_b) result(op_ge)

    Compare (>=) two varying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_ge_CH_VS(string_a, string_b) result(op_ge)

    Compare (>=) a character string and a varying string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string_a
    type(varying_string), intent(in) :: string_b

    Return Value logical

  • private elemental function op_ge_VS_CH(string_a, string_b) result(op_ge)

    Compare (>=) a varying string and a character string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string_a
    character(len=*), intent(in) :: string_b

    Return Value logical

public interface put

  • private subroutine put_VS(string, iostat)

    Append a varying string to the current record of the default unit

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(out), optional :: iostat
  • private subroutine put_CH(string, iostat)

    Append a character string to the current record of the default unit

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(out), optional :: iostat
  • private subroutine put_unit_VS(unit, string, iostat)

    Append a varying string to the current record of the specified unit

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(varying_string), intent(in) :: string
    integer, intent(out), optional :: iostat
  • private subroutine put_unit_CH(unit, string, iostat)

    Append a character string to the current record of the specified unit

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    character(len=*), intent(in) :: string
    integer, intent(out), optional :: iostat

public interface put_line

  • private subroutine put_line_VS(string, iostat)

    Append a varying string to the current record of the default unit, terminating the record

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(out), optional :: iostat
  • private subroutine put_line_CH(string, iostat)

    Append a varying string to the current record of the default unit, terminating the record

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(out), optional :: iostat
  • private subroutine put_line_unit_VS(unit, string, iostat)

    Append a varying string to the current record of the specified unit, terminating the record

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(varying_string), intent(in) :: string
    integer, intent(out), optional :: iostat
  • private subroutine put_line_unit_CH(unit, string, iostat)

    Append a varying string to the current record of the specified unit, terminating the record

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    character(len=*), intent(in) :: string
    integer, intent(out), optional :: iostat

public interface remove

  • private elemental function remove_VS(string, start, finish) result(rem_string)

    Remove a substring from a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in), optional :: start
    integer, intent(in), optional :: finish

    Return Value type(varying_string)

  • private elemental function remove_CH(string, start, finish) result(rem_string)

    Remove a substring from a character string

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in), optional :: start
    integer, intent(in), optional :: finish

    Return Value type(varying_string)

public interface repeat

  • private elemental function repeat_(string, ncopies) result(repeat_string)

    Concatenate several copies of a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: ncopies

    Return Value type(varying_string)

public interface replace

  • private elemental function replace_VS_VS_auto(string, start, substring) result(rep_string)

    Replace part of a varying string with a varying substring

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: start
    type(varying_string), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_CH_VS_auto(string, start, substring) result(rep_string)

    Replace part of a character string with a varying substring

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in) :: start
    type(varying_string), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_VS_CH_auto(string, start, substring) result(rep_string)

    Replace part of a varying string with a character substring

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: start
    character(len=*), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_CH_CH_auto(string, start, substring) result(rep_string)

    Replace part of a character string with a character substring

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in) :: start
    character(len=*), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_VS_VS_fixed(string, start, finish, substring) result(rep_string)

    Replace part of a varying string with a varying substring

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: start
    integer, intent(in) :: finish
    type(varying_string), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_CH_VS_fixed(string, start, finish, substring) result(rep_string)

    Replace part of a character string with a varying substring

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in) :: start
    integer, intent(in) :: finish
    type(varying_string), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_VS_CH_fixed(string, start, finish, substring) result(rep_string)

    Replace part of a varying string with a character substring

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    integer, intent(in) :: start
    integer, intent(in) :: finish
    character(len=*), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_CH_CH_fixed(string, start, finish, substring) result(rep_string)

    Replace part of a character string with a character substring

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    integer, intent(in) :: start
    integer, intent(in) :: finish
    character(len=*), intent(in) :: substring

    Return Value type(varying_string)

  • private elemental function replace_VS_VS_VS_target(string, target, substring, every, back) result(rep_string)

    Replace part of a varying string with a varying substring, at a location matching a varying- string target

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    type(varying_string), intent(in) :: target
    type(varying_string), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

  • private elemental function replace_CH_VS_VS_target(string, target, substring, every, back) result(rep_string)

    Replace part of a character string with a varying substring, at a location matching a varying- string target

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    type(varying_string), intent(in) :: target
    type(varying_string), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

  • private elemental function replace_VS_CH_VS_target(string, target, substring, every, back) result(rep_string)

    Replace part of a character string with a varying substring, at a location matching a character- string target

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    character(len=*), intent(in) :: target
    type(varying_string), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

  • private elemental function replace_CH_CH_VS_target(string, target, substring, every, back) result(rep_string)

    Replace part of a character string with a varying substring, at a location matching a character- string target

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    character(len=*), intent(in) :: target
    type(varying_string), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

  • private elemental function replace_VS_VS_CH_target(string, target, substring, every, back) result(rep_string)

    Replace part of a varying string with a character substring, at a location matching a varying- string target

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    type(varying_string), intent(in) :: target
    character(len=*), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

  • private elemental function replace_CH_VS_CH_target(string, target, substring, every, back) result(rep_string)

    Replace part of a character string with a character substring, at a location matching a varying- string target

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    type(varying_string), intent(in) :: target
    character(len=*), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

  • private elemental function replace_VS_CH_CH_target(string, target, substring, every, back) result(rep_string)

    Replace part of a varying string with a character substring, at a location matching a character- string target

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    character(len=*), intent(in) :: target
    character(len=*), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

  • private elemental function replace_CH_CH_CH_target(string, target, substring, every, back) result(rep_string)

    Handle special cases when LEN(target) == 0. Such instances are prohibited by the standard, but since this function is elemental, no error can be thrown. Therefore, it makes sense to handle them in a sensible manner

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    character(len=*), intent(in) :: target
    character(len=*), intent(in) :: substring
    logical, intent(in), optional :: every
    logical, intent(in), optional :: back

    Return Value type(varying_string)

public interface scan

  • private elemental function scan_VS_VS(string, set, back) result(i)

    Scan a varying string for occurrences of characters in a varying-string set

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    type(varying_string), intent(in) :: set
    logical, intent(in), optional :: back

    Return Value integer

  • private elemental function scan_CH_VS(string, set, back) result(i)

    Scan a character string for occurrences of characters in a varying-string set

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    type(varying_string), intent(in) :: set
    logical, intent(in), optional :: back

    Return Value integer

  • private elemental function scan_VS_CH(string, set, back) result(i)

    Scan a varying string for occurrences of characters in a character-string set

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    character(len=*), intent(in) :: set
    logical, intent(in), optional :: back

    Return Value integer

public interface split

  • private elemental subroutine split_VS(string, word, set, separator, back)

    Split a varying string into two verying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(inout) :: string
    type(varying_string), intent(out) :: word
    type(varying_string), intent(in) :: set
    type(varying_string), intent(out), optional :: separator
    logical, intent(in), optional :: back
  • private elemental subroutine split_CH(string, word, set, separator, back)

    Split a varying string into two verying strings

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(inout) :: string
    type(varying_string), intent(out) :: word
    character(len=*), intent(in) :: set
    type(varying_string), intent(out), optional :: separator
    logical, intent(in), optional :: back

public interface trim

  • private elemental function trim_(string) result(trim_string)

    Remove trailing blanks from a varying string

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string

    Return Value type(varying_string)

public interface var_str

  • private elemental function var_str_(char) result(string)

    Convert a character string to a varying string

    Arguments

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

    Return Value type(varying_string)

public interface verify

  • private elemental function verify_VS_VS(string, set, back) result(i)

    Verify a varying string for occurrences of characters in a varying-string set

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    type(varying_string), intent(in) :: set
    logical, intent(in), optional :: back

    Return Value integer

  • private elemental function verify_CH_VS(string, set, back) result(i)

    Verify a character string for occurrences of characters in a varying-string set

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: string
    type(varying_string), intent(in) :: set
    logical, intent(in), optional :: back

    Return Value integer

  • private elemental function verify_VS_CH(string, set, back) result(i)

    Verify a varying string for occurrences of characters in a character-string set

    Arguments

    Type IntentOptional Attributes Name
    type(varying_string), intent(in) :: string
    character(len=*), intent(in) :: set
    logical, intent(in), optional :: back

    Return Value integer


Derived Types

type, public ::  varying_string

Components

Type Visibility Attributes Name Initial
character(len=1), private, dimension(:), allocatable :: chars

Functions

private elemental function adjustl_(string) result(adjustl_string)

Adjust the varying string to the left

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string

Return Value type(varying_string)

private elemental function adjustr_(string) result(adjustr_string)

Adjust the varying string to the right

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string

Return Value type(varying_string)

private pure function char_auto(string) result(char_string)

Convert a varying string into a character string (automatic length)

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string

Return Value character(len=len)

private pure function char_fixed(string, length) result(char_string)

Convert a varying string into a character string (fixed length)

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: length

Return Value character(len=length)

private elemental function extract_CH(string, start, finish) result(ext_string)

Extract a varying substring from a character string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in), optional :: start
integer, intent(in), optional :: finish

Return Value type(varying_string)

private elemental function extract_VS(string, start, finish) result(ext_string)

Extract a varying substring from a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in), optional :: start
integer, intent(in), optional :: finish

Return Value type(varying_string)

private elemental function iachar_(c) result(i)

Get the position in the ISO 646 collating sequence of a varying string character

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: c

Return Value integer

private elemental function ichar_(c) result(i)

Get the position in the processor collating sequence of a varying string character

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: c

Return Value integer

private elemental function index_CH_VS(string, substring, back) result(i_substring)

Get the index of a varying substring within a character string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
type(varying_string), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer

private elemental function index_VS_CH(string, substring, back) result(i_substring)

Get the index of a character substring within a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
character(len=*), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer

private elemental function index_VS_VS(string, substring, back) result(i_substring)

Get the index of a varying substring within a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
type(varying_string), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer

private elemental function insert_CH_CH(string, start, substring) result(ins_string)

Insert a character substring into a character string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in) :: start
character(len=*), intent(in) :: substring

Return Value type(varying_string)

private elemental function insert_CH_VS(string, start, substring) result(ins_string)

Insert a varying substring into a character string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in) :: start
type(varying_string), intent(in) :: substring

Return Value type(varying_string)

private elemental function insert_VS_CH(string, start, substring) result(ins_string)

Insert a character substring into a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: start
character(len=*), intent(in) :: substring

Return Value type(varying_string)

private elemental function insert_VS_VS(string, start, substring) result(ins_string)

Insert a varying substring into a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: start
type(varying_string), intent(in) :: substring

Return Value type(varying_string)

private elemental function len_(string) result(length)

Get the length of a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string

Return Value integer

private elemental function len_trim_(string) result(length)

Get the trimmed length of a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string

Return Value integer

private elemental function lge_CH_VS(string_a, string_b) result(comp)

Compare (LGE) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function lge_VS_CH(string_a, string_b) result(comp)

Compare (LGE) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function lge_VS_VS(string_a, string_b) result(comp)

Compare (LGE) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function lgt_CH_VS(string_a, string_b) result(comp)

Compare (LGT) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function lgt_VS_CH(string_a, string_b) result(comp)

Compare (LGT) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function lgt_VS_VS(string_a, string_b) result(comp)

Compare (LGT) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function lle_CH_VS(string_a, string_b) result(comp)

Compare (LLE) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function lle_VS_CH(string_a, string_b) result(comp)

Compare (LLE) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function lle_VS_VS(string_a, string_b) result(comp)

Compare (LLE) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function llt_CH_VS(string_a, string_b) result(comp)

Compare (LLT) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function llt_VS_CH(string_a, string_b) result(comp)

Compare (LLT) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function llt_VS_VS(string_a, string_b) result(comp)

Compare (LLT) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_concat_CH_VS(string_a, string_b) result(concat_string)

Concatenate a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value type(varying_string)

private elemental function op_concat_VS_CH(string_a, string_b) result(concat_string)

Concatenate a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value type(varying_string)

private elemental function op_concat_VS_VS(string_a, string_b) result(concat_string)

Concatenate two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value type(varying_string)

private elemental function op_eq_CH_VS(string_a, string_b) result(op_eq)

Compare (==) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_eq_VS_CH(string_a, string_b) result(op_eq)

Compare (==) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function op_eq_VS_VS(string_a, string_b) result(op_eq)

Compare (==) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_ge_CH_VS(string_a, string_b) result(op_ge)

Compare (>=) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_ge_VS_CH(string_a, string_b) result(op_ge)

Compare (>=) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function op_ge_VS_VS(string_a, string_b) result(op_ge)

Compare (>=) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_gt_CH_VS(string_a, string_b) result(op_gt)

Compare (>) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_gt_VS_CH(string_a, string_b) result(op_gt)

Compare (>) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function op_gt_VS_VS(string_a, string_b) result(op_gt)

Compare (>) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_le_CH_VS(string_a, string_b) result(op_le)

Compare (<=) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_le_VS_CH(string_a, string_b) result(op_le)

Compare (<=) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function op_le_VS_VS(string_a, string_b) result(op_le)

Compare (<=) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_lt_CH_VS(string_a, string_b) result(op_lt)

Compare (<) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_lt_VS_CH(string_a, string_b) result(op_lt)

Compare (<) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function op_lt_VS_VS(string_a, string_b) result(op_lt)

Compare (<) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_ne_CH_VS(string_a, string_b) result(op_ne)

Compare (/=) a character string and a varying string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function op_ne_VS_CH(string_a, string_b) result(op_ne)

Compare (/=) a varying string and a character string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
character(len=*), intent(in) :: string_b

Return Value logical

private elemental function op_ne_VS_VS(string_a, string_b) result(op_ne)

Compare (/=) two varying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string_a
type(varying_string), intent(in) :: string_b

Return Value logical

private elemental function remove_CH(string, start, finish) result(rem_string)

Remove a substring from a character string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in), optional :: start
integer, intent(in), optional :: finish

Return Value type(varying_string)

private elemental function remove_VS(string, start, finish) result(rem_string)

Remove a substring from a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in), optional :: start
integer, intent(in), optional :: finish

Return Value type(varying_string)

private elemental function repeat_(string, ncopies) result(repeat_string)

Concatenate several copies of a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: ncopies

Return Value type(varying_string)

private elemental function replace_CH_CH_CH_target(string, target, substring, every, back) result(rep_string)

Handle special cases when LEN(target) == 0. Such instances are prohibited by the standard, but since this function is elemental, no error can be thrown. Therefore, it makes sense to handle them in a sensible manner

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
character(len=*), intent(in) :: target
character(len=*), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_CH_CH_VS_target(string, target, substring, every, back) result(rep_string)

Replace part of a character string with a varying substring, at a location matching a character- string target

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
character(len=*), intent(in) :: target
type(varying_string), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_CH_CH_auto(string, start, substring) result(rep_string)

Replace part of a character string with a character substring

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in) :: start
character(len=*), intent(in) :: substring

Return Value type(varying_string)

private elemental function replace_CH_CH_fixed(string, start, finish, substring) result(rep_string)

Replace part of a character string with a character substring

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in) :: start
integer, intent(in) :: finish
character(len=*), intent(in) :: substring

Return Value type(varying_string)

private elemental function replace_CH_VS_CH_target(string, target, substring, every, back) result(rep_string)

Replace part of a character string with a character substring, at a location matching a varying- string target

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
type(varying_string), intent(in) :: target
character(len=*), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_CH_VS_VS_target(string, target, substring, every, back) result(rep_string)

Replace part of a character string with a varying substring, at a location matching a varying- string target

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
type(varying_string), intent(in) :: target
type(varying_string), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_CH_VS_auto(string, start, substring) result(rep_string)

Replace part of a character string with a varying substring

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in) :: start
type(varying_string), intent(in) :: substring

Return Value type(varying_string)

private elemental function replace_CH_VS_fixed(string, start, finish, substring) result(rep_string)

Replace part of a character string with a varying substring

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(in) :: start
integer, intent(in) :: finish
type(varying_string), intent(in) :: substring

Return Value type(varying_string)

private elemental function replace_VS_CH_CH_target(string, target, substring, every, back) result(rep_string)

Replace part of a varying string with a character substring, at a location matching a character- string target

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
character(len=*), intent(in) :: target
character(len=*), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_VS_CH_VS_target(string, target, substring, every, back) result(rep_string)

Replace part of a character string with a varying substring, at a location matching a character- string target

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
character(len=*), intent(in) :: target
type(varying_string), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_VS_CH_auto(string, start, substring) result(rep_string)

Replace part of a varying string with a character substring

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: start
character(len=*), intent(in) :: substring

Return Value type(varying_string)

private elemental function replace_VS_CH_fixed(string, start, finish, substring) result(rep_string)

Replace part of a varying string with a character substring

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: start
integer, intent(in) :: finish
character(len=*), intent(in) :: substring

Return Value type(varying_string)

private elemental function replace_VS_VS_CH_target(string, target, substring, every, back) result(rep_string)

Replace part of a varying string with a character substring, at a location matching a varying- string target

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
type(varying_string), intent(in) :: target
character(len=*), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_VS_VS_VS_target(string, target, substring, every, back) result(rep_string)

Replace part of a varying string with a varying substring, at a location matching a varying- string target

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
type(varying_string), intent(in) :: target
type(varying_string), intent(in) :: substring
logical, intent(in), optional :: every
logical, intent(in), optional :: back

Return Value type(varying_string)

private elemental function replace_VS_VS_auto(string, start, substring) result(rep_string)

Replace part of a varying string with a varying substring

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: start
type(varying_string), intent(in) :: substring

Return Value type(varying_string)

private elemental function replace_VS_VS_fixed(string, start, finish, substring) result(rep_string)

Replace part of a varying string with a varying substring

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(in) :: start
integer, intent(in) :: finish
type(varying_string), intent(in) :: substring

Return Value type(varying_string)

private elemental function scan_CH_VS(string, set, back) result(i)

Scan a character string for occurrences of characters in a varying-string set

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
type(varying_string), intent(in) :: set
logical, intent(in), optional :: back

Return Value integer

private elemental function scan_VS_CH(string, set, back) result(i)

Scan a varying string for occurrences of characters in a character-string set

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
character(len=*), intent(in) :: set
logical, intent(in), optional :: back

Return Value integer

private elemental function scan_VS_VS(string, set, back) result(i)

Scan a varying string for occurrences of characters in a varying-string set

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
type(varying_string), intent(in) :: set
logical, intent(in), optional :: back

Return Value integer

private elemental function trim_(string) result(trim_string)

Remove trailing blanks from a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string

Return Value type(varying_string)

private elemental function var_str_(char) result(string)

Convert a character string to a varying string

Arguments

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

Return Value type(varying_string)

private elemental function verify_CH_VS(string, set, back) result(i)

Verify a character string for occurrences of characters in a varying-string set

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
type(varying_string), intent(in) :: set
logical, intent(in), optional :: back

Return Value integer

private elemental function verify_VS_CH(string, set, back) result(i)

Verify a varying string for occurrences of characters in a character-string set

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
character(len=*), intent(in) :: set
logical, intent(in), optional :: back

Return Value integer

private elemental function verify_VS_VS(string, set, back) result(i)

Verify a varying string for occurrences of characters in a varying-string set

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
type(varying_string), intent(in) :: set
logical, intent(in), optional :: back

Return Value integer


Subroutines

private subroutine get_(string, maxlen, iostat)

Read from the default unit into a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(out) :: string
integer, intent(in), optional :: maxlen
integer, intent(out), optional :: iostat

private subroutine get_set_CH(string, set, separator, maxlen, iostat)

Read from the default unit into a varying string, with a custom character-string separator

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(out) :: string
character(len=*), intent(in) :: set
type(varying_string), intent(out), optional :: separator
integer, intent(in), optional :: maxlen
integer, intent(out), optional :: iostat

private subroutine get_set_VS(string, set, separator, maxlen, iostat)

Read from the default unit into a varying string, with a custom varying-string separator

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(out) :: string
type(varying_string), intent(in) :: set
type(varying_string), intent(out), optional :: separator
integer, intent(in), optional :: maxlen
integer, intent(out), optional :: iostat

private subroutine get_unit(unit, string, maxlen, iostat)

Read from the specified unit into a varying string

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
type(varying_string), intent(out) :: string
integer, intent(in), optional :: maxlen
integer, intent(out), optional :: iostat

private subroutine get_unit_set_CH(unit, string, set, separator, maxlen, iostat)

Read from the default unit into a varying string, with a custom character-string separator

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
type(varying_string), intent(out) :: string
character(len=*), intent(in) :: set
type(varying_string), intent(out), optional :: separator
integer, intent(in), optional :: maxlen
integer, intent(out), optional :: iostat

private subroutine get_unit_set_VS(unit, string, set, separator, maxlen, iostat)

Read from the specified unit into a varying string, with a custom varying-string separator

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
type(varying_string), intent(out) :: string
type(varying_string), intent(in) :: set
type(varying_string), intent(out), optional :: separator
integer, intent(in), optional :: maxlen
integer, intent(out), optional :: iostat

private elemental subroutine op_assign_CH_VS(var, exp)

Assign a varying string to a character string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(out) :: var
type(varying_string), intent(in) :: exp

private elemental subroutine op_assign_VS_CH(var, exp)

Assign a character string to a varying string

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(out) :: var
character(len=*), intent(in) :: exp

private subroutine put_CH(string, iostat)

Append a character string to the current record of the default unit

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(out), optional :: iostat

private subroutine put_VS(string, iostat)

Append a varying string to the current record of the default unit

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(out), optional :: iostat

private subroutine put_line_CH(string, iostat)

Append a varying string to the current record of the default unit, terminating the record

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
integer, intent(out), optional :: iostat

private subroutine put_line_VS(string, iostat)

Append a varying string to the current record of the default unit, terminating the record

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(in) :: string
integer, intent(out), optional :: iostat

private subroutine put_line_unit_CH(unit, string, iostat)

Append a varying string to the current record of the specified unit, terminating the record

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
character(len=*), intent(in) :: string
integer, intent(out), optional :: iostat

private subroutine put_line_unit_VS(unit, string, iostat)

Append a varying string to the current record of the specified unit, terminating the record

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
type(varying_string), intent(in) :: string
integer, intent(out), optional :: iostat

private subroutine put_unit_CH(unit, string, iostat)

Append a character string to the current record of the specified unit

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
character(len=*), intent(in) :: string
integer, intent(out), optional :: iostat

private subroutine put_unit_VS(unit, string, iostat)

Append a varying string to the current record of the specified unit

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
type(varying_string), intent(in) :: string
integer, intent(out), optional :: iostat

private elemental subroutine split_CH(string, word, set, separator, back)

Split a varying string into two verying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(inout) :: string
type(varying_string), intent(out) :: word
character(len=*), intent(in) :: set
type(varying_string), intent(out), optional :: separator
logical, intent(in), optional :: back

private elemental subroutine split_VS(string, word, set, separator, back)

Split a varying string into two verying strings

Arguments

Type IntentOptional Attributes Name
type(varying_string), intent(inout) :: string
type(varying_string), intent(out) :: word
type(varying_string), intent(in) :: set
type(varying_string), intent(out), optional :: separator
logical, intent(in), optional :: back