Option data of sections.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(string), | private | :: | ocomm | Eventual option inline comment. |
|||
type(string), | private | :: | oname | Option name. |
|||
type(string), | private | :: | ovals | Option values. |
Overload option
name with a function returning a new (initiliazed) option instance.
Return a new (initiliazed) option instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character, | intent(in), | optional | :: | option_name | Option name. |
|
character, | intent(in), | optional | :: | option_values | Option values. |
|
character, | intent(in), | optional | :: | option_comment | Option comment. |
New (initiliazed) option instance.
Assignment overloading.
Assignment between two options.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | lhs | Left hand side. |
||
type(option), | intent(in) | :: | rhs | Rigth hand side. |
Assignment overloading.
Assignment between two options.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | lhs | Left hand side. |
||
type(option), | intent(in) | :: | rhs | Rigth hand side. |
Counting option value(s).
Get the number of values of option data.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
Number of values.
Free dynamic memory.
Get option value (scalar). Get option value (array).
for getting option data value (scalar).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
class(*), | intent(inout) | :: | val | Value. |
||
integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Get option data values (array).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
class(*), | intent(inout) | :: | val(1:) | Value. |
||
character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
|
integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Get option value (array).
Get option data values (array).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
class(*), | intent(inout) | :: | val(1:) | Value. |
||
character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
|
integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Get option value (scalar).
for getting option data value (scalar).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
class(*), | intent(inout) | :: | val | Value. |
||
integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Return option name/values pairs.
Return option name length.
Equal operator overloading.
Equal to string logical operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | lhs | Left hand side. |
||
type(string), | intent(in) | :: | rhs | Right hand side. |
Opreator test result.
Equal to character logical operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | lhs | Left hand side. |
||
character(kind=CK,len=*), | intent(in) | :: | rhs | Right hand side. |
Opreator test result.
Equal to character logical operator.
Equal to character logical operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | lhs | Left hand side. |
||
character(kind=CK,len=*), | intent(in) | :: | rhs | Right hand side. |
Opreator test result.
Equal to string logical operator.
Equal to string logical operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | lhs | Left hand side. |
||
type(string), | intent(in) | :: | rhs | Right hand side. |
Opreator test result.
Parse option data.
Parse option data from a source string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
character, | intent(in) | :: | sep | Separator of option name/value. |
||
type(string), | intent(inout) | :: | source | String containing option data. |
||
integer(kind=I4P), | intent(out) | :: | error | Error code. |
Parse option inline comment.
Parse option inline comment trimming it out from pure value string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
Parse option name.
Parse option name from a source string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
character, | intent(in) | :: | sep | Separator of option name/value. |
||
type(string), | intent(in) | :: | source | String containing option data. |
||
integer(kind=I4P), | intent(out) | :: | error | Error code. |
Parse option values.
Parse option value from a source string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
character, | intent(in) | :: | sep | Separator of option name/value. |
||
type(string), | intent(in) | :: | source | String containing option data. |
||
integer(kind=I4P), | intent(out) | :: | error | Error code. |
Pretty print data.
Print data with a pretty format.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
integer(kind=I4P), | intent(in) | :: | unit | Logic unit. |
||
logical, | intent(in) | :: | retain_comments | Flag for retaining eventual comments. |
||
character, | intent(in), | optional | :: | pref | Prefixing string. |
|
integer(kind=I4P), | intent(out), | optional | :: | iostat | IO error. |
|
character, | intent(out), | optional | :: | iomsg | IO error message. |
Save data.
Save data.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
||
integer(kind=I4P), | intent(in) | :: | unit | Logic unit. |
||
logical, | intent(in) | :: | retain_comments | Flag for retaining eventual comments. |
||
integer(kind=I4P), | intent(out), | optional | :: | iostat | IO error. |
|
character, | intent(out), | optional | :: | iomsg | IO error message. |
Set option value (scalar). Set option value (array).
Set option data value (scalar).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
class(*), | intent(in) | :: | val | Value. |
Set option data value (array).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
class(*), | intent(in) | :: | val(1:) | Value. |
||
character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
Set option value (array).
Set option data value (array).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
class(*), | intent(in) | :: | val(1:) | Value. |
||
character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
Set option value (scalar).
Set option data value (scalar).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
class(*), | intent(in) | :: | val | Value. |
Return option values length.
Return option values length.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(in) | :: | self | Option data. |
Option values length.
type :: option
!< Option data of sections.
private
type(string) :: oname !< Option name.
type(string) :: ovals !< Option values.
type(string) :: ocomm !< Eventual option inline comment.
contains
! public methods
procedure, pass(self) :: count_values !< Counting option value(s).
procedure, pass(self) :: free !< Free dynamic memory.
generic :: get => get_option, & !< Get option value (scalar).
get_a_option !< Get option value (array).
procedure, pass(self) :: get_pairs !< Return option name/values pairs.
procedure, pass(self) :: name_len !< Return option name length.
procedure, pass(self) :: parse !< Parse option data.
procedure, pass(self) :: print => print_option !< Pretty print data.
procedure, pass(self) :: save => save_option !< Save data.
generic :: set => set_option, & !< Set option value (scalar).
set_a_option !< Set option value (array).
procedure, pass(self) :: values_len !< Return option values length.
! operators overloading
generic :: assignment(=) => assign_option !< Assignment overloading.
generic :: operator(==) => option_eq_string, &
option_eq_character !< Equal operator overloading.
! private methods
procedure, private, pass(self) :: get_option !< Get option value (scalar).
procedure, private, pass(self) :: get_a_option !< Get option value (array).
procedure, private, pass(self) :: parse_comment !< Parse option inline comment.
procedure, private, pass(self) :: parse_name !< Parse option name.
procedure, private, pass(self) :: parse_value !< Parse option values.
procedure, private, pass(self) :: set_option !< Set option value (scalar).
procedure, private, pass(self) :: set_a_option !< Set option value (array).
! assignments
procedure, private, pass(lhs) :: assign_option !< Assignment overloading.
! logical operators
procedure, private, pass(lhs) :: option_eq_string !< Equal to string logical operator.
procedure, private, pass(lhs) :: option_eq_character !< Equal to character logical operator.
endtype option