TUV-x
|
The string_t type and related functions. More...
Data Types | |
type | string_t |
Generic string type. More... | |
interface | to_char |
Converts values to character arrays. More... | |
Functions/Subroutines | |
subroutine | string_assign_char (to, from) |
Assigns a string from a character array. More... | |
subroutine | string_assign_int (to, from) |
Assigns a string from an integer. More... | |
subroutine | string_assign_real (to, from) |
Assigns a string from a real number. More... | |
subroutine | string_assign_double (to, from) |
Assigns a string from a double precision real number. More... | |
subroutine | string_assign_logical (to, from) |
Assigns a string from a logical. More... | |
subroutine | char_assign_string (to, from) |
Assign a character array from a string. More... | |
subroutine | real_assign_string (to, from) |
Assign a real from a string. More... | |
subroutine | double_assign_string (to, from) |
Assign a double precision real from a string. More... | |
subroutine | int_assign_string (to, from) |
Assign an integer from a string. More... | |
subroutine | logical_assign_string (to, from) |
Assigns a logical from a string. More... | |
elemental type(string_t) function | string_join_string (a, b) |
Joins a string to a string. More... | |
elemental type(string_t) function | string_join_char (a, b) |
Joins a string to a character array. More... | |
elemental type(string_t) function | string_join_int (a, b) |
Joins a string to an integer. More... | |
elemental type(string_t) function | string_join_real (a, b) |
Joins a string to a real number. More... | |
elemental type(string_t) function | string_join_double (a, b) |
Joins a string to a double precision real number. More... | |
elemental type(string_t) function | string_join_logical (a, b) |
Joins a string to a logical. More... | |
logical elemental function | string_equals_string (a, b) |
Compares a string to a string for equality. More... | |
logical elemental function | string_equals_char (a, b) |
Compares a string to a character array for equality. More... | |
logical elemental function | string_equals_int (a, b) |
Compares a string to a integer for equality. More... | |
logical elemental function | string_equals_real (a, b) |
Compares a string to a real number for equality. More... | |
logical elemental function | string_equals_double (a, b) |
Compares a string to a double-precision real number for equality. More... | |
logical elemental function | string_equals_logical (a, b) |
Compares a string to a logical for equality. More... | |
logical elemental function | string_not_equals_string (a, b) |
Compares a string to a string for equality. More... | |
logical elemental function | string_not_equals_char (a, b) |
Compares a string to a character array for equality. More... | |
logical elemental function | string_not_equals_int (a, b) |
Compares a string to a integer for equality. More... | |
logical elemental function | string_not_equals_real (a, b) |
Compares a string to a real number for equality. More... | |
logical elemental function | string_not_equals_double (a, b) |
Compares a string to a double-precision real number for equality. More... | |
logical elemental function | string_not_equals_logical (a, b) |
Compares a string to a logical for equality. More... | |
elemental integer function | length (this) |
Returns the length of the string. More... | |
type(string_t) function | to_upper (this) |
Converts a string to upper case. More... | |
type(string_t) function | to_lower (this) |
Converts a string to lower case. More... | |
type(string_t) function | substring (this, start_index, length) |
Returns a substring. More... | |
type(string_t) function, dimension(:), allocatable | split_char (this, splitter, compress) |
Splits a string on a substring. More... | |
type(string_t) function, dimension(:), allocatable | split_string (this, splitter, compress) |
Splits a string on a substring. More... | |
type(string_t) function | replace (this, from, to) |
Replaces substrings within a string. More... | |
character(len=:) function, allocatable | string_to_char (this) |
Converts a string to a character array. More... | |
elemental type(string_t) function | char_join_string (a, b) |
Joins a character array to a string. More... | |
elemental type(string_t) function | int_join_string (a, b) |
Joins an integer to a string. More... | |
elemental type(string_t) function | real_join_string (a, b) |
Joins a real number to a string. More... | |
elemental type(string_t) function | double_join_string (a, b) |
Joins a double precision real number to a string. More... | |
elemental type(string_t) function | logical_join_string (a, b) |
Joins a logical to a string. More... | |
logical elemental function | char_equals_string (a, b) |
Compares a character array to a string for equality. More... | |
logical elemental function | int_equals_string (a, b) |
Compares an integer to a string for equality. More... | |
logical elemental function | real_equals_string (a, b) |
Compares a real number to a string for equality. More... | |
logical elemental function | double_equals_string (a, b) |
Compares a double-precision real number to a string for equality. More... | |
logical elemental function | logical_equals_string (a, b) |
Compares a logical to a string for equality. More... | |
logical elemental function | char_not_equals_string (a, b) |
Compares a character array to a string for equality. More... | |
logical elemental function | int_not_equals_string (a, b) |
Compares an integer to a string for equality. More... | |
logical elemental function | real_not_equals_string (a, b) |
Compares a real number to a string for equality. More... | |
logical elemental function | double_not_equals_string (a, b) |
Compares a double-precision real number to a string for equality. More... | |
logical elemental function | logical_not_equals_string (a, b) |
Compares a logical to a string for equality. More... | |
integer function | pack_size (this, comm) |
Returns the size of a binary buffer required to pack the string. | |
subroutine | mpi_pack (this, buffer, position, comm) |
Packs the string onto a character buffer. More... | |
subroutine | mpi_unpack (this, buffer, position, comm) |
Unpacks a string from a character buffer. More... | |
character(len=kconvertcharlength) function | int_to_char (val) |
Converts an integer to a char array. More... | |
character(len=kconvertcharlength) function | real_to_char (val) |
Converts a real number to a char array. More... | |
character(len=kconvertcharlength) function | double_to_char (val) |
Converts a double-precision real number to a char array. More... | |
character(len=kconvertcharlength) function | complex_real_to_char (val) |
Converts a real complex number to a char array. More... | |
character(len=kconvertcharlength) function | complex_double_to_char (val) |
Converts a double-precision real complex number to a char array. More... | |
character(len=kconvertcharlength) function | logical_to_char (val) |
Converts a logical to a char array. More... | |
subroutine, public | output_table (header, table, file_unit) |
Output tabular data to a given file unit. More... | |
subroutine | assert_msg (code, condition, error_message) |
Local assert function. More... | |
Variables | |
integer(kind=musica_ik), parameter | kconvertcharlength = 100 |
Length of character array for to_char conversions. | |
The string_t type and related functions.
|
private |
Local assert function.
[in] | code | Unique code for the assertion |
[in] | condition | Condition to evaluate |
[in] | error_message | Message to display on failure |
|
private |
Assign a character array from a string.
[in,out] | to | Variable to assign |
[in] | from | String to assign from |
|
private |
Compares a character array to a string for equality.
[in] | a | Character array a |
[in] | b | String b |
|
private |
Joins a character array to a string.
[in] | a | Character array to join |
[in] | b | String to join |
|
private |
Compares a character array to a string for equality.
[in] | a | Character array a |
[in] | b | String b |
|
private |
Converts a double-precision real complex number to a char array.
[in] | val | Value to convert |
|
private |
Converts a real complex number to a char array.
[in] | val | Value to convert |
|
private |
Assign a double precision real from a string.
[in,out] | to | Variable to assign |
[in] | from | String to assign from |
|
private |
Compares a double-precision real number to a string for equality.
[in] | a | Double-precision real number a |
[in] | b | String b |
|
private |
Joins a double precision real number to a string.
[in] | a | Double precision real number to join |
[in] | b | String to join |
|
private |
Compares a double-precision real number to a string for equality.
[in] | a | Double-precition real number a |
[in] | b | String b |
|
private |
Converts a double-precision real number to a char array.
[in] | val | Value to convert |
|
private |
Assign an integer from a string.
[in,out] | to | Variable to assign |
[in] | from | String to assign from |
|
private |
Compares an integer to a string for equality.
[in] | a | Integer a |
[in] | b | String b |
|
private |
Joins an integer to a string.
[in] | a | Integer to join |
[in] | b | String to join |
|
private |
Compares an integer to a string for equality.
[in] | a | Integer a |
[in] | b | String b |
character(len=kconvertcharlength) function musica_string::int_to_char | ( | integer(kind=musica_ik), intent(in) | val | ) |
Converts an integer to a char array.
[in] | val | Value to convert |
|
private |
Returns the length of the string.
[in] | this | String |
|
private |
Assigns a logical from a string.
[in,out] | to | Variable to assign |
[in] | from | String to assign from |
|
private |
Compares a logical to a string for equality.
[in] | a | Logical a |
[in] | b | String b |
|
private |
Joins a logical to a string.
[in] | a | Logical to join |
[in] | b | String to join |
|
private |
Compares a logical to a string for equality.
[in] | a | Logical a |
[in] | b | String b |
|
private |
Converts a logical to a char array.
[in] | val | Value to convert |
subroutine musica_string::mpi_pack | ( | class(string_t), intent(in) | this, |
character, dimension(:), intent(inout) | buffer, | ||
integer, intent(inout) | position, | ||
integer, intent(in) | comm | ||
) |
Packs the string onto a character buffer.
[in] | this | String to pack |
[in,out] | buffer | Memory buffer |
[in,out] | position | Current buffer position |
[in] | comm | MPI communicator |
subroutine musica_string::mpi_unpack | ( | class(string_t), intent(out) | this, |
character, dimension(:), intent(inout) | buffer, | ||
integer, intent(inout) | position, | ||
integer, intent(in) | comm | ||
) |
Unpacks a string from a character buffer.
[out] | this | String to be unpacked |
[in,out] | buffer | Memory buffer |
[in,out] | position | Current buffer position |
[in] | comm | MPI communicator |
subroutine, public musica_string::output_table | ( | type(string_t), dimension(:), intent(in) | header, |
type(string_t), dimension(:,:), intent(in) | table, | ||
integer(kind=musica_ik), intent(in) | file_unit | ||
) |
Output tabular data to a given file unit.
[in] | header | Table header |
[in] | table | Table data (column, row) |
[in] | file_unit | File unit |
|
private |
Assign a real from a string.
[in,out] | to | Variable to assign |
[in] | from | String to assign from |
|
private |
Compares a real number to a string for equality.
[in] | a | Real number a |
[in] | b | String b |
|
private |
Joins a real number to a string.
[in] | a | Real number to join |
[in] | b | String to join |
|
private |
Compares a real number to a string for equality.
[in] | a | Real number a |
[in] | b | String b |
|
private |
Converts a real number to a char array.
[in] | val | Value to convert |
|
private |
Replaces substrings within a string.
Example:
Output:
this | Original string | |
[in] | from | Sub-string to replace |
[in] | to | Replacement string |
|
private |
Splits a string on a substring.
Example:
Output:
[in] | this | Full string |
[in] | splitter | String to split on |
[in] | compress | Compress (default = false) |
No 0-length substrings will be returned (adjacent tokens will be merged; tokens at the beginning and end of the original string will be ignored)
|
private |
Splits a string on a substring.
See string_split_char
for description and example
[in] | this | Full string |
[in] | splitter | String to split on |
[in] | compress | Compress (default = false) |
No 0-length substrings will be returned (adjacent tokens will be merged; tokens at the beginning and end of the original string will be ignored)
|
private |
Assigns a string from a character array.
[out] | to | String to assign |
[in] | from | New string value |
|
private |
Assigns a string from a double precision real number.
[out] | to | String to assign |
[in] | from | New string value |
|
private |
Assigns a string from an integer.
[out] | to | String to assign |
[in] | from | New string value |
|
private |
Assigns a string from a logical.
[out] | to | String to assign |
[in] | from | New string value |
|
private |
Assigns a string from a real number.
[out] | to | String to assign |
[in] | from | New string value |
|
private |
Compares a string to a character array for equality.
[in] | a | String a |
[in] | b | Character array b |
|
private |
Compares a string to a double-precision real number for equality.
[in] | a | String a |
[in] | b | Double-precition real number b |
|
private |
Compares a string to a integer for equality.
[in] | a | String a |
[in] | b | Integer b |
|
private |
Compares a string to a logical for equality.
[in] | a | String a |
[in] | b | Logical b |
|
private |
Compares a string to a real number for equality.
[in] | a | String a |
[in] | b | Real number b |
|
private |
Compares a string to a string for equality.
[in] | a | String a |
[in] | b | String b |
|
private |
Joins a string to a character array.
[in] | a | String to join |
[in] | b | Character array to join |
|
private |
Joins a string to a double precision real number.
[in] | a | String to join |
[in] | b | Double precision real number to join |
|
private |
Joins a string to an integer.
[in] | a | String to join |
[in] | b | Integer to join |
|
private |
Joins a string to a logical.
[in] | a | String to join |
[in] | b | Logical to join |
|
private |
Joins a string to a real number.
[in] | a | String to join |
[in] | b | Real number to join |
|
private |
Joins a string to a string.
[in] | a | String to join |
[in] | b | String to join |
|
private |
Compares a string to a character array for equality.
[in] | a | String a |
[in] | b | Character array b |
|
private |
Compares a string to a double-precision real number for equality.
[in] | a | String a |
[in] | b | Double-precition real number b |
|
private |
Compares a string to a integer for equality.
[in] | a | String a |
[in] | b | Integer b |
|
private |
Compares a string to a logical for equality.
[in] | a | String a |
[in] | b | Logical b |
|
private |
Compares a string to a real number for equality.
[in] | a | String a |
[in] | b | Real number b |
|
private |
Compares a string to a string for equality.
[in] | a | String a |
[in] | b | String b |
|
private |
Converts a string to a character array.
[in] | this | String to convert |
|
private |
Returns a substring.
Example:
Output:
[in] | this | Full string |
[in] | start_index | Starting character index |
[in] | length | Length of the substring to return |
Converts a string to lower case.
Adapted from http://www.star.le.ac.uk/~cgp/fortran.html (25 May 2012) Original author: Clive Page
[in] | this | String to convert |
Converts a string to upper case.
Adapted from http://www.star.le.ac.uk/~cgp/fortran.html (25 May 2012) Original author: Clive Page
[in] | this | String to convert |